• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DECODER_DATABASE_H_
12 #define MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DECODER_DATABASE_H_
13 
14 #include <string>
15 
16 #include "modules/audio_coding/neteq/decoder_database.h"
17 #include "test/gmock.h"
18 
19 namespace webrtc {
20 
21 class MockDecoderDatabase : public DecoderDatabase {
22  public:
23   explicit MockDecoderDatabase(
24       rtc::scoped_refptr<AudioDecoderFactory> factory = nullptr)
DecoderDatabase(factory,absl::nullopt)25       : DecoderDatabase(factory, absl::nullopt) {}
~MockDecoderDatabase()26   ~MockDecoderDatabase() override { Die(); }
27   MOCK_METHOD(void, Die, ());
28   MOCK_METHOD(bool, Empty, (), (const, override));
29   MOCK_METHOD(int, Size, (), (const, override));
30   MOCK_METHOD(void, Reset, (), (override));
31   MOCK_METHOD(int,
32               RegisterPayload,
33               (int rtp_payload_type, const SdpAudioFormat& audio_format),
34               (override));
35   MOCK_METHOD(int, Remove, (uint8_t rtp_payload_type), (override));
36   MOCK_METHOD(void, RemoveAll, (), (override));
37   MOCK_METHOD(const DecoderInfo*,
38               GetDecoderInfo,
39               (uint8_t rtp_payload_type),
40               (const, override));
41   MOCK_METHOD(int,
42               SetActiveDecoder,
43               (uint8_t rtp_payload_type, bool* new_decoder),
44               (override));
45   MOCK_METHOD(AudioDecoder*, GetActiveDecoder, (), (const, override));
46   MOCK_METHOD(int, SetActiveCngDecoder, (uint8_t rtp_payload_type), (override));
47   MOCK_METHOD(ComfortNoiseDecoder*, GetActiveCngDecoder, (), (const, override));
48 };
49 
50 }  // namespace webrtc
51 #endif  // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DECODER_DATABASE_H_
52