| 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 "webrtc/audio_receive_stream.h" | 14 #include "webrtc/audio_receive_stream.h" |
| 15 #include "webrtc/audio/scoped_voe_interface.h" | 15 #include "webrtc/audio_state.h" |
| 16 #include "webrtc/base/thread_checker.h" | 16 #include "webrtc/base/thread_checker.h" |
| 17 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" | 17 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" |
| 18 #include "webrtc/voice_engine/include/voe_base.h" | |
| 19 | 18 |
| 20 namespace webrtc { | 19 namespace webrtc { |
| 21 | 20 |
| 22 class RemoteBitrateEstimator; | 21 class RemoteBitrateEstimator; |
| 23 class VoiceEngine; | |
| 24 | 22 |
| 25 namespace internal { | 23 namespace internal { |
| 26 | 24 |
| 27 class AudioReceiveStream final : public webrtc::AudioReceiveStream { | 25 class AudioReceiveStream final : public webrtc::AudioReceiveStream { |
| 28 public: | 26 public: |
| 29 AudioReceiveStream(RemoteBitrateEstimator* remote_bitrate_estimator, | 27 AudioReceiveStream(RemoteBitrateEstimator* remote_bitrate_estimator, |
| 30 const webrtc::AudioReceiveStream::Config& config, | 28 const webrtc::AudioReceiveStream::Config& config, |
| 31 VoiceEngine* voice_engine); | 29 const rtc::scoped_refptr<webrtc::AudioState>& audio_state); |
| 32 ~AudioReceiveStream() override; | 30 ~AudioReceiveStream() override; |
| 33 | 31 |
| 34 // webrtc::ReceiveStream implementation. | 32 // webrtc::ReceiveStream implementation. |
| 35 void Start() override; | 33 void Start() override; |
| 36 void Stop() override; | 34 void Stop() override; |
| 37 void SignalNetworkState(NetworkState state) override; | 35 void SignalNetworkState(NetworkState state) override; |
| 38 bool DeliverRtcp(const uint8_t* packet, size_t length) override; | 36 bool DeliverRtcp(const uint8_t* packet, size_t length) override; |
| 39 bool DeliverRtp(const uint8_t* packet, | 37 bool DeliverRtp(const uint8_t* packet, |
| 40 size_t length, | 38 size_t length, |
| 41 const PacketTime& packet_time) override; | 39 const PacketTime& packet_time) override; |
| 42 | 40 |
| 43 // webrtc::AudioReceiveStream implementation. | 41 // webrtc::AudioReceiveStream implementation. |
| 44 webrtc::AudioReceiveStream::Stats GetStats() const override; | 42 webrtc::AudioReceiveStream::Stats GetStats() const override; |
| 45 | 43 |
| 46 const webrtc::AudioReceiveStream::Config& config() const; | 44 const webrtc::AudioReceiveStream::Config& config() const; |
| 47 | 45 |
| 48 private: | 46 private: |
| 49 rtc::ThreadChecker thread_checker_; | 47 rtc::ThreadChecker thread_checker_; |
| 50 RemoteBitrateEstimator* const remote_bitrate_estimator_; | 48 RemoteBitrateEstimator* const remote_bitrate_estimator_; |
| 51 const webrtc::AudioReceiveStream::Config config_; | 49 const webrtc::AudioReceiveStream::Config config_; |
| 52 VoiceEngine* voice_engine_; | 50 rtc::scoped_refptr<webrtc::AudioState> audio_state_; |
| 53 // We hold one interface pointer to the VoE to make sure it is kept alive. | |
| 54 ScopedVoEInterface<VoEBase> voe_base_; | |
| 55 rtc::scoped_ptr<RtpHeaderParser> rtp_header_parser_; | 51 rtc::scoped_ptr<RtpHeaderParser> rtp_header_parser_; |
| 56 | 52 |
| 57 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); | 53 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream); |
| 58 }; | 54 }; |
| 59 } // namespace internal | 55 } // namespace internal |
| 60 } // namespace webrtc | 56 } // namespace webrtc |
| 61 | 57 |
| 62 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ | 58 #endif // WEBRTC_AUDIO_AUDIO_RECEIVE_STREAM_H_ |
| OLD | NEW |