OLD | NEW |
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() = default; | 16 AudioEncoder::EncodedInfo::EncodedInfo() = default; |
17 | 17 |
18 AudioEncoder::EncodedInfo::~EncodedInfo() = default; | 18 AudioEncoder::EncodedInfo::~EncodedInfo() = default; |
19 | 19 |
20 int AudioEncoder::RtpTimestampRateHz() const { | 20 int AudioEncoder::RtpTimestampRateHz() const { |
21 return SampleRateHz(); | 21 return SampleRateHz(); |
22 } | 22 } |
23 | 23 |
24 AudioEncoder::EncodedInfo AudioEncoder::Encode(uint32_t rtp_timestamp, | 24 AudioEncoder::EncodedInfo AudioEncoder::Encode(uint32_t rtp_timestamp, |
25 const int16_t* audio, | 25 const int16_t* audio, |
26 size_t num_samples_per_channel, | 26 size_t num_samples_per_channel, |
27 size_t max_encoded_bytes, | 27 size_t max_encoded_bytes, |
28 uint8_t* encoded) { | 28 uint8_t* encoded) { |
29 CHECK_EQ(num_samples_per_channel, | 29 RTC_CHECK_EQ(num_samples_per_channel, |
30 static_cast<size_t>(SampleRateHz() / 100)); | 30 static_cast<size_t>(SampleRateHz() / 100)); |
31 EncodedInfo info = | 31 EncodedInfo info = |
32 EncodeInternal(rtp_timestamp, audio, max_encoded_bytes, encoded); | 32 EncodeInternal(rtp_timestamp, audio, max_encoded_bytes, encoded); |
33 CHECK_LE(info.encoded_bytes, max_encoded_bytes); | 33 RTC_CHECK_LE(info.encoded_bytes, max_encoded_bytes); |
34 return info; | 34 return info; |
35 } | 35 } |
36 | 36 |
37 bool AudioEncoder::SetFec(bool enable) { | 37 bool AudioEncoder::SetFec(bool enable) { |
38 return !enable; | 38 return !enable; |
39 } | 39 } |
40 | 40 |
41 bool AudioEncoder::SetDtx(bool enable) { | 41 bool AudioEncoder::SetDtx(bool enable) { |
42 return !enable; | 42 return !enable; |
43 } | 43 } |
44 | 44 |
45 bool AudioEncoder::SetApplication(Application application) { | 45 bool AudioEncoder::SetApplication(Application application) { |
46 return false; | 46 return false; |
47 } | 47 } |
48 | 48 |
49 void AudioEncoder::SetMaxPlaybackRate(int frequency_hz) {} | 49 void AudioEncoder::SetMaxPlaybackRate(int frequency_hz) {} |
50 | 50 |
51 void AudioEncoder::SetProjectedPacketLossRate(double fraction) {} | 51 void AudioEncoder::SetProjectedPacketLossRate(double fraction) {} |
52 | 52 |
53 void AudioEncoder::SetTargetBitrate(int target_bps) {} | 53 void AudioEncoder::SetTargetBitrate(int target_bps) {} |
54 | 54 |
55 } // namespace webrtc | 55 } // namespace webrtc |
OLD | NEW |