Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_AUDIO_RECEIVE_STREAM_H_ |
| 12 | #define WEBRTC_AUDIO_RECEIVE_STREAM_H_ |
| 13 | |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame^] | 14 | #include <map> |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 15 | #include <string> |
| 16 | #include <vector> |
| 17 | |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 18 | #include "webrtc/config.h" |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame^] | 19 | #include "webrtc/typedefs.h" |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 20 | |
| 21 | namespace webrtc { |
| 22 | |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame^] | 23 | class AudioDecoder; |
| 24 | |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 25 | class AudioReceiveStream { |
| 26 | public: |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame^] | 27 | struct Stats {}; |
| 28 | |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 29 | struct Config { |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 30 | std::string ToString() const; |
| 31 | |
| 32 | // Receive-stream specific RTP settings. |
| 33 | struct Rtp { |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 34 | std::string ToString() const; |
| 35 | |
| 36 | // Synchronization source (stream identifier) to be received. |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame^] | 37 | uint32_t remote_ssrc = 0; |
| 38 | |
| 39 | // Sender SSRC used for sending RTCP (such as receiver reports). |
| 40 | uint32_t local_ssrc = 0; |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 41 | |
| 42 | // RTP header extensions used for the received stream. |
| 43 | std::vector<RtpExtension> extensions; |
| 44 | } rtp; |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame^] | 45 | |
| 46 | // Decoders for every payload that we can receive. Call owns the |
| 47 | // AudioDecoder instances once the Config is submitted to |
| 48 | // Call::CreateReceiveStream(). |
| 49 | // TODO(solenberg): Use unique_ptr<> once our std lib fully supports C++11. |
| 50 | std::map<uint8_t, AudioDecoder*> decoder_map; |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 51 | }; |
| 52 | |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame^] | 53 | virtual Stats GetStats() const = 0; |
| 54 | |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 55 | protected: |
| 56 | virtual ~AudioReceiveStream() {} |
| 57 | }; |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 58 | } // namespace webrtc |
| 59 | |
| 60 | #endif // WEBRTC_AUDIO_RECEIVE_STREAM_H_ |