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 | 15 |
16 #include "webrtc/api/audio/audio_mixer.h" | 16 #include "webrtc/api/audio/audio_mixer.h" |
17 #include "webrtc/api/call/audio_receive_stream.h" | 17 #include "webrtc/api/call/audio_receive_stream.h" |
18 #include "webrtc/api/call/audio_state.h" | 18 #include "webrtc/api/call/audio_state.h" |
19 #include "webrtc/audio/audio_state.h" | 19 #include "webrtc/audio/audio_state.h" |
20 #include "webrtc/base/constructormagic.h" | 20 #include "webrtc/base/constructormagic.h" |
21 #include "webrtc/base/thread_checker.h" | 21 #include "webrtc/base/thread_checker.h" |
22 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 22 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
23 | 23 |
24 namespace webrtc { | 24 namespace webrtc { |
25 class CongestionController; | |
26 class RemoteBitrateEstimator; | 25 class RemoteBitrateEstimator; |
27 class RtcEventLog; | 26 class RtcEventLog; |
| 27 class PacketRouter; |
28 | 28 |
29 namespace voe { | 29 namespace voe { |
30 class ChannelProxy; | 30 class ChannelProxy; |
31 } // namespace voe | 31 } // namespace voe |
32 | 32 |
33 namespace internal { | 33 namespace internal { |
34 class AudioSendStream; | 34 class AudioSendStream; |
35 | 35 |
36 class AudioReceiveStream final : public webrtc::AudioReceiveStream, | 36 class AudioReceiveStream final : public webrtc::AudioReceiveStream, |
37 public AudioMixer::Source { | 37 public AudioMixer::Source { |
38 public: | 38 public: |
39 AudioReceiveStream(CongestionController* congestion_controller, | 39 AudioReceiveStream(PacketRouter* packet_router, |
| 40 RemoteBitrateEstimator* remote_bitrate_estimator, |
40 const webrtc::AudioReceiveStream::Config& config, | 41 const webrtc::AudioReceiveStream::Config& config, |
41 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, | 42 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, |
42 webrtc::RtcEventLog* event_log); | 43 webrtc::RtcEventLog* event_log); |
43 ~AudioReceiveStream() override; | 44 ~AudioReceiveStream() override; |
44 | 45 |
45 // webrtc::AudioReceiveStream implementation. | 46 // webrtc::AudioReceiveStream implementation. |
46 void Start() override; | 47 void Start() override; |
47 void Stop() override; | 48 void Stop() override; |
48 webrtc::AudioReceiveStream::Stats GetStats() const override; | 49 webrtc::AudioReceiveStream::Stats GetStats() const override; |
49 void SetSink(std::unique_ptr<AudioSinkInterface> sink) override; | 50 void SetSink(std::unique_ptr<AudioSinkInterface> sink) override; |
(...skipping 12 matching lines...) Expand all Loading... |
62 AudioFrame* audio_frame) override; | 63 AudioFrame* audio_frame) override; |
63 int PreferredSampleRate() const override; | 64 int PreferredSampleRate() const override; |
64 int Ssrc() const override; | 65 int Ssrc() const override; |
65 | 66 |
66 private: | 67 private: |
67 VoiceEngine* voice_engine() const; | 68 VoiceEngine* voice_engine() const; |
68 AudioState* audio_state() const; | 69 AudioState* audio_state() const; |
69 int SetVoiceEnginePlayout(bool playout); | 70 int SetVoiceEnginePlayout(bool playout); |
70 | 71 |
71 rtc::ThreadChecker thread_checker_; | 72 rtc::ThreadChecker thread_checker_; |
72 RemoteBitrateEstimator* remote_bitrate_estimator_ = nullptr; | 73 RemoteBitrateEstimator* const remote_bitrate_estimator_; |
73 const webrtc::AudioReceiveStream::Config config_; | 74 const webrtc::AudioReceiveStream::Config config_; |
74 rtc::scoped_refptr<webrtc::AudioState> audio_state_; | 75 rtc::scoped_refptr<webrtc::AudioState> audio_state_; |
75 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 76 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; |
76 std::unique_ptr<voe::ChannelProxy> channel_proxy_; | 77 std::unique_ptr<voe::ChannelProxy> channel_proxy_; |
77 | 78 |
78 bool playing_ ACCESS_ON(thread_checker_) = false; | 79 bool playing_ ACCESS_ON(thread_checker_) = false; |
79 | 80 |
80 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); | 81 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); |
81 }; | 82 }; |
82 } // namespace internal | 83 } // namespace internal |
83 } // namespace webrtc | 84 } // namespace webrtc |
84 | 85 |
85 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ | 86 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ |
OLD | NEW |