1 /* 2 * Copyright (c) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_MOCK_AUDIO_TRANSPORT_CALLBACK_H 17 #define OHOS_MOCK_AUDIO_TRANSPORT_CALLBACK_H 18 19 #include "audio_event.h" 20 #include "daudio_errorcode.h" 21 #include "daudio_log.h" 22 #include "iaudio_processor_callback.h" 23 24 namespace OHOS { 25 namespace DistributedHardware { 26 class MockAudioTransportCallback : public IAudioDataTransCallback { 27 public: 28 MockAudioTransportCallback() = default; 29 ~MockAudioTransportCallback() = default; 30 31 int32_t OnStateChange(const AudioEventType type) override; 32 int32_t OnDecodeTransDataDone(const std::shared_ptr<AudioData> &audioData) override; 33 }; 34 OnStateChange(const AudioEventType type)35int32_t MockAudioTransportCallback::OnStateChange(const AudioEventType type) 36 { 37 DHLOGD("Test : On state change, state: %d.", type); 38 return DH_SUCCESS; 39 } 40 OnDecodeTransDataDone(const std::shared_ptr<AudioData> & audioData)41int32_t MockAudioTransportCallback::OnDecodeTransDataDone(const std::shared_ptr<AudioData> &audioData) 42 { 43 (void) audioData; 44 DHLOGE("Test : On decode trans data done."); 45 return DH_SUCCESS; 46 } 47 } // namespace DistributedHardware 48 } // namespace OHOS 49 #endif // OHOS_MOCK_AUDIO_TRANSPORT_CALLBACK_H 50