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

Unified Diff: webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc

Issue 1322973004: Fold AudioEncoderMutable into AudioEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: review fixes Created 5 years, 3 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/red/audio_encoder_copy_red.cc
diff --git a/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc b/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc
index dccaf4306157a32e17e6cf240a2203c823414c66..9b7c26cadff1b35b8afe8c7491095a22514d1e0a 100644
--- a/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc
+++ b/webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc
@@ -22,23 +22,22 @@ AudioEncoderCopyRed::AudioEncoderCopyRed(const Config& config)
CHECK(speech_encoder_) << "Speech encoder not provided.";
}
-AudioEncoderCopyRed::~AudioEncoderCopyRed() {
+AudioEncoderCopyRed::~AudioEncoderCopyRed() = default;
+
+size_t AudioEncoderCopyRed::MaxEncodedBytes() const {
+ return 2 * speech_encoder_->MaxEncodedBytes();
}
int AudioEncoderCopyRed::SampleRateHz() const {
return speech_encoder_->SampleRateHz();
}
-int AudioEncoderCopyRed::RtpTimestampRateHz() const {
- return speech_encoder_->RtpTimestampRateHz();
-}
-
int AudioEncoderCopyRed::NumChannels() const {
return speech_encoder_->NumChannels();
}
-size_t AudioEncoderCopyRed::MaxEncodedBytes() const {
- return 2 * speech_encoder_->MaxEncodedBytes();
+int AudioEncoderCopyRed::RtpTimestampRateHz() const {
+ return speech_encoder_->RtpTimestampRateHz();
}
size_t AudioEncoderCopyRed::Num10MsFramesInNextPacket() const {
@@ -53,16 +52,6 @@ int AudioEncoderCopyRed::GetTargetBitrate() const {
return speech_encoder_->GetTargetBitrate();
}
-void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) {
- speech_encoder_->SetTargetBitrate(bits_per_second);
-}
-
-void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) {
- DCHECK_GE(fraction, 0.0);
- DCHECK_LE(fraction, 1.0);
- speech_encoder_->SetProjectedPacketLossRate(fraction);
-}
-
AudioEncoder::EncodedInfo AudioEncoderCopyRed::EncodeInternal(
uint32_t rtp_timestamp,
const int16_t* audio,
@@ -103,4 +92,42 @@ AudioEncoder::EncodedInfo AudioEncoderCopyRed::EncodeInternal(
return info;
}
+void AudioEncoderCopyRed::Reset() {
+ speech_encoder_->Reset();
+ secondary_encoded_.Clear();
+ secondary_info_.encoded_bytes = 0;
+}
+
+bool AudioEncoderCopyRed::SetFec(bool enable) {
+ return speech_encoder_->SetFec(enable);
+}
+
+bool AudioEncoderCopyRed::SetDtx(bool enable) {
+ return speech_encoder_->SetDtx(enable);
+}
+
+bool AudioEncoderCopyRed::SetApplication(Application application) {
+ return speech_encoder_->SetApplication(application);
+}
+
+bool AudioEncoderCopyRed::SetMaxPlaybackRate(int frequency_hz) {
+ return speech_encoder_->SetMaxPlaybackRate(frequency_hz);
+}
+
+void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) {
+ speech_encoder_->SetProjectedPacketLossRate(fraction);
+}
+
+void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) {
+ speech_encoder_->SetTargetBitrate(bits_per_second);
+}
+
+void AudioEncoderCopyRed::SetMaxBitrate(int max_bps) {
+ speech_encoder_->SetMaxBitrate(max_bps);
+}
+
+void AudioEncoderCopyRed::SetMaxPayloadSize(int max_payload_size_bytes) {
+ speech_encoder_->SetMaxPayloadSize(max_payload_size_bytes);
+}
+
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698