| 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 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 AudioEncoder::EncodedInfo MockAudioEncoder::CopyEncoding::operator()( | 42 AudioEncoder::EncodedInfo MockAudioEncoder::CopyEncoding::operator()( |
| 43 uint32_t timestamp, | 43 uint32_t timestamp, |
| 44 rtc::ArrayView<const int16_t> audio, | 44 rtc::ArrayView<const int16_t> audio, |
| 45 rtc::Buffer* encoded) { | 45 rtc::Buffer* encoded) { |
| 46 RTC_CHECK(encoded); | 46 RTC_CHECK(encoded); |
| 47 RTC_CHECK_LE(info_.encoded_bytes, payload_.size()); | 47 RTC_CHECK_LE(info_.encoded_bytes, payload_.size()); |
| 48 encoded->AppendData(payload_.data(), info_.encoded_bytes); | 48 encoded->AppendData(payload_.data(), info_.encoded_bytes); |
| 49 return info_; | 49 return info_; |
| 50 } | 50 } |
| 51 | 51 |
| 52 MockAudioEncoderDeprecated::CopyEncoding::CopyEncoding( | |
| 53 AudioEncoder::EncodedInfo info, | |
| 54 rtc::ArrayView<const uint8_t> payload) | |
| 55 : info_(info), payload_(payload) { } | |
| 56 | |
| 57 MockAudioEncoderDeprecated::CopyEncoding::CopyEncoding( | |
| 58 rtc::ArrayView<const uint8_t> payload) | |
| 59 : payload_(payload) { | |
| 60 info_.encoded_bytes = payload_.size(); | |
| 61 } | |
| 62 | |
| 63 AudioEncoder::EncodedInfo MockAudioEncoderDeprecated::CopyEncoding::operator()( | |
| 64 uint32_t timestamp, | |
| 65 rtc::ArrayView<const int16_t> audio, | |
| 66 size_t max_bytes_encoded, | |
| 67 uint8_t* encoded) { | |
| 68 RTC_CHECK(encoded); | |
| 69 RTC_CHECK_LE(info_.encoded_bytes, payload_.size()); | |
| 70 std::memcpy(encoded, payload_.data(), info_.encoded_bytes); | |
| 71 return info_; | |
| 72 } | |
| 73 | |
| 74 } // namespace webrtc | 52 } // namespace webrtc |
| OLD | NEW |