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

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

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: AudioSendStream::Reconfigure() 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 27 matching lines...) Expand all
38 AudioSendStream(const webrtc::AudioSendStream::Config& config, 38 AudioSendStream(const webrtc::AudioSendStream::Config& config,
39 const rtc::scoped_refptr<webrtc::AudioState>& audio_state, 39 const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
40 rtc::TaskQueue* worker_queue, 40 rtc::TaskQueue* worker_queue,
41 PacketRouter* packet_router, 41 PacketRouter* packet_router,
42 CongestionController* congestion_controller, 42 CongestionController* congestion_controller,
43 BitrateAllocator* bitrate_allocator, 43 BitrateAllocator* bitrate_allocator,
44 RtcEventLog* event_log, 44 RtcEventLog* event_log,
45 RtcpRttStats* rtcp_rtt_stats); 45 RtcpRttStats* rtcp_rtt_stats);
46 ~AudioSendStream() override; 46 ~AudioSendStream() override;
47 47
48 void Reconfigure(const webrtc::AudioSendStream::Config& config) override;
the sun 2017/04/04 23:02:54 nit: looks like it should go under the below comme
49
48 // webrtc::AudioSendStream implementation. 50 // webrtc::AudioSendStream implementation.
49 void Start() override; 51 void Start() override;
50 void Stop() override; 52 void Stop() override;
51 bool SendTelephoneEvent(int payload_type, int payload_frequency, int event, 53 bool SendTelephoneEvent(int payload_type, int payload_frequency, int event,
52 int duration_ms) override; 54 int duration_ms) override;
53 void SetMuted(bool muted) override; 55 void SetMuted(bool muted) override;
54 webrtc::AudioSendStream::Stats GetStats() const override; 56 webrtc::AudioSendStream::Stats GetStats() const override;
55 57
56 void SignalNetworkState(NetworkState state); 58 void SignalNetworkState(NetworkState state);
57 bool DeliverRtcp(const uint8_t* packet, size_t length); 59 bool DeliverRtcp(const uint8_t* packet, size_t length);
58 60
59 // Implements BitrateAllocatorObserver. 61 // Implements BitrateAllocatorObserver.
60 uint32_t OnBitrateUpdated(uint32_t bitrate_bps, 62 uint32_t OnBitrateUpdated(uint32_t bitrate_bps,
61 uint8_t fraction_loss, 63 uint8_t fraction_loss,
62 int64_t rtt, 64 int64_t rtt,
63 int64_t probing_interval_ms) override; 65 int64_t probing_interval_ms) override;
64 66
65 const webrtc::AudioSendStream::Config& config() const; 67 const webrtc::AudioSendStream::Config& config() const;
66 void SetTransportOverhead(int transport_overhead_per_packet); 68 void SetTransportOverhead(int transport_overhead_per_packet);
67 69
68 private: 70 private:
69 VoiceEngine* voice_engine() const; 71 VoiceEngine* voice_engine() const;
70 72
71 bool SetupSendCodec(); 73 bool SetupSendCodec(const Config& new_config);
74 bool ReconfigureSendCodec(const Config& new_config);
75 void ReconfigureANA(const Config& new_config);
76 void ReconfigureCNG(const Config& new_config);
77 void ReconfigureBitrateObserver(const Config& new_config);
78
79 void ConfigureBitrateObserver(int min_bitrate_bps, int max_bitrate_bps);
80 void RemoveBitrateObserver();
72 81
73 rtc::ThreadChecker thread_checker_; 82 rtc::ThreadChecker thread_checker_;
74 rtc::TaskQueue* worker_queue_; 83 rtc::TaskQueue* worker_queue_;
75 const webrtc::AudioSendStream::Config config_; 84 webrtc::AudioSendStream::Config config_;
76 rtc::scoped_refptr<webrtc::AudioState> audio_state_; 85 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
77 std::unique_ptr<voe::ChannelProxy> channel_proxy_; 86 std::unique_ptr<voe::ChannelProxy> channel_proxy_;
87 RtcEventLog* const event_log_;
78 88
89 PacketRouter* const packet_router_;
79 BitrateAllocator* const bitrate_allocator_; 90 BitrateAllocator* const bitrate_allocator_;
80 CongestionController* const congestion_controller_; 91 CongestionController* const congestion_controller_;
81 std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; 92 std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_;
82 93
83 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream); 94 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream);
84 }; 95 };
85 } // namespace internal 96 } // namespace internal
86 } // namespace webrtc 97 } // namespace webrtc
87 98
88 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ 99 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698