blob: 70d6480b10c1cc3e9d140b93a90b614d1008413e [file] [log] [blame]
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +02001/*
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 Solenberg04f49312015-06-08 13:04:56 +020014#include <map>
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020015#include <string>
16#include <vector>
17
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020018#include "webrtc/config.h"
Jelena Marusiccd670222015-07-16 09:30:09 +020019#include "webrtc/stream.h"
solenbergcf18b342015-10-01 08:13:42 -070020#include "webrtc/transport.h"
Fredrik Solenberg04f49312015-06-08 13:04:56 +020021#include "webrtc/typedefs.h"
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020022
23namespace webrtc {
24
Fredrik Solenberg04f49312015-06-08 13:04:56 +020025class AudioDecoder;
26
Jelena Marusiccd670222015-07-16 09:30:09 +020027class AudioReceiveStream : public ReceiveStream {
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020028 public:
solenberg43e83d42015-10-20 06:41:01 -070029 struct Stats {};
Fredrik Solenberg04f49312015-06-08 13:04:56 +020030
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020031 struct Config {
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020032 std::string ToString() const;
33
34 // Receive-stream specific RTP settings.
35 struct Rtp {
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020036 std::string ToString() const;
37
38 // Synchronization source (stream identifier) to be received.
Fredrik Solenberg04f49312015-06-08 13:04:56 +020039 uint32_t remote_ssrc = 0;
40
41 // Sender SSRC used for sending RTCP (such as receiver reports).
42 uint32_t local_ssrc = 0;
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020043
44 // RTP header extensions used for the received stream.
45 std::vector<RtpExtension> extensions;
46 } rtp;
Fredrik Solenberg04f49312015-06-08 13:04:56 +020047
solenbergcf18b342015-10-01 08:13:42 -070048 Transport* receive_transport = nullptr;
49 Transport* rtcp_send_transport = nullptr;
50
51 // Underlying VoiceEngine handle, used to map AudioReceiveStream to lower-
52 // level components.
53 // TODO(solenberg): Remove when VoiceEngine channels are created outside
54 // of Call.
pbos8fc7fa72015-07-15 08:02:58 -070055 int voe_channel_id = -1;
56
57 // Identifier for an A/V synchronization group. Empty string to disable.
58 // TODO(pbos): Synchronize streams in a sync group, not just one video
59 // stream to one audio stream. Tracked by issue webrtc:4762.
60 std::string sync_group;
61
Fredrik Solenberg04f49312015-06-08 13:04:56 +020062 // Decoders for every payload that we can receive. Call owns the
63 // AudioDecoder instances once the Config is submitted to
64 // Call::CreateReceiveStream().
65 // TODO(solenberg): Use unique_ptr<> once our std lib fully supports C++11.
66 std::map<uint8_t, AudioDecoder*> decoder_map;
pbos6bb1b6e2015-07-24 07:10:18 -070067
68 // TODO(pbos): Remove config option once combined A/V BWE is always on.
69 bool combined_audio_video_bwe = false;
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020070 };
71
Fredrik Solenberg04f49312015-06-08 13:04:56 +020072 virtual Stats GetStats() const = 0;
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020073};
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020074} // namespace webrtc
75
76#endif // WEBRTC_AUDIO_RECEIVE_STREAM_H_