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/call/audio_receive_stream.h" | 16 #include "webrtc/api/call/audio_receive_stream.h" |
17 #include "webrtc/api/call/audio_state.h" | 17 #include "webrtc/api/call/audio_state.h" |
18 #include "webrtc/base/constructormagic.h" | 18 #include "webrtc/base/constructormagic.h" |
19 #include "webrtc/base/thread_checker.h" | 19 #include "webrtc/base/thread_checker.h" |
20 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 20 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
21 #include "webrtc/modules/audio_mixer/audio_mixer_defines.h" | |
21 | 22 |
22 namespace webrtc { | 23 namespace webrtc { |
23 class CongestionController; | 24 class CongestionController; |
24 class RemoteBitrateEstimator; | 25 class RemoteBitrateEstimator; |
25 class RtcEventLog; | 26 class RtcEventLog; |
26 | 27 |
27 namespace voe { | 28 namespace voe { |
28 class ChannelProxy; | 29 class ChannelProxy; |
29 } // namespace voe | 30 } // namespace voe |
30 | 31 |
31 namespace internal { | 32 namespace internal { |
32 | 33 |
33 class AudioReceiveStream final : public webrtc::AudioReceiveStream { | 34 class AudioReceiveStream final : public webrtc::AudioReceiveStream, |
35 public MixerAudioSource { | |
the sun
2016/10/03 11:41:26
Multiple inheritance with implementation classes i
aleloi
2016/10/03 12:57:28
ossu@ has pointed out the naked pointer problems a
| |
34 public: | 36 public: |
35 AudioReceiveStream(CongestionController* congestion_controller, | 37 AudioReceiveStream(CongestionController* congestion_controller, |
36 const webrtc::AudioReceiveStream::Config& config, | 38 const webrtc::AudioReceiveStream::Config& config, |
37 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, | 39 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, |
38 webrtc::RtcEventLog* event_log); | 40 webrtc::RtcEventLog* event_log); |
39 ~AudioReceiveStream() override; | 41 ~AudioReceiveStream() override; |
40 | 42 |
41 // webrtc::AudioReceiveStream implementation. | 43 // webrtc::AudioReceiveStream implementation. |
42 void Start() override; | 44 void Start() override; |
43 void Stop() override; | 45 void Stop() override; |
44 webrtc::AudioReceiveStream::Stats GetStats() const override; | 46 webrtc::AudioReceiveStream::Stats GetStats() const override; |
45 void SetSink(std::unique_ptr<AudioSinkInterface> sink) override; | 47 void SetSink(std::unique_ptr<AudioSinkInterface> sink) override; |
46 void SetGain(float gain) override; | 48 void SetGain(float gain) override; |
47 | 49 |
48 void SignalNetworkState(NetworkState state); | 50 void SignalNetworkState(NetworkState state); |
49 bool DeliverRtcp(const uint8_t* packet, size_t length); | 51 bool DeliverRtcp(const uint8_t* packet, size_t length); |
50 bool DeliverRtp(const uint8_t* packet, | 52 bool DeliverRtp(const uint8_t* packet, |
51 size_t length, | 53 size_t length, |
52 const PacketTime& packet_time); | 54 const PacketTime& packet_time); |
53 const webrtc::AudioReceiveStream::Config& config() const; | 55 const webrtc::AudioReceiveStream::Config& config() const; |
54 | 56 |
57 // MixerAudioSource | |
58 AudioFrameWithMuted GetAudioFrameWithMuted(int32_t id, | |
59 int sample_rate_hz) override; | |
60 | |
55 private: | 61 private: |
56 VoiceEngine* voice_engine() const; | 62 VoiceEngine* voice_engine() const; |
57 | 63 |
58 rtc::ThreadChecker thread_checker_; | 64 rtc::ThreadChecker thread_checker_; |
59 RemoteBitrateEstimator* remote_bitrate_estimator_ = nullptr; | 65 RemoteBitrateEstimator* remote_bitrate_estimator_ = nullptr; |
60 const webrtc::AudioReceiveStream::Config config_; | 66 const webrtc::AudioReceiveStream::Config config_; |
61 rtc::scoped_refptr<webrtc::AudioState> audio_state_; | 67 rtc::scoped_refptr<webrtc::AudioState> audio_state_; |
62 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; | 68 std::unique_ptr<RtpHeaderParser> rtp_header_parser_; |
63 std::unique_ptr<voe::ChannelProxy> channel_proxy_; | 69 std::unique_ptr<voe::ChannelProxy> channel_proxy_; |
64 | 70 |
65 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); | 71 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); |
66 }; | 72 }; |
67 } // namespace internal | 73 } // namespace internal |
68 } // namespace webrtc | 74 } // namespace webrtc |
69 | 75 |
70 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ | 76 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ |
OLD | NEW |