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" |
Jelena Marusic | cd67022 | 2015-07-16 09:30:09 +0200 | [diff] [blame] | 19 | #include "webrtc/stream.h" |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame] | 20 | #include "webrtc/typedefs.h" |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 21 | |
| 22 | namespace webrtc { |
| 23 | |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame] | 24 | class AudioDecoder; |
| 25 | |
Jelena Marusic | cd67022 | 2015-07-16 09:30:09 +0200 | [diff] [blame] | 26 | class AudioReceiveStream : public ReceiveStream { |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 27 | public: |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame] | 28 | struct Stats {}; |
| 29 | |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 30 | struct Config { |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 31 | std::string ToString() const; |
| 32 | |
| 33 | // Receive-stream specific RTP settings. |
| 34 | struct Rtp { |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 35 | std::string ToString() const; |
| 36 | |
| 37 | // Synchronization source (stream identifier) to be received. |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame] | 38 | uint32_t remote_ssrc = 0; |
| 39 | |
| 40 | // Sender SSRC used for sending RTCP (such as receiver reports). |
| 41 | uint32_t local_ssrc = 0; |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 42 | |
| 43 | // RTP header extensions used for the received stream. |
| 44 | std::vector<RtpExtension> extensions; |
| 45 | } rtp; |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame] | 46 | |
pbos | 8fc7fa7 | 2015-07-15 08:02:58 -0700 | [diff] [blame] | 47 | // Underlying VoiceEngine handle, used to map AudioReceiveStream to |
| 48 | // lower-level components. Temporarily used while VoiceEngine channels are |
| 49 | // created outside of Call. |
| 50 | int voe_channel_id = -1; |
| 51 | |
| 52 | // Identifier for an A/V synchronization group. Empty string to disable. |
| 53 | // TODO(pbos): Synchronize streams in a sync group, not just one video |
| 54 | // stream to one audio stream. Tracked by issue webrtc:4762. |
| 55 | std::string sync_group; |
| 56 | |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame] | 57 | // Decoders for every payload that we can receive. Call owns the |
| 58 | // AudioDecoder instances once the Config is submitted to |
| 59 | // Call::CreateReceiveStream(). |
| 60 | // TODO(solenberg): Use unique_ptr<> once our std lib fully supports C++11. |
| 61 | std::map<uint8_t, AudioDecoder*> decoder_map; |
pbos | 6bb1b6e | 2015-07-24 07:10:18 -0700 | [diff] [blame] | 62 | |
| 63 | // TODO(pbos): Remove config option once combined A/V BWE is always on. |
| 64 | bool combined_audio_video_bwe = false; |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 65 | }; |
| 66 | |
Fredrik Solenberg | 04f4931 | 2015-06-08 13:04:56 +0200 | [diff] [blame] | 67 | virtual Stats GetStats() const = 0; |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 68 | }; |
Fredrik Solenberg | 23fba1f | 2015-04-29 15:24:01 +0200 | [diff] [blame] | 69 | } // namespace webrtc |
| 70 | |
| 71 | #endif // WEBRTC_AUDIO_RECEIVE_STREAM_H_ |