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

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

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: Rebase (and removed 'virtual' from Channel::ModifyEncoder) Created 3 years, 8 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
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
(...skipping 29 matching lines...) Expand all
40 public: 40 public:
41 AudioSendStream(const webrtc::AudioSendStream::Config& config, 41 AudioSendStream(const webrtc::AudioSendStream::Config& config,
42 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, 42 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
43 rtc::TaskQueue* worker_queue, 43 rtc::TaskQueue* worker_queue,
44 RtpTransportControllerSendInterface* transport, 44 RtpTransportControllerSendInterface* transport,
45 BitrateAllocator* bitrate_allocator, 45 BitrateAllocator* bitrate_allocator,
46 RtcEventLog* event_log, 46 RtcEventLog* event_log,
47 RtcpRttStats* rtcp_rtt_stats); 47 RtcpRttStats* rtcp_rtt_stats);
48 ~AudioSendStream() override; 48 ~AudioSendStream() override;
49 49
50 void Reconfigure(const webrtc::AudioSendStream::Config& config) override;
51
50 // webrtc::AudioSendStream implementation. 52 // webrtc::AudioSendStream implementation.
51 void Start() override; 53 void Start() override;
52 void Stop() override; 54 void Stop() override;
53 bool SendTelephoneEvent(int payload_type, int payload_frequency, int event, 55 bool SendTelephoneEvent(int payload_type, int payload_frequency, int event,
54 int duration_ms) override; 56 int duration_ms) override;
55 void SetMuted(bool muted) override; 57 void SetMuted(bool muted) override;
56 webrtc::AudioSendStream::Stats GetStats() const override; 58 webrtc::AudioSendStream::Stats GetStats() const override;
57 59
58 void SignalNetworkState(NetworkState state); 60 void SignalNetworkState(NetworkState state);
59 bool DeliverRtcp(const uint8_t* packet, size_t length); 61 bool DeliverRtcp(const uint8_t* packet, size_t length);
60 62
61 // Implements BitrateAllocatorObserver. 63 // Implements BitrateAllocatorObserver.
62 uint32_t OnBitrateUpdated(uint32_t bitrate_bps, 64 uint32_t OnBitrateUpdated(uint32_t bitrate_bps,
63 uint8_t fraction_loss, 65 uint8_t fraction_loss,
64 int64_t rtt, 66 int64_t rtt,
65 int64_t probing_interval_ms) override; 67 int64_t probing_interval_ms) override;
66 68
67 // From PacketFeedbackObserver. 69 // From PacketFeedbackObserver.
68 void OnPacketAdded(uint32_t ssrc, uint16_t seq_num) override; 70 void OnPacketAdded(uint32_t ssrc, uint16_t seq_num) override;
69 void OnPacketFeedbackVector( 71 void OnPacketFeedbackVector(
70 const std::vector<PacketFeedback>& packet_feedback_vector) override; 72 const std::vector<PacketFeedback>& packet_feedback_vector) override;
71 73
72 const webrtc::AudioSendStream::Config& config() const; 74 const webrtc::AudioSendStream::Config& config() const;
73 void SetTransportOverhead(int transport_overhead_per_packet); 75 void SetTransportOverhead(int transport_overhead_per_packet);
74 76
75 private: 77 private:
76 VoiceEngine* voice_engine() const; 78 VoiceEngine* voice_engine() const;
77 79
78 bool SetupSendCodec(); 80 bool SetupSendCodec(const Config& new_config);
81 bool ReconfigureSendCodec(const Config& new_config);
82 void ReconfigureANA(const Config& new_config);
83 void ReconfigureCNG(const Config& new_config);
84 void ReconfigureBitrateObserver(const Config& new_config);
85
86 void ConfigureBitrateObserver(int min_bitrate_bps, int max_bitrate_bps);
87 void RemoveBitrateObserver();
79 88
80 rtc::ThreadChecker worker_thread_checker_; 89 rtc::ThreadChecker worker_thread_checker_;
81 rtc::ThreadChecker pacer_thread_checker_; 90 rtc::ThreadChecker pacer_thread_checker_;
82 rtc::TaskQueue* worker_queue_; 91 rtc::TaskQueue* worker_queue_;
83 const webrtc::AudioSendStream::Config config_; 92 webrtc::AudioSendStream::Config config_;
84 rtc::scoped_refptr<webrtc::AudioState> audio_state_; 93 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
85 std::unique_ptr<voe::ChannelProxy> channel_proxy_; 94 std::unique_ptr<voe::ChannelProxy> channel_proxy_;
95 RtcEventLog* const event_log_;
86 96
87 BitrateAllocator* const bitrate_allocator_; 97 BitrateAllocator* const bitrate_allocator_;
88 RtpTransportControllerSendInterface* const transport_; 98 RtpTransportControllerSendInterface* const transport_;
89 std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; 99 std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_;
90 100
91 rtc::CriticalSection packet_loss_tracker_cs_; 101 rtc::CriticalSection packet_loss_tracker_cs_;
92 TransportFeedbackPacketLossTracker packet_loss_tracker_ 102 TransportFeedbackPacketLossTracker packet_loss_tracker_
93 GUARDED_BY(&packet_loss_tracker_cs_); 103 GUARDED_BY(&packet_loss_tracker_cs_);
94 104
95 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream); 105 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream);
96 }; 106 };
97 } // namespace internal 107 } // namespace internal
98 } // namespace webrtc 108 } // namespace webrtc
99 109
100 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ 110 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_
OLDNEW
« no previous file with comments | « webrtc/audio/DEPS ('k') | webrtc/audio/audio_send_stream.cc » ('j') | webrtc/media/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698