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 CreateControllerInner(const std::string & sessionId,sptr<IRemoteObject> & object)51 int32_t CreateControllerInner(const std::string& sessionId, sptr<IRemoteObject>& object) override 52 { 53 return AVSESSION_SUCCESS; 54 } 55 56 #ifdef CASTPLUS_CAST_ENGINE_ENABLE GetAVCastControllerInner(const std::string & sessionId,sptr<IRemoteObject> & object)57 int32_t GetAVCastControllerInner(const std::string& sessionId, sptr<IRemoteObject>& object) override 58 { 59 return AVSESSION_SUCCESS; 60 } 61 #endif 62 RegisterSessionListener(const sptr<ISessionListener> & listener)63 int32_t RegisterSessionListener(const sptr<ISessionListener>& listener) override 64 { 65 return AVSESSION_SUCCESS; 66 } 67 SendSystemAVKeyEvent(const MMI::KeyEvent & keyEvent)68 int32_t SendSystemAVKeyEvent(const MMI::KeyEvent& keyEvent) override 69 { 70 return AVSESSION_SUCCESS; 71 } 72 SendSystemControlCommand(const AVControlCommand & command)73 int32_t SendSystemControlCommand(const AVControlCommand& command) override 74 { 75 return AVSESSION_SUCCESS; 76 } 77 RegisterClientDeathObserver(const sptr<IClientDeath> & observer)78 int32_t RegisterClientDeathObserver(const sptr<IClientDeath>& observer) override 79 { 80 return AVSESSION_SUCCESS; 81 } 82 CastAudio(const SessionToken & token,const std::vector<AudioStandard::AudioDeviceDescriptor> & descriptors)83 int32_t CastAudio(const SessionToken& token, 84 const std::vector<AudioStandard::AudioDeviceDescriptor>& descriptors) override 85 { 86 return AVSESSION_SUCCESS; 87 } 88 CastAudioForAll(const std::vector<AudioStandard::AudioDeviceDescriptor> & descriptors)89 int32_t CastAudioForAll(const std::vector<AudioStandard::AudioDeviceDescriptor>& descriptors) override 90 { 91 return AVSESSION_SUCCESS; 92 } 93 94 int32_t ProcessCastAudioCommand(const RemoteServiceCommand command, const std::string& input, 95 std::string& output) override; 96 97 #ifdef CASTPLUS_CAST_ENGINE_ENABLE StartCast(const SessionToken & sessionToken,const OutputDeviceInfo & outputDeviceInfo)98 int32_t StartCast(const SessionToken& sessionToken, const OutputDeviceInfo& outputDeviceInfo) override 99 { 100 return AVSESSION_SUCCESS; 101 } 102 StopCast(const SessionToken & sessionToken)103 int32_t StopCast(const SessionToken& sessionToken) override 104 { 105 return AVSESSION_SUCCESS; 106 } 107 #endif 108 private: 109 static inline BrokerDelegator<RemoteSessionCommandProcess> delegator_; 110 }; 111 } // namespace OHOS::AVSession 112 #endif // OHOS_REMOTE_SESSION_COMMAND_PROCESS_H