1 /* 2 * Copyright (c) 2024 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_CJ_AVSESSION_IMPL_H 17 #define OHOS_CJ_AVSESSION_IMPL_H 18 19 #include "av_session.h" 20 #include "ffi_remote_data.h" 21 #include "cj_avsession_prototypes.h" 22 #include "cj_avsession_callback.h" 23 24 namespace OHOS::AVSession { 25 26 class CJAVSessionImpl : public OHOS::FFI::FFIData { 27 DECL_TYPE(CJAVSessionImpl, OHOS::FFI::FFIData) 28 public: 29 CJAVSessionImpl(std::shared_ptr<AVSession> session); 30 31 int32_t OnEvent(int32_t type, int64_t id); 32 int32_t OffEvent(int32_t type); 33 34 int32_t SetAVMetaData(CAVMetaData& data); 35 int32_t SetAVCallMetaData(CAVCallMetaData& dat); 36 int32_t SetAVCallState(CAVCallState& state); 37 int32_t SetAVPlaybackState(CAVPlaybackState& state); 38 int32_t SetAVQueueItems(CArray& items); 39 int32_t SetAVQueueTitle(char*& title); 40 int32_t SetExtras(CArray& extras); 41 int32_t SetLaunchAbility(int64_t abilityId); 42 int32_t GetController(); 43 int32_t GetAVCastController(); 44 int32_t GetOutputDevice(COutputDeviceInfo& outputDeviceInfo); 45 int32_t GetAllCastDisplays(CArray& infos); 46 int32_t Activate(); 47 int32_t Deactivate(); 48 int32_t Destroy(); 49 int32_t StopCasting(); 50 int32_t DispatchSessionEvent(char*& event, CArray& args); 51 GetSessionId()52 std::string GetSessionId() { return sessionId_; } 53 private: 54 std::string sessionId_; 55 std::string sessionType_; 56 std::shared_ptr<AVSession> session_; 57 std::shared_ptr<CJAVSessionCallback> callback_; 58 }; 59 60 } // namespace AVSession::OHOS 61 62 #endif // OHOS_CJ_AVSESSION_IMPL_H