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_AVSESSION_SERVICE_LISTENER_H 17 #define OHOS_I_AVSESSION_SERVICE_LISTENER_H 18 19 #include <string> 20 #include "avsession_descriptor.h" 21 22 /** 23 * @brief Router is a part related to cast media 24 * @since 10 25 */ 26 namespace OHOS::AVSession { 27 class IAVSessionServiceListener { 28 public: 29 30 #ifdef CASTPLUS_CAST_ENGINE_ENABLE 31 32 /** 33 * Release cast session at sink end. 34 * 35 * @since 10 36 */ 37 virtual void ReleaseCastSession() = 0; 38 /** 39 * Create a new session at sink device. 40 * 41 * @param { int64_t } castHandle - Cast handle for cast session. 42 * @since 10 43 */ 44 virtual void CreateSessionByCast(const int64_t castHandle) = 0; 45 46 /** 47 * Notify Router that the device has been discovered. 48 * 49 * @param { OutputDeviceInfo } castOutputDeviceInfo - Discovered device infos. 50 * @since 10 51 */ 52 virtual void NotifyDeviceAvailable(const OutputDeviceInfo& castOutputDeviceInfo) = 0; 53 54 /** 55 * @brief Listen for the event of device logging. 56 * 57 * @param { DeviceLogEventCode } eventId - Event ID. 58 * @param { int64_t } int64_t - Param. 59 * @since 13 60 */ NotifyDeviceLogEvent(const DeviceLogEventCode eventId,const int64_t param)61 virtual void NotifyDeviceLogEvent(const DeviceLogEventCode eventId, const int64_t param) {}; 62 63 /** 64 * Notify Router that the device has been offlined. 65 * 66 * @param { std::string& } deviceId - Offlined device ID. 67 * @since 10 68 */ 69 virtual void NotifyDeviceOffline(const std::string& deviceId) = 0; 70 #endif 71 }; 72 } // namespace OHOS::AVSession 73 #endif // OHOS_I_AVSESSION_SERVICE_LISTENER_H 74