OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 25 matching lines...) Expand all Loading... |
36 int sample_rate_hz, | 36 int sample_rate_hz, |
37 int16_t* decoded, | 37 int16_t* decoded, |
38 SpeechType* speech_type) override { | 38 SpeechType* speech_type) override { |
39 size_t ret = WebRtcPcm16b_Decode(encoded, encoded_len, decoded); | 39 size_t ret = WebRtcPcm16b_Decode(encoded, encoded_len, decoded); |
40 *speech_type = ConvertSpeechType(1); | 40 *speech_type = ConvertSpeechType(1); |
41 return static_cast<int>(ret); | 41 return static_cast<int>(ret); |
42 } | 42 } |
43 size_t Channels() const override { return 1; } | 43 size_t Channels() const override { return 1; } |
44 | 44 |
45 private: | 45 private: |
46 DISALLOW_COPY_AND_ASSIGN(ExternalPcm16B); | 46 RTC_DISALLOW_COPY_AND_ASSIGN(ExternalPcm16B); |
47 }; | 47 }; |
48 | 48 |
49 // Create a mock of ExternalPcm16B which delegates all calls to the real object. | 49 // Create a mock of ExternalPcm16B which delegates all calls to the real object. |
50 // The reason is that we can then track that the correct calls are being made. | 50 // The reason is that we can then track that the correct calls are being made. |
51 class MockExternalPcm16B : public ExternalPcm16B { | 51 class MockExternalPcm16B : public ExternalPcm16B { |
52 public: | 52 public: |
53 MockExternalPcm16B() { | 53 MockExternalPcm16B() { |
54 // By default, all calls are delegated to the real object. | 54 // By default, all calls are delegated to the real object. |
55 ON_CALL(*this, Decode(_, _, _, _, _, _)) | 55 ON_CALL(*this, Decode(_, _, _, _, _, _)) |
56 .WillByDefault(Invoke(&real_, &ExternalPcm16B::Decode)); | 56 .WillByDefault(Invoke(&real_, &ExternalPcm16B::Decode)); |
(...skipping 29 matching lines...) Expand all Loading... |
86 uint32_t arrival_timestamp)); | 86 uint32_t arrival_timestamp)); |
87 MOCK_METHOD0(ErrorCode, | 87 MOCK_METHOD0(ErrorCode, |
88 int()); | 88 int()); |
89 | 89 |
90 private: | 90 private: |
91 ExternalPcm16B real_; | 91 ExternalPcm16B real_; |
92 }; | 92 }; |
93 | 93 |
94 } // namespace webrtc | 94 } // namespace webrtc |
95 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_EXTERNAL_DECODER_PCM16B_H
_ | 95 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_EXTERNAL_DECODER_PCM16B_H
_ |
OLD | NEW |