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

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

Issue 2705093002: Injectable audio encoders: WebRtcVoiceEngine and company (Closed)
Patch Set: Channel::GetSendCodec asks both its acm and its codec manager. Created 3 years, 7 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 30 matching lines...) Expand all
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 // webrtc::AudioSendStream implementation. 50 // webrtc::AudioSendStream implementation.
51 void Reconfigure(const webrtc::AudioSendStream::Config& config) override;
52
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 // These are all static to make it less likely that (the old) config_ is
81 // accessed unintentionally.
82 static void ConfigureStream(AudioSendStream* stream,
83 const Config& new_config,
84 bool first_time);
85 static bool SetupSendCodec(AudioSendStream* stream, const Config& new_config);
86 static bool ReconfigureSendCodec(AudioSendStream* stream,
87 const Config& new_config);
88 static void ReconfigureANA(AudioSendStream* stream, const Config& new_config);
89 static void ReconfigureCNG(AudioSendStream* stream, const Config& new_config);
90 static void ReconfigureBitrateObserver(AudioSendStream* stream,
91 const Config& new_config);
92
93 void ConfigureBitrateObserver(int min_bitrate_bps, int max_bitrate_bps);
94 void RemoveBitrateObserver();
79 95
80 rtc::ThreadChecker worker_thread_checker_; 96 rtc::ThreadChecker worker_thread_checker_;
81 rtc::ThreadChecker pacer_thread_checker_; 97 rtc::ThreadChecker pacer_thread_checker_;
82 rtc::TaskQueue* worker_queue_; 98 rtc::TaskQueue* worker_queue_;
83 const webrtc::AudioSendStream::Config config_; 99 webrtc::AudioSendStream::Config config_;
84 rtc::scoped_refptr<webrtc::AudioState> audio_state_; 100 rtc::scoped_refptr<webrtc::AudioState> audio_state_;
85 std::unique_ptr<voe::ChannelProxy> channel_proxy_; 101 std::unique_ptr<voe::ChannelProxy> channel_proxy_;
102 RtcEventLog* const event_log_;
86 103
87 BitrateAllocator* const bitrate_allocator_; 104 BitrateAllocator* const bitrate_allocator_;
88 RtpTransportControllerSendInterface* const transport_; 105 RtpTransportControllerSendInterface* const transport_;
89 std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_; 106 std::unique_ptr<RtcpBandwidthObserver> bandwidth_observer_;
90 107
91 rtc::CriticalSection packet_loss_tracker_cs_; 108 rtc::CriticalSection packet_loss_tracker_cs_;
92 TransportFeedbackPacketLossTracker packet_loss_tracker_ 109 TransportFeedbackPacketLossTracker packet_loss_tracker_
93 GUARDED_BY(&packet_loss_tracker_cs_); 110 GUARDED_BY(&packet_loss_tracker_cs_);
94 111
95 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream); 112 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream);
96 }; 113 };
97 } // namespace internal 114 } // namespace internal
98 } // namespace webrtc 115 } // namespace webrtc
99 116
100 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_ 117 #endif // WEBRTC_AUDIO_AUDIO_SEND_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698