• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2022 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <gmock/gmock.h>
20 
21 #include <vector>
22 
23 #include "codec_interface.h"
24 
25 class MockCodecInterface {
26  public:
27   MockCodecInterface() = default;
28   MockCodecInterface(const MockCodecInterface&) = delete;
29   MockCodecInterface& operator=(const MockCodecInterface&) = delete;
30 
31   virtual ~MockCodecInterface() = default;
32 
33   MOCK_METHOD(
34       (bluetooth::le_audio::CodecInterface::Status), InitEncoder,
35       (const bluetooth::le_audio::LeAudioCodecConfiguration& pcm_config,
36        const bluetooth::le_audio::LeAudioCodecConfiguration& codec_config));
37   MOCK_METHOD(
38       bluetooth::le_audio::CodecInterface::Status, InitDecoder,
39       (const bluetooth::le_audio::LeAudioCodecConfiguration& codec_config,
40        const bluetooth::le_audio::LeAudioCodecConfiguration& pcm_config));
41   MOCK_METHOD(bluetooth::le_audio::CodecInterface::Status, Encode,
42               (const uint8_t* data, int stride, uint16_t out_size,
43                std::vector<int16_t>* out_buffer, uint16_t out_offset));
44   MOCK_METHOD(bluetooth::le_audio::CodecInterface::Status, Decode,
45               (uint8_t * data, uint16_t size));
46   MOCK_METHOD((void), Cleanup, ());
47   MOCK_METHOD((bool), IsReady, ());
48   MOCK_METHOD((uint16_t), GetNumOfSamplesPerChannel, ());
49   MOCK_METHOD((uint8_t), GetNumOfBytesPerSample, ());
50   MOCK_METHOD((std::vector<int16_t>&), GetDecodedSamples, ());
51 };
52