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

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

Issue 1184313002: Add AudioEncoder::GetTargetBitrate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Getting rid of erroneous code Created 5 years, 6 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // the encoder may vary the number of 10 ms frames from packet to packet, but 90 // the encoder may vary the number of 10 ms frames from packet to packet, but
91 // it must decide the length of the next packet no later than when outputting 91 // it must decide the length of the next packet no later than when outputting
92 // the preceding packet. 92 // the preceding packet.
93 virtual int Num10MsFramesInNextPacket() const = 0; 93 virtual int Num10MsFramesInNextPacket() const = 0;
94 94
95 // Returns the maximum value that can be returned by 95 // Returns the maximum value that can be returned by
96 // Num10MsFramesInNextPacket(). 96 // Num10MsFramesInNextPacket().
97 virtual int Max10MsFramesInAPacket() const = 0; 97 virtual int Max10MsFramesInAPacket() const = 0;
98 98
99 // Changes the target bitrate. The implementation is free to alter this value, 99 // Changes the target bitrate. The implementation is free to alter this value,
100 // e.g., if the desired value is outside the valid range. 100 // e.g., if the desired value is outside the valid range. Returns the new
101 virtual void SetTargetBitrate(int bits_per_second) {} 101 // target bitrate (which may or may not be equal to the input parameter).
102 virtual int SetTargetBitrate(int bits_per_second) = 0;
102 103
103 // Tells the implementation what the projected packet loss rate is. The rate 104 // Tells the implementation what the projected packet loss rate is. The rate
104 // is in the range [0.0, 1.0]. This rate is typically used to adjust channel 105 // is in the range [0.0, 1.0]. This rate is typically used to adjust channel
105 // coding efforts, such as FEC. 106 // coding efforts, such as FEC.
106 virtual void SetProjectedPacketLossRate(double fraction) {} 107 virtual void SetProjectedPacketLossRate(double fraction) {}
107 108
108 // This is the encode function that the inherited classes must implement. It 109 // This is the encode function that the inherited classes must implement. It
109 // is called from Encode in the base class. 110 // is called from Encode in the base class.
110 virtual EncodedInfo EncodeInternal(uint32_t rtp_timestamp, 111 virtual EncodedInfo EncodeInternal(uint32_t rtp_timestamp,
111 const int16_t* audio, 112 const int16_t* audio,
(...skipping 26 matching lines...) Expand all
138 // Sets the maximum rate which the codec may not exceed for any packet. 139 // Sets the maximum rate which the codec may not exceed for any packet.
139 virtual void SetMaxRate(int max_rate_bps) = 0; 140 virtual void SetMaxRate(int max_rate_bps) = 0;
140 141
141 // Informs the encoder about the maximum sample rate which the decoder will 142 // Informs the encoder about the maximum sample rate which the decoder will
142 // use when decoding the bitstream. The implementation is free to disregard 143 // use when decoding the bitstream. The implementation is free to disregard
143 // this hint. 144 // this hint.
144 virtual bool SetMaxPlaybackRate(int frequency_hz) = 0; 145 virtual bool SetMaxPlaybackRate(int frequency_hz) = 0;
145 }; 146 };
146 } // namespace webrtc 147 } // namespace webrtc
147 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 148 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698