• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 SLE_AUDIO_OPERATION_CALLBACK_STUB_H
17 #define SLE_AUDIO_OPERATION_CALLBACK_STUB_H
18 
19 #include "audio_policy_interface.h"
20 #include "standard_sle_audio_operation_callback_stub.h"
21 
22 namespace OHOS {
23 namespace AudioStandard {
24 class SleAudioOperationCallbackStubImpl : public StandardSleAudioOperationCallbackStub {
25 public:
26     SleAudioOperationCallbackStubImpl();
27     virtual ~SleAudioOperationCallbackStubImpl();
28 
29     int32_t SetSleAudioOperationCallback(const std::weak_ptr<SleAudioOperationCallback> &callback);
30 
31     int32_t GetSleAudioDeviceList(std::vector<AudioDeviceDescriptor> &devices) override;
32     int32_t GetSleVirtualAudioDeviceList(std::vector<AudioDeviceDescriptor> &devices) override;
33     int32_t IsInBandRingOpen(const std::string &device, bool& ret) override;
34     int32_t GetSupportStreamType(const std::string &device, uint32_t& retType) override;
35     int32_t SetActiveSinkDevice(const std::string &device, uint32_t streamType, int32_t& ret) override;
36     int32_t StartPlaying(const std::string &device, uint32_t streamType, int32_t& ret) override;
37     int32_t StopPlaying(const std::string &device, uint32_t streamType, int32_t& ret) override;
38     int32_t ConnectAllowedProfiles(const std::string &remoteAddr, int32_t& ret) override;
39     int32_t SetDeviceAbsVolume(const std::string &remoteAddr, uint32_t volume, uint32_t streamType,
40         int32_t& ret) override;
41     int32_t SendUserSelection(const std::string &device, uint32_t streamType, int32_t& ret) override;
42     int32_t GetRenderPosition(const std::string &device, uint32_t &delayValue) override;
43 private:
44     std::mutex sleAudioOperationCallbackMutex_;
45     std::weak_ptr<SleAudioOperationCallback> sleAudioOperationCallback_;
46 };
47 } // namespace AudioStandard
48 } // namespace OHOS
49 #endif // SLE_AUDIO_OPERATION_CALLBACK_STUB_H
50