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

Unified Diff: webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc

Issue 1184313002: Add AudioEncoder::GetTargetBitrate (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Reverting to SetTargetBitrate returning void 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc
diff --git a/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc b/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc
index ed496186469e1a7ccc4d48858fc1635528f6680e..3ece75ac3d06bb567d683385d3e624b91cf902dc 100644
--- a/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc
+++ b/webrtc/modules/audio_coding/codecs/g711/audio_encoder_pcm.cc
@@ -60,7 +60,7 @@ int AudioEncoderPcm::NumChannels() const {
}
size_t AudioEncoderPcm::MaxEncodedBytes() const {
- return full_frame_samples_;
+ return full_frame_samples_ * BytesPerSample();
}
int AudioEncoderPcm::Num10MsFramesInNextPacket() const {
@@ -71,6 +71,10 @@ int AudioEncoderPcm::Max10MsFramesInAPacket() const {
return num_10ms_frames_per_packet_;
}
+int AudioEncoderPcm::GetTargetBitrate() const {
+ return 8 * BytesPerSample() * SampleRateHz() * NumChannels();
+}
+
AudioEncoder::EncodedInfo AudioEncoderPcm::EncodeInternal(
uint32_t rtp_timestamp,
const int16_t* audio,

Powered by Google App Engine
This is Rietveld 408576698