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

Side by Side Diff: webrtc/modules/audio_coding/codecs/audio_encoder.h

Issue 2429503002: Simplifying audio network adaptor by moving receiver frame length range to ctor. (Closed)
Patch Set: 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // returns a pointer to an array where they are stored (which is required to 159 // returns a pointer to an array where they are stored (which is required to
160 // live as long as this encoder). Unless the returned array is empty, you may 160 // live as long as this encoder). Unless the returned array is empty, you may
161 // not call any methods on this encoder afterwards, except for the 161 // not call any methods on this encoder afterwards, except for the
162 // destructor. The default implementation just returns an empty array. 162 // destructor. The default implementation just returns an empty array.
163 // NOTE: This method is subject to change. Do not call or override it. 163 // NOTE: This method is subject to change. Do not call or override it.
164 virtual rtc::ArrayView<std::unique_ptr<AudioEncoder>> 164 virtual rtc::ArrayView<std::unique_ptr<AudioEncoder>>
165 ReclaimContainedEncoders(); 165 ReclaimContainedEncoders();
166 166
167 // Enables audio network adaptor. Returns true if successful. 167 // Enables audio network adaptor. Returns true if successful.
168 virtual bool EnableAudioNetworkAdaptor(const std::string& config_string, 168 virtual bool EnableAudioNetworkAdaptor(const std::string& config_string,
169 int min_receiver_frame_length_ms,
170 int max_receiver_frame_length_ms,
169 const Clock* clock); 171 const Clock* clock);
170 172
171 // Disables audio network adaptor. 173 // Disables audio network adaptor.
172 virtual void DisableAudioNetworkAdaptor(); 174 virtual void DisableAudioNetworkAdaptor();
173 175
174 // Provides uplink bandwidth to this encoder to allow it to adapt. 176 // Provides uplink bandwidth to this encoder to allow it to adapt.
175 virtual void OnReceivedUplinkBandwidth(int uplink_bandwidth_bps); 177 virtual void OnReceivedUplinkBandwidth(int uplink_bandwidth_bps);
176 178
177 // Provides uplink packet loss fraction to this encoder to allow it to adapt. 179 // Provides uplink packet loss fraction to this encoder to allow it to adapt.
178 virtual void OnReceivedUplinkPacketLossFraction( 180 virtual void OnReceivedUplinkPacketLossFraction(
179 float uplink_packet_loss_fraction); 181 float uplink_packet_loss_fraction);
180 182
181 // Provides target audio bitrate to this encoder to allow it to adapt. 183 // Provides target audio bitrate to this encoder to allow it to adapt.
182 virtual void OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps); 184 virtual void OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps);
183 185
184 // Provides RTT to this encoder to allow it to adapt. 186 // Provides RTT to this encoder to allow it to adapt.
185 virtual void OnReceivedRtt(int rtt_ms); 187 virtual void OnReceivedRtt(int rtt_ms);
186 188
187 // To allow encoder to adapt its frame length, it must be provided the frame
188 // length range that receives can accept.
189 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms,
190 int max_frame_length_ms);
191
192 protected: 189 protected:
193 // Subclasses implement this to perform the actual encoding. Called by 190 // Subclasses implement this to perform the actual encoding. Called by
194 // Encode(). 191 // Encode().
195 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp, 192 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp,
196 rtc::ArrayView<const int16_t> audio, 193 rtc::ArrayView<const int16_t> audio,
197 rtc::Buffer* encoded) = 0; 194 rtc::Buffer* encoded) = 0;
198 }; 195 };
199 } // namespace webrtc 196 } // namespace webrtc
200 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 197 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698