1 /* 2 * Copyright (c) 2022 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 CreateControllerInner(const std::string & sessionId,sptr<IRemoteObject> & object)46 int32_t CreateControllerInner(const std::string& sessionId, sptr<IRemoteObject>& object) override 47 { 48 return AVSESSION_SUCCESS; 49 } 50 RegisterSessionListener(const sptr<ISessionListener> & listener)51 int32_t RegisterSessionListener(const sptr<ISessionListener>& listener) override 52 { 53 return AVSESSION_SUCCESS; 54 } 55 SendSystemAVKeyEvent(const MMI::KeyEvent & keyEvent)56 int32_t SendSystemAVKeyEvent(const MMI::KeyEvent& keyEvent) override 57 { 58 return AVSESSION_SUCCESS; 59 } 60 SendSystemControlCommand(const AVControlCommand & command)61 int32_t SendSystemControlCommand(const AVControlCommand& command) override 62 { 63 return AVSESSION_SUCCESS; 64 } 65 RegisterClientDeathObserver(const sptr<IClientDeath> & observer)66 int32_t RegisterClientDeathObserver(const sptr<IClientDeath>& observer) override 67 { 68 return AVSESSION_SUCCESS; 69 } 70 CastAudio(const SessionToken & token,const std::vector<AudioStandard::AudioDeviceDescriptor> & descriptors)71 int32_t CastAudio(const SessionToken& token, 72 const std::vector<AudioStandard::AudioDeviceDescriptor>& descriptors) override 73 { 74 return AVSESSION_SUCCESS; 75 } 76 CastAudioForAll(const std::vector<AudioStandard::AudioDeviceDescriptor> & descriptors)77 int32_t CastAudioForAll(const std::vector<AudioStandard::AudioDeviceDescriptor>& descriptors) override 78 { 79 return AVSESSION_SUCCESS; 80 } 81 82 int32_t ProcessCastAudioCommand(const RemoteServiceCommand command, const std::string& input, 83 std::string& output) override; 84 85 private: 86 static inline BrokerDelegator<RemoteSessionCommandProcess> delegator_; 87 }; 88 } // namespace OHOS::AVSession 89 #endif // OHOS_REMOTE_SESSION_COMMAND_PROCESS_H