OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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/mock/mock_audio_encoder.h" | 11 #include "webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h" |
12 | 12 |
13 namespace webrtc { | 13 namespace webrtc { |
14 | 14 |
| 15 void MockAudioEncoder::AudioEncoderOnReceivedOverhead( |
| 16 size_t overhead_bytes_per_packet) { |
| 17 AudioEncoder::OnReceivedOverhead(overhead_bytes_per_packet); |
| 18 } |
| 19 |
| 20 void MockAudioEncoder::AudioEncoderOnReceivedTargetAudioBitrate( |
| 21 int target_audio_bitrate_bps) { |
| 22 AudioEncoder::OnReceivedTargetAudioBitrate(target_audio_bitrate_bps); |
| 23 } |
| 24 |
15 MockAudioEncoder::FakeEncoding::FakeEncoding( | 25 MockAudioEncoder::FakeEncoding::FakeEncoding( |
16 const AudioEncoder::EncodedInfo& info) | 26 const AudioEncoder::EncodedInfo& info) |
17 : info_(info) { } | 27 : info_(info) { } |
18 | 28 |
19 MockAudioEncoder::FakeEncoding::FakeEncoding(size_t encoded_bytes) { | 29 MockAudioEncoder::FakeEncoding::FakeEncoding(size_t encoded_bytes) { |
20 info_.encoded_bytes = encoded_bytes; | 30 info_.encoded_bytes = encoded_bytes; |
21 } | 31 } |
22 | 32 |
23 AudioEncoder::EncodedInfo MockAudioEncoder::FakeEncoding::operator()( | 33 AudioEncoder::EncodedInfo MockAudioEncoder::FakeEncoding::operator()( |
24 uint32_t timestamp, | 34 uint32_t timestamp, |
(...skipping 18 matching lines...) Expand all Loading... |
43 uint32_t timestamp, | 53 uint32_t timestamp, |
44 rtc::ArrayView<const int16_t> audio, | 54 rtc::ArrayView<const int16_t> audio, |
45 rtc::Buffer* encoded) { | 55 rtc::Buffer* encoded) { |
46 RTC_CHECK(encoded); | 56 RTC_CHECK(encoded); |
47 RTC_CHECK_LE(info_.encoded_bytes, payload_.size()); | 57 RTC_CHECK_LE(info_.encoded_bytes, payload_.size()); |
48 encoded->AppendData(payload_.data(), info_.encoded_bytes); | 58 encoded->AppendData(payload_.data(), info_.encoded_bytes); |
49 return info_; | 59 return info_; |
50 } | 60 } |
51 | 61 |
52 } // namespace webrtc | 62 } // namespace webrtc |
OLD | NEW |