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

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

Issue 1702943002: Pass ownership of external encoders to the ACM (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 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 #include "webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.h" 11 #include "webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.h"
12 12
13 #include <string.h> 13 #include <string.h>
14 14
15 #include <utility>
16
15 #include "webrtc/base/checks.h" 17 #include "webrtc/base/checks.h"
16 18
17 namespace webrtc { 19 namespace webrtc {
18 20
19 AudioEncoderCopyRed::AudioEncoderCopyRed(const Config& config) 21 AudioEncoderCopyRed::Config::Config() = default;
20 : speech_encoder_(config.speech_encoder), 22
23 // TODO(kwiberg): =default this when Visual Studio learns to handle it.
24 AudioEncoderCopyRed::Config::Config(Config&& c)
25 : payload_type(c.payload_type),
26 speech_encoder(std::move(c.speech_encoder)) {}
27
28 AudioEncoderCopyRed::Config::~Config() = default;
29
30 AudioEncoderCopyRed::AudioEncoderCopyRed(Config&& config)
31 : speech_encoder_(std::move(config.speech_encoder)),
21 red_payload_type_(config.payload_type) { 32 red_payload_type_(config.payload_type) {
22 RTC_CHECK(speech_encoder_) << "Speech encoder not provided."; 33 RTC_CHECK(speech_encoder_) << "Speech encoder not provided.";
23 } 34 }
24 35
25 AudioEncoderCopyRed::~AudioEncoderCopyRed() = default; 36 AudioEncoderCopyRed::~AudioEncoderCopyRed() = default;
26 37
27 size_t AudioEncoderCopyRed::MaxEncodedBytes() const { 38 size_t AudioEncoderCopyRed::MaxEncodedBytes() const {
28 return 2 * speech_encoder_->MaxEncodedBytes(); 39 return 2 * speech_encoder_->MaxEncodedBytes();
29 } 40 }
30 41
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 126
116 void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) { 127 void AudioEncoderCopyRed::SetProjectedPacketLossRate(double fraction) {
117 speech_encoder_->SetProjectedPacketLossRate(fraction); 128 speech_encoder_->SetProjectedPacketLossRate(fraction);
118 } 129 }
119 130
120 void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) { 131 void AudioEncoderCopyRed::SetTargetBitrate(int bits_per_second) {
121 speech_encoder_->SetTargetBitrate(bits_per_second); 132 speech_encoder_->SetTargetBitrate(bits_per_second);
122 } 133 }
123 134
124 } // namespace webrtc 135 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698