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

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

Issue 2546493002: Update smoothed bitrate. (Closed)
Patch Set: Changed cl according to offline discussions. Created 3 years, 12 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
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
13 13
14 #include <algorithm> 14 #include <algorithm>
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/base/array_view.h" 17 #include "webrtc/base/array_view.h"
18 #include "webrtc/base/buffer.h" 18 #include "webrtc/base/buffer.h"
19 #include "webrtc/base/deprecation.h" 19 #include "webrtc/base/deprecation.h"
20 #include "webrtc/base/optional.h"
20 #include "webrtc/typedefs.h" 21 #include "webrtc/typedefs.h"
21 22
22 namespace webrtc { 23 namespace webrtc {
23 24
24 class Clock; 25 class Clock;
25 26
26 // This is the interface class for encoders in AudioCoding module. Each codec 27 // This is the interface class for encoders in AudioCoding module. Each codec
27 // type must have an implementation of this class. 28 // type must have an implementation of this class.
28 class AudioEncoder { 29 class AudioEncoder {
29 public: 30 public:
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 virtual rtc::ArrayView<std::unique_ptr<AudioEncoder>> 161 virtual rtc::ArrayView<std::unique_ptr<AudioEncoder>>
161 ReclaimContainedEncoders(); 162 ReclaimContainedEncoders();
162 163
163 // Enables audio network adaptor. Returns true if successful. 164 // Enables audio network adaptor. Returns true if successful.
164 virtual bool EnableAudioNetworkAdaptor(const std::string& config_string, 165 virtual bool EnableAudioNetworkAdaptor(const std::string& config_string,
165 const Clock* clock); 166 const Clock* clock);
166 167
167 // Disables audio network adaptor. 168 // Disables audio network adaptor.
168 virtual void DisableAudioNetworkAdaptor(); 169 virtual void DisableAudioNetworkAdaptor();
169 170
170 // Provides uplink bandwidth to this encoder to allow it to adapt.
171 virtual void OnReceivedUplinkBandwidth(int uplink_bandwidth_bps);
172
173 // Provides uplink packet loss fraction to this encoder to allow it to adapt. 171 // Provides uplink packet loss fraction to this encoder to allow it to adapt.
174 // |uplink_packet_loss_fraction| is in the range [0.0, 1.0]. 172 // |uplink_packet_loss_fraction| is in the range [0.0, 1.0].
175 virtual void OnReceivedUplinkPacketLossFraction( 173 virtual void OnReceivedUplinkPacketLossFraction(
176 float uplink_packet_loss_fraction); 174 float uplink_packet_loss_fraction);
177 175
178 // Provides target audio bitrate to this encoder to allow it to adapt. 176 // Provides target audio bitrate to this encoder to allow it to adapt.
179 virtual void OnReceivedTargetAudioBitrate(int target_audio_bitrate_bps); 177 virtual void OnReceivedTargetAudioBitrate(
ossu 2016/12/22 14:01:15 Going forward, I think we should try and find a cl
minyue-webrtc 2016/12/22 14:51:26 RTC_DEPRECATED virtual void OnReceivedTargetAudioB
michaelt 2016/12/22 15:10:10 Do you think this is necessary, wouldn't it be eno
minyue-webrtc 2016/12/22 15:12:02 No hurt to be cautious. then we avoid risk of reve
michaelt 2016/12/22 15:35:25 Done.
178 int target_audio_bitrate_bps,
179 rtc::Optional<int64_t> probing_interval_ms);
180 180
181 // Provides RTT to this encoder to allow it to adapt. 181 // Provides RTT to this encoder to allow it to adapt.
182 virtual void OnReceivedRtt(int rtt_ms); 182 virtual void OnReceivedRtt(int rtt_ms);
183 183
184 // Provides overhead to this encoder to adapt. The overhead is the number of 184 // Provides overhead to this encoder to adapt. The overhead is the number of
185 // bytes that will be added to each packet the encoder generates. 185 // bytes that will be added to each packet the encoder generates.
186 virtual void OnReceivedOverhead(size_t overhead_bytes_per_packet); 186 virtual void OnReceivedOverhead(size_t overhead_bytes_per_packet);
187 187
188 // To allow encoder to adapt its frame length, it must be provided the frame 188 // To allow encoder to adapt its frame length, it must be provided the frame
189 // length range that receivers can accept. 189 // length range that receivers can accept.
190 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms, 190 virtual void SetReceiverFrameLengthRange(int min_frame_length_ms,
191 int max_frame_length_ms); 191 int max_frame_length_ms);
192 192
193 protected: 193 protected:
194 // Subclasses implement this to perform the actual encoding. Called by 194 // Subclasses implement this to perform the actual encoding. Called by
195 // Encode(). 195 // Encode().
196 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp, 196 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp,
197 rtc::ArrayView<const int16_t> audio, 197 rtc::ArrayView<const int16_t> audio,
198 rtc::Buffer* encoded) = 0; 198 rtc::Buffer* encoded) = 0;
199 }; 199 };
200 } // namespace webrtc 200 } // namespace webrtc
201 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 201 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698