blob: 5e200785a955adf05682026cb22e77195d229c53 [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"
Fredrik Solenberg04f49312015-06-08 13:04:56 +020019#include "webrtc/typedefs.h"
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020020
21namespace webrtc {
22
Fredrik Solenberg04f49312015-06-08 13:04:56 +020023class AudioDecoder;
24
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020025class AudioReceiveStream {
26 public:
Fredrik Solenberg04f49312015-06-08 13:04:56 +020027 struct Stats {};
28
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020029 struct Config {
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020030 std::string ToString() const;
31
32 // Receive-stream specific RTP settings.
33 struct Rtp {
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020034 std::string ToString() const;
35
36 // Synchronization source (stream identifier) to be received.
Fredrik Solenberg04f49312015-06-08 13:04:56 +020037 uint32_t remote_ssrc = 0;
38
39 // Sender SSRC used for sending RTCP (such as receiver reports).
40 uint32_t local_ssrc = 0;
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020041
42 // RTP header extensions used for the received stream.
43 std::vector<RtpExtension> extensions;
44 } rtp;
Fredrik Solenberg04f49312015-06-08 13:04:56 +020045
pbos8fc7fa72015-07-15 08:02:58 -070046 // Underlying VoiceEngine handle, used to map AudioReceiveStream to
47 // lower-level components. Temporarily used while VoiceEngine channels are
48 // created outside of Call.
49 int voe_channel_id = -1;
50
51 // Identifier for an A/V synchronization group. Empty string to disable.
52 // TODO(pbos): Synchronize streams in a sync group, not just one video
53 // stream to one audio stream. Tracked by issue webrtc:4762.
54 std::string sync_group;
55
Fredrik Solenberg04f49312015-06-08 13:04:56 +020056 // Decoders for every payload that we can receive. Call owns the
57 // AudioDecoder instances once the Config is submitted to
58 // Call::CreateReceiveStream().
59 // TODO(solenberg): Use unique_ptr<> once our std lib fully supports C++11.
60 std::map<uint8_t, AudioDecoder*> decoder_map;
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020061 };
62
Fredrik Solenberg04f49312015-06-08 13:04:56 +020063 virtual Stats GetStats() const = 0;
64
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020065 protected:
66 virtual ~AudioReceiveStream() {}
67};
Fredrik Solenberg23fba1f2015-04-29 15:24:01 +020068} // namespace webrtc
69
70#endif // WEBRTC_AUDIO_RECEIVE_STREAM_H_