Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: webrtc/audio/audio_receive_stream.h

Issue 2378143004: Made AudioReceiveStream a mixer participant. (Closed)
Patch Set: Changed 'ssrc' into 'Ssrc' because of change upstream. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/audio/BUILD.gn ('k') | webrtc/audio/audio_receive_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/call/audio_receive_stream.h" 17 #include "webrtc/api/call/audio_receive_stream.h"
17 #include "webrtc/api/call/audio_state.h" 18 #include "webrtc/api/call/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/modules/rtp_rtcp/include/rtp_header_parser.h" 21 #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.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 AudioMixer::Source {
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 // AudioMixer::Source
58 AudioFrameWithInfo GetAudioFrameWithInfo(int sample_rate_hz) override;
59 int Ssrc() 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_
OLDNEW
« no previous file with comments | « webrtc/audio/BUILD.gn ('k') | webrtc/audio/audio_receive_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698