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

Side by Side Diff: webrtc/modules/audio_coding/codecs/audio_encoder.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 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/audio_encoder.h" 11 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
12 #include "webrtc/base/checks.h" 12 #include "webrtc/base/checks.h"
13 13
14 namespace webrtc { 14 namespace webrtc {
15 15
16 AudioEncoder::EncodedInfo::EncodedInfo() : EncodedInfoLeaf() { 16 AudioEncoder::EncodedInfo::EncodedInfo() = default;
17 }
18 17
19 AudioEncoder::EncodedInfo::~EncodedInfo() { 18 AudioEncoder::EncodedInfo::~EncodedInfo() = default;
19
20 int AudioEncoder::RtpTimestampRateHz() const {
21 return SampleRateHz();
20 } 22 }
21 23
22 AudioEncoder::EncodedInfo AudioEncoder::Encode(uint32_t rtp_timestamp, 24 AudioEncoder::EncodedInfo AudioEncoder::Encode(uint32_t rtp_timestamp,
23 const int16_t* audio, 25 const int16_t* audio,
24 size_t num_samples_per_channel, 26 size_t num_samples_per_channel,
25 size_t max_encoded_bytes, 27 size_t max_encoded_bytes,
26 uint8_t* encoded) { 28 uint8_t* encoded) {
27 CHECK_EQ(num_samples_per_channel, 29 CHECK_EQ(num_samples_per_channel,
28 static_cast<size_t>(SampleRateHz() / 100)); 30 static_cast<size_t>(SampleRateHz() / 100));
29 EncodedInfo info = 31 EncodedInfo info =
30 EncodeInternal(rtp_timestamp, audio, max_encoded_bytes, encoded); 32 EncodeInternal(rtp_timestamp, audio, max_encoded_bytes, encoded);
31 CHECK_LE(info.encoded_bytes, max_encoded_bytes); 33 CHECK_LE(info.encoded_bytes, max_encoded_bytes);
32 return info; 34 return info;
33 } 35 }
34 36
35 int AudioEncoder::RtpTimestampRateHz() const { 37 bool AudioEncoder::SetFec(bool enable) {
36 return SampleRateHz(); 38 return !enable;
37 } 39 }
38 40
41 bool AudioEncoder::SetDtx(bool enable) {
42 return !enable;
43 }
44
45 bool AudioEncoder::SetApplication(Application application) {
46 return false;
47 }
48
49 bool AudioEncoder::SetMaxPlaybackRate(int frequency_hz) {
50 return true;
51 }
52
53 void AudioEncoder::SetProjectedPacketLossRate(double fraction) {}
54
55 void AudioEncoder::SetTargetBitrate(int target_bps) {}
56
57 void AudioEncoder::SetMaxBitrate(int max_bps) {}
58
59 void AudioEncoder::SetMaxPayloadSize(int max_payload_size_bytes) {}
60
39 } // namespace webrtc 61 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/audio_encoder.h ('k') | webrtc/modules/audio_coding/codecs/audio_encoder_mutable_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698