OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ | 11 #ifndef WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ |
12 #define WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ | 12 #define WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
| 15 #include <vector> |
15 | 16 |
16 #include "webrtc/api/audio/audio_mixer.h" | 17 #include "webrtc/api/audio/audio_mixer.h" |
17 #include "webrtc/audio/audio_state.h" | 18 #include "webrtc/audio/audio_state.h" |
18 #include "webrtc/base/constructormagic.h" | 19 #include "webrtc/base/constructormagic.h" |
19 #include "webrtc/base/thread_checker.h" | 20 #include "webrtc/base/thread_checker.h" |
20 #include "webrtc/call/audio_receive_stream.h" | 21 #include "webrtc/call/audio_receive_stream.h" |
21 #include "webrtc/call/syncable.h" | 22 #include "webrtc/call/syncable.h" |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
24 class PacketRouter; | 25 class PacketRouter; |
25 class RtcEventLog; | 26 class RtcEventLog; |
| 27 class RtpContributingSource; |
26 class RtpPacketReceived; | 28 class RtpPacketReceived; |
27 | 29 |
28 namespace voe { | 30 namespace voe { |
29 class ChannelProxy; | 31 class ChannelProxy; |
30 } // namespace voe | 32 } // namespace voe |
31 | 33 |
32 namespace internal { | 34 namespace internal { |
33 class AudioSendStream; | 35 class AudioSendStream; |
34 | 36 |
35 class AudioReceiveStream final : public webrtc::AudioReceiveStream, | 37 class AudioReceiveStream final : public webrtc::AudioReceiveStream, |
36 public AudioMixer::Source, | 38 public AudioMixer::Source, |
37 public Syncable { | 39 public Syncable { |
38 public: | 40 public: |
39 AudioReceiveStream(PacketRouter* packet_router, | 41 AudioReceiveStream(PacketRouter* packet_router, |
40 const webrtc::AudioReceiveStream::Config& config, | 42 const webrtc::AudioReceiveStream::Config& config, |
41 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, | 43 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, |
42 webrtc::RtcEventLog* event_log); | 44 webrtc::RtcEventLog* event_log); |
43 ~AudioReceiveStream() override; | 45 ~AudioReceiveStream() override; |
44 | 46 |
45 // webrtc::AudioReceiveStream implementation. | 47 // webrtc::AudioReceiveStream implementation. |
46 void Start() override; | 48 void Start() override; |
47 void Stop() override; | 49 void Stop() override; |
48 webrtc::AudioReceiveStream::Stats GetStats() const override; | 50 webrtc::AudioReceiveStream::Stats GetStats() const override; |
49 int GetOutputLevel() const override; | 51 int GetOutputLevel() const override; |
50 void SetSink(std::unique_ptr<AudioSinkInterface> sink) override; | 52 void SetSink(std::unique_ptr<AudioSinkInterface> sink) override; |
51 void SetGain(float gain) override; | 53 void SetGain(float gain) override; |
| 54 const std::vector<RtpContributingSource*>& GetContributingSources() override; |
52 | 55 |
53 // TODO(nisse): Intended to be part of an RtpPacketReceiver interface. | 56 // TODO(nisse): Intended to be part of an RtpPacketReceiver interface. |
54 void OnRtpPacket(const RtpPacketReceived& packet); | 57 void OnRtpPacket(const RtpPacketReceived& packet); |
55 | 58 |
56 // AudioMixer::Source | 59 // AudioMixer::Source |
57 AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz, | 60 AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz, |
58 AudioFrame* audio_frame) override; | 61 AudioFrame* audio_frame) override; |
59 int Ssrc() const override; | 62 int Ssrc() const override; |
60 int PreferredSampleRate() const override; | 63 int PreferredSampleRate() const override; |
61 | 64 |
(...skipping 20 matching lines...) Expand all Loading... |
82 std::unique_ptr<voe::ChannelProxy> channel_proxy_; | 85 std::unique_ptr<voe::ChannelProxy> channel_proxy_; |
83 | 86 |
84 bool playing_ ACCESS_ON(worker_thread_checker_) = false; | 87 bool playing_ ACCESS_ON(worker_thread_checker_) = false; |
85 | 88 |
86 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); | 89 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); |
87 }; | 90 }; |
88 } // namespace internal | 91 } // namespace internal |
89 } // namespace webrtc | 92 } // namespace webrtc |
90 | 93 |
91 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ | 94 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ |
OLD | NEW |