1 /* 2 * Copyright (c) 2023 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_I_AV_RECEIVER_ENGINE_CALLBACK_H 17 #define OHOS_I_AV_RECEIVER_ENGINE_CALLBACK_H 18 19 #include "av_trans_buffer.h" 20 #include "av_trans_errno.h" 21 #include "av_trans_message.h" 22 #include "av_trans_types.h" 23 24 namespace OHOS { 25 namespace DistributedHardware { 26 /** 27 * @brief AV receiver engine callback interface. 28 * 29 * AV receiver engine callback is used to receive the engine state change events, 30 * message notification and available buffer data. 31 * 32 * @since 1.0 33 * @version 1.0 34 */ 35 class IAVReceiverEngineCallback { 36 public: 37 /** 38 * @brief Destructor. 39 * @return No return value. 40 */ 41 virtual ~IAVReceiverEngineCallback() = default; 42 43 /** 44 * @brief Report the engine state change events to the distributed service. 45 * @param event event content. 46 * @return Returns DH_AVT_SUCCESS(0) if successful, otherwise returns other error code. 47 */ 48 virtual int32_t OnReceiverEvent(const AVTransEvent &event) = 0; 49 50 /** 51 * @brief Report the engine message to the distributed service. 52 * @param message message content. 53 * @return Returns DH_AVT_SUCCESS(0) if successful, otherwise returns other error code. 54 */ 55 virtual int32_t OnMessageReceived(const std::shared_ptr<AVTransMessage> &message) = 0; 56 57 /** 58 * @brief Report the available buffer data to the distributed service. 59 * @param buffer buffer data. 60 * @return Returns DH_AVT_SUCCESS(0) if successful, otherwise returns other error code. 61 */ 62 virtual int32_t OnDataAvailable(const std::shared_ptr<AVTransBuffer> &buffer) = 0; 63 }; 64 } // DistributedHardware 65 } // OHOS 66 #endif // OHOS_I_AV_RECEIVER_ENGINE_CALLBACK_H