Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: webrtc/modules/audio_coding/neteq/mock/mock_external_decoder_pcm16b.h

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 18 matching lines...) Expand all
29 public: 29 public:
30 ExternalPcm16B() {} 30 ExternalPcm16B() {}
31 virtual int Init() { return 0; } 31 virtual int Init() { return 0; }
32 32
33 protected: 33 protected:
34 int DecodeInternal(const uint8_t* encoded, 34 int DecodeInternal(const uint8_t* encoded,
35 size_t encoded_len, 35 size_t encoded_len,
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 int16_t ret = WebRtcPcm16b_Decode( 39 size_t ret = WebRtcPcm16b_Decode(encoded, encoded_len, decoded);
40 encoded, static_cast<int16_t>(encoded_len), decoded);
41 *speech_type = ConvertSpeechType(1); 40 *speech_type = ConvertSpeechType(1);
42 return ret; 41 return static_cast<int>(ret);
43 } 42 }
44 size_t Channels() const override { return 1; } 43 size_t Channels() const override { return 1; }
45 44
46 private: 45 private:
47 DISALLOW_COPY_AND_ASSIGN(ExternalPcm16B); 46 DISALLOW_COPY_AND_ASSIGN(ExternalPcm16B);
48 }; 47 };
49 48
50 // 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.
51 // 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.
52 class MockExternalPcm16B : public ExternalPcm16B { 51 class MockExternalPcm16B : public ExternalPcm16B {
(...skipping 19 matching lines...) Expand all
72 MOCK_METHOD6(Decode, 71 MOCK_METHOD6(Decode,
73 int(const uint8_t* encoded, 72 int(const uint8_t* encoded,
74 size_t encoded_len, 73 size_t encoded_len,
75 int sample_rate_hz, 74 int sample_rate_hz,
76 size_t max_decoded_bytes, 75 size_t max_decoded_bytes,
77 int16_t* decoded, 76 int16_t* decoded,
78 SpeechType* speech_type)); 77 SpeechType* speech_type));
79 MOCK_CONST_METHOD0(HasDecodePlc, 78 MOCK_CONST_METHOD0(HasDecodePlc,
80 bool()); 79 bool());
81 MOCK_METHOD2(DecodePlc, 80 MOCK_METHOD2(DecodePlc,
82 int(int num_frames, int16_t* decoded)); 81 size_t(size_t num_frames, int16_t* decoded));
83 MOCK_METHOD0(Init, 82 MOCK_METHOD0(Init,
84 int()); 83 int());
85 MOCK_METHOD5(IncomingPacket, 84 MOCK_METHOD5(IncomingPacket,
86 int(const uint8_t* payload, size_t payload_len, 85 int(const uint8_t* payload, size_t payload_len,
87 uint16_t rtp_sequence_number, uint32_t rtp_timestamp, 86 uint16_t rtp_sequence_number, uint32_t rtp_timestamp,
88 uint32_t arrival_timestamp)); 87 uint32_t arrival_timestamp));
89 MOCK_METHOD0(ErrorCode, 88 MOCK_METHOD0(ErrorCode,
90 int()); 89 int());
91 90
92 private: 91 private:
93 ExternalPcm16B real_; 92 ExternalPcm16B real_;
94 }; 93 };
95 94
96 } // namespace webrtc 95 } // namespace webrtc
97 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_EXTERNAL_DECODER_PCM16B_H _ 96 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_EXTERNAL_DECODER_PCM16B_H _
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698