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 |
(...skipping 25 matching lines...) Expand all Loading... |
36 MOCK_METHOD1(SetApplication, bool(Application application)); | 36 MOCK_METHOD1(SetApplication, bool(Application application)); |
37 MOCK_METHOD1(SetMaxPlaybackRate, void(int frequency_hz)); | 37 MOCK_METHOD1(SetMaxPlaybackRate, void(int frequency_hz)); |
38 MOCK_METHOD1(SetProjectedPacketLossRate, void(double fraction)); | 38 MOCK_METHOD1(SetProjectedPacketLossRate, void(double fraction)); |
39 MOCK_METHOD1(SetTargetBitrate, void(int target_bps)); | 39 MOCK_METHOD1(SetTargetBitrate, void(int target_bps)); |
40 MOCK_METHOD1(SetMaxBitrate, void(int max_bps)); | 40 MOCK_METHOD1(SetMaxBitrate, void(int max_bps)); |
41 MOCK_METHOD1(SetMaxPayloadSize, void(int max_payload_size_bytes)); | 41 MOCK_METHOD1(SetMaxPayloadSize, void(int max_payload_size_bytes)); |
42 }; | 42 }; |
43 | 43 |
44 class MockAudioEncoder final : public MockAudioEncoderBase { | 44 class MockAudioEncoder final : public MockAudioEncoderBase { |
45 public: | 45 public: |
46 using AudioEncoder::EncodeInternal; | |
47 | |
48 // Note, we explicitly chose not to create a mock for the Encode method. | 46 // Note, we explicitly chose not to create a mock for the Encode method. |
49 MOCK_METHOD3(EncodeInternal, | 47 MOCK_METHOD3(EncodeImpl, |
50 EncodedInfo(uint32_t timestamp, | 48 EncodedInfo(uint32_t timestamp, |
51 rtc::ArrayView<const int16_t> audio, | 49 rtc::ArrayView<const int16_t> audio, |
52 rtc::Buffer* encoded)); | 50 rtc::Buffer* encoded)); |
53 | 51 |
54 class FakeEncoding { | 52 class FakeEncoding { |
55 public: | 53 public: |
56 // Creates a functor that will return |info| and adjust the rtc::Buffer | 54 // Creates a functor that will return |info| and adjust the rtc::Buffer |
57 // given as input to it, so it is info.encoded_bytes larger. | 55 // given as input to it, so it is info.encoded_bytes larger. |
58 FakeEncoding(const AudioEncoder::EncodedInfo& info); | 56 FakeEncoding(const AudioEncoder::EncodedInfo& info); |
59 | 57 |
(...skipping 29 matching lines...) Expand all Loading... |
89 rtc::Buffer* encoded); | 87 rtc::Buffer* encoded); |
90 private: | 88 private: |
91 AudioEncoder::EncodedInfo info_; | 89 AudioEncoder::EncodedInfo info_; |
92 rtc::ArrayView<const uint8_t> payload_; | 90 rtc::ArrayView<const uint8_t> payload_; |
93 }; | 91 }; |
94 | 92 |
95 }; | 93 }; |
96 | 94 |
97 class MockAudioEncoderDeprecated final : public MockAudioEncoderBase { | 95 class MockAudioEncoderDeprecated final : public MockAudioEncoderBase { |
98 public: | 96 public: |
99 using AudioEncoder::EncodeInternal; | |
100 | |
101 // Note, we explicitly chose not to create a mock for the Encode method. | 97 // Note, we explicitly chose not to create a mock for the Encode method. |
102 MOCK_METHOD4(EncodeInternal, | 98 MOCK_METHOD4(EncodeInternal, |
103 EncodedInfo(uint32_t timestamp, | 99 EncodedInfo(uint32_t timestamp, |
104 rtc::ArrayView<const int16_t> audio, | 100 rtc::ArrayView<const int16_t> audio, |
105 size_t max_encoded_bytes, | 101 size_t max_encoded_bytes, |
106 uint8_t* encoded)); | 102 uint8_t* encoded)); |
107 | 103 |
108 // A functor like MockAudioEncoder::CopyEncoding above, but which has the | 104 // A functor like MockAudioEncoder::CopyEncoding above, but which has the |
109 // deprecated Encode signature. Currently only used in one test and should be | 105 // deprecated Encode signature. Currently only used in one test and should be |
110 // removed once that backwards compatibility is. | 106 // removed once that backwards compatibility is. |
(...skipping 10 matching lines...) Expand all Loading... |
121 uint8_t* encoded); | 117 uint8_t* encoded); |
122 private: | 118 private: |
123 AudioEncoder::EncodedInfo info_; | 119 AudioEncoder::EncodedInfo info_; |
124 rtc::ArrayView<const uint8_t> payload_; | 120 rtc::ArrayView<const uint8_t> payload_; |
125 }; | 121 }; |
126 }; | 122 }; |
127 | 123 |
128 } // namespace webrtc | 124 } // namespace webrtc |
129 | 125 |
130 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_MOCK_MOCK_AUDIO_ENCODER_H_ | 126 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_MOCK_MOCK_AUDIO_ENCODER_H_ |
OLD | NEW |