1 /* 2 * Copyright (c) 2022-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_REMOTE_SESSION_COMMAND_PROCESS_H 17 #define OHOS_REMOTE_SESSION_COMMAND_PROCESS_H 18 19 #include "iavsession_service.h" 20 #include "iremote_proxy.h" 21 #include "av_session.h" 22 #include "avsession_controller.h" 23 #include "avsession_errors.h" 24 25 namespace OHOS::AVSession { 26 class RemoteSessionCommandProcess : public IRemoteProxy<IAVSessionService> { 27 public: 28 explicit RemoteSessionCommandProcess(const sptr<IRemoteObject>& impl); 29 CreateSessionInner(const std::string & tag,int32_t type,const AppExecFwk::ElementName & elementName)30 sptr<IRemoteObject> CreateSessionInner(const std::string& tag, int32_t type, 31 const AppExecFwk::ElementName& elementName) override 32 { 33 return nullptr; 34 } 35 GetAllSessionDescriptors(std::vector<AVSessionDescriptor> & descriptors)36 int32_t GetAllSessionDescriptors(std::vector<AVSessionDescriptor>& descriptors) override 37 { 38 return AVSESSION_SUCCESS; 39 } 40 GetSessionDescriptorsBySessionId(const std::string & sessionId,AVSessionDescriptor & descriptor)41 int32_t GetSessionDescriptorsBySessionId(const std::string& sessionId, AVSessionDescriptor& descriptor) override 42 { 43 return AVSESSION_SUCCESS; 44 } 45 GetHistoricalSessionDescriptors(int32_t maxSize,std::vector<AVSessionDescriptor> & descriptors)46 int32_t GetHistoricalSessionDescriptors(int32_t maxSize, std::vector<AVSessionDescriptor>& descriptors) override 47 { 48 return AVSESSION_SUCCESS; 49 } 50 GetHistoricalAVQueueInfos(int32_t maxSize,int32_t maxAppSize,std::vector<AVQueueInfo> & avQueueInfo)51 int32_t GetHistoricalAVQueueInfos(int32_t maxSize, int32_t maxAppSize, 52 std::vector<AVQueueInfo>& avQueueInfo) override 53 { 54 return AVSESSION_SUCCESS; 55 } 56 StartAVPlayback(const std::string & bundleName,const std::string & assetId)57 int32_t StartAVPlayback(const std::string& bundleName, const std::string& assetId) override 58 { 59 return AVSESSION_SUCCESS; 60 } 61 CreateControllerInner(const std::string & sessionId,sptr<IRemoteObject> & object)62 int32_t CreateControllerInner(const std::string& sessionId, sptr<IRemoteObject>& object) override 63 { 64 return AVSESSION_SUCCESS; 65 } 66 67 #ifdef CASTPLUS_CAST_ENGINE_ENABLE GetAVCastControllerInner(const std::string & sessionId,sptr<IRemoteObject> & object)68 int32_t GetAVCastControllerInner(const std::string& sessionId, sptr<IRemoteObject>& object) override 69 { 70 return AVSESSION_SUCCESS; 71 } 72 #endif 73 RegisterSessionListener(const sptr<ISessionListener> & listener)74 int32_t RegisterSessionListener(const sptr<ISessionListener>& listener) override 75 { 76 return AVSESSION_SUCCESS; 77 } 78 SendSystemAVKeyEvent(const MMI::KeyEvent & keyEvent)79 int32_t SendSystemAVKeyEvent(const MMI::KeyEvent& keyEvent) override 80 { 81 return AVSESSION_SUCCESS; 82 } 83 SendSystemControlCommand(const AVControlCommand & command)84 int32_t SendSystemControlCommand(const AVControlCommand& command) override 85 { 86 return AVSESSION_SUCCESS; 87 } 88 RegisterClientDeathObserver(const sptr<IClientDeath> & observer)89 int32_t RegisterClientDeathObserver(const sptr<IClientDeath>& observer) override 90 { 91 return AVSESSION_SUCCESS; 92 } 93 CastAudio(const SessionToken & token,const std::vector<AudioStandard::AudioDeviceDescriptor> & descriptors)94 int32_t CastAudio(const SessionToken& token, 95 const std::vector<AudioStandard::AudioDeviceDescriptor>& descriptors) override 96 { 97 return AVSESSION_SUCCESS; 98 } 99 CastAudioForAll(const std::vector<AudioStandard::AudioDeviceDescriptor> & descriptors)100 int32_t CastAudioForAll(const std::vector<AudioStandard::AudioDeviceDescriptor>& descriptors) override 101 { 102 return AVSESSION_SUCCESS; 103 } 104 105 int32_t ProcessCastAudioCommand(const RemoteServiceCommand command, const std::string& input, 106 std::string& output) override; 107 108 #ifdef CASTPLUS_CAST_ENGINE_ENABLE StartCast(const SessionToken & sessionToken,const OutputDeviceInfo & outputDeviceInfo)109 int32_t StartCast(const SessionToken& sessionToken, const OutputDeviceInfo& outputDeviceInfo) override 110 { 111 return AVSESSION_SUCCESS; 112 } 113 StopCast(const SessionToken & sessionToken)114 int32_t StopCast(const SessionToken& sessionToken) override 115 { 116 return AVSESSION_SUCCESS; 117 } 118 checkEnableCast(bool enable)119 int32_t checkEnableCast(bool enable) override 120 { 121 return AVSESSION_SUCCESS; 122 } 123 #endif 124 Close(void)125 int32_t Close(void) override 126 { 127 return AVSESSION_SUCCESS; 128 } 129 private: 130 static sptr<IRemoteObject>& impl_; 131 static inline BrokerDelegator<RemoteSessionCommandProcess> delegator_; 132 }; 133 } // namespace OHOS::AVSession 134 #endif // OHOS_REMOTE_SESSION_COMMAND_PROCESS_H