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

Side by Side Diff: webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc

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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 int AudioEncoderCopyRed::Num10MsFramesInNextPacket() const { 44 int AudioEncoderCopyRed::Num10MsFramesInNextPacket() const {
45 return speech_encoder_->Num10MsFramesInNextPacket(); 45 return speech_encoder_->Num10MsFramesInNextPacket();
46 } 46 }
47 47
48 int AudioEncoderCopyRed::Max10MsFramesInAPacket() const { 48 int AudioEncoderCopyRed::Max10MsFramesInAPacket() const {
49 return speech_encoder_->Max10MsFramesInAPacket(); 49 return speech_encoder_->Max10MsFramesInAPacket();
50 } 50 }
51 51
52 void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) { 52 int AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) {
53 speech_encoder_->SetTargetBitrate(bits_per_second); 53 return speech_encoder_->SetTargetBitrate(bits_per_second);
54 } 54 }
55 55
56 void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) { 56 void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) {
57 DCHECK_GE(fraction, 0.0); 57 DCHECK_GE(fraction, 0.0);
58 DCHECK_LE(fraction, 1.0); 58 DCHECK_LE(fraction, 1.0);
59 speech_encoder_->SetProjectedPacketLossRate(fraction); 59 speech_encoder_->SetProjectedPacketLossRate(fraction);
60 } 60 }
61 61
62 AudioEncoder::EncodedInfo AudioEncoderCopyRed::EncodeInternal( 62 AudioEncoder::EncodedInfo AudioEncoderCopyRed::EncodeInternal(
63 uint32_t rtp_timestamp, 63 uint32_t rtp_timestamp,
(...skipping 29 matching lines...) Expand all
93 info.payload_type = red_payload_type_; 93 info.payload_type = red_payload_type_;
94 info.encoded_bytes = 0; 94 info.encoded_bytes = 0;
95 for (std::vector<EncodedInfoLeaf>::const_iterator it = info.redundant.begin(); 95 for (std::vector<EncodedInfoLeaf>::const_iterator it = info.redundant.begin();
96 it != info.redundant.end(); ++it) { 96 it != info.redundant.end(); ++it) {
97 info.encoded_bytes += it->encoded_bytes; 97 info.encoded_bytes += it->encoded_bytes;
98 } 98 }
99 return info; 99 return info;
100 } 100 }
101 101
102 } // namespace webrtc 102 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698