1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at: 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 #include "core-mock/StreamOutMock.h" 18 #include "core-mock/StreamCommonMock.h" 19 20 namespace aidl::android::hardware::audio::core { 21 getStreamCommon(std::shared_ptr<IStreamCommon> * _aidl_return)22ndk::ScopedAStatus StreamOutMock::getStreamCommon(std::shared_ptr<IStreamCommon>* _aidl_return) { 23 if (!mStreamCommon) { 24 mStreamCommon = ndk::SharedRefBase::make<StreamCommonMock>(); 25 } 26 *_aidl_return = mStreamCommon; 27 return ndk::ScopedAStatus::ok(); 28 } 29 getHwVolume(std::vector<float> * _aidl_return)30ndk::ScopedAStatus StreamOutMock::getHwVolume(std::vector<float>* _aidl_return) { 31 *_aidl_return = mHwVolume; 32 return ndk::ScopedAStatus::ok(); 33 } setHwVolume(const std::vector<float> & in_channelVolumes)34ndk::ScopedAStatus StreamOutMock::setHwVolume(const std::vector<float>& in_channelVolumes) { 35 mHwVolume = in_channelVolumes; 36 return ndk::ScopedAStatus::ok(); 37 } getAudioDescriptionMixLevel(float * _aidl_return)38ndk::ScopedAStatus StreamOutMock::getAudioDescriptionMixLevel(float* _aidl_return) { 39 *_aidl_return = mAudioDescriptionMixLeveldB; 40 return ndk::ScopedAStatus::ok(); 41 } setAudioDescriptionMixLevel(float in_leveldB)42ndk::ScopedAStatus StreamOutMock::setAudioDescriptionMixLevel(float in_leveldB) { 43 mAudioDescriptionMixLeveldB = in_leveldB; 44 return ndk::ScopedAStatus::ok(); 45 } getDualMonoMode(AudioDualMonoMode * _aidl_return)46ndk::ScopedAStatus StreamOutMock::getDualMonoMode(AudioDualMonoMode* _aidl_return) { 47 *_aidl_return = mDualMonoMode; 48 return ndk::ScopedAStatus::ok(); 49 } setDualMonoMode(AudioDualMonoMode in_mode)50ndk::ScopedAStatus StreamOutMock::setDualMonoMode(AudioDualMonoMode in_mode) { 51 mDualMonoMode = in_mode; 52 return ndk::ScopedAStatus::ok(); 53 } getPlaybackRateParameters(AudioPlaybackRate * _aidl_return)54ndk::ScopedAStatus StreamOutMock::getPlaybackRateParameters(AudioPlaybackRate* _aidl_return) { 55 *_aidl_return = mPlaybackRateParameters; 56 return ndk::ScopedAStatus::ok(); 57 } setPlaybackRateParameters(const AudioPlaybackRate & in_playbackRate)58ndk::ScopedAStatus StreamOutMock::setPlaybackRateParameters( 59 const AudioPlaybackRate& in_playbackRate) { 60 mPlaybackRateParameters = in_playbackRate; 61 return ndk::ScopedAStatus::ok(); 62 } 63 64 } // namespace aidl::android::hardware::audio::core 65