xref: /aosp_15_r20/external/webrtc/modules/audio_coding/neteq/mock/mock_decoder_database.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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(int,
31               RegisterPayload,
32               (int rtp_payload_type, const SdpAudioFormat& audio_format),
33               (override));
34   MOCK_METHOD(int, Remove, (uint8_t rtp_payload_type), (override));
35   MOCK_METHOD(void, RemoveAll, (), (override));
36   MOCK_METHOD(const DecoderInfo*,
37               GetDecoderInfo,
38               (uint8_t rtp_payload_type),
39               (const, override));
40   MOCK_METHOD(int,
41               SetActiveDecoder,
42               (uint8_t rtp_payload_type, bool* new_decoder),
43               (override));
44   MOCK_METHOD(AudioDecoder*, GetActiveDecoder, (), (const, override));
45   MOCK_METHOD(int, SetActiveCngDecoder, (uint8_t rtp_payload_type), (override));
46   MOCK_METHOD(ComfortNoiseDecoder*, GetActiveCngDecoder, (), (const, override));
47 };
48 
49 }  // namespace webrtc
50 #endif  // MODULES_AUDIO_CODING_NETEQ_MOCK_MOCK_DECODER_DATABASE_H_
51