// Copyright (C) 2020 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #pragma once // clang-format off #include PATH(android/hardware/audio/FILE_VERSION/IStreamOut.h) // clang-format on #include namespace audio_proxy { namespace service { using ::android::sp; using ::android::hardware::hidl_bitfield; using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::audio::common::CPP_VERSION::AudioChannelMask; using ::android::hardware::audio::common::CPP_VERSION::AudioConfig; using ::android::hardware::audio::common::CPP_VERSION::AudioFormat; using ::android::hardware::audio::common::CPP_VERSION::DeviceAddress; using ::android::hardware::audio::common::CPP_VERSION::SourceMetadata; using ::android::hardware::audio::CPP_VERSION::AudioDrain; using ::android::hardware::audio::CPP_VERSION::IStreamOut; using ::android::hardware::audio::CPP_VERSION::IStreamOutCallback; using ::android::hardware::audio::CPP_VERSION::ParameterValue; using ::android::hardware::audio::CPP_VERSION::Result; class DummyOutputStream : public IStreamOut { public: DummyOutputStream(const AudioConfig &config); private: Return getBufferSize() override; Return getFrameCount() override; Return getSupportedSampleRates(AudioFormat, getSupportedSampleRates_cb _hidl_cb) override; Return getSampleRate() override; Return getSupportedChannelMasks(AudioFormat, getSupportedChannelMasks_cb _hidl_cb) override; Return> getChannelMask() override; Return getSupportedFormats(getSupportedFormats_cb _hidl_cb) override; Return getFormat() override; Return getLatency() override; Return standby() override; Return pause() override; Return resume() override; Return drain(AudioDrain) override; Return prepareForWriting(uint32_t frameSize, uint32_t framesCount, prepareForWriting_cb _hidl_cb) override; Return setParameters(const hidl_vec &context, const hidl_vec ¶meters) override; Return getParameters(const hidl_vec &context, const hidl_vec &keys, getParameters_cb _hidl_cb) override; Return getFrameSize() override; Return setSampleRate(uint32_t) override; Return setChannelMask(hidl_bitfield) override; Return setFormat(AudioFormat) override; Return getAudioProperties(getAudioProperties_cb _hidl_cb) override; Return addEffect(uint64_t) override; Return removeEffect(uint64_t) override; Return getDevices(getDevices_cb _hidl_cb) override; Return setDevices(const hidl_vec &) override; Return setHwAvSync(uint32_t hwAvSync) override; Return start() override; Return stop() override; Return createMmapBuffer(int32_t minSizeFrames, createMmapBuffer_cb _hidl_cb) override; Return getMmapPosition(getMmapPosition_cb _hidl_cb) override; Return close() override; Return setVolume(float left, float right) override; Return updateSourceMetadata(const SourceMetadata &) override; Return getRenderPosition(getRenderPosition_cb _hidl_cb) override; Return getNextWriteTimestamp(getNextWriteTimestamp_cb _hidl_cb) override; Return setCallback(const sp &) override; Return clearCallback() override; Return supportsPauseAndResume(supportsPauseAndResume_cb _hidl_cb) override; Return supportsDrain() override; Return flush() override; Return getPresentationPosition(getPresentationPosition_cb _hidl_cb) override; Return selectPresentation(int32_t, int32_t) override; private: const hidl_bitfield mChannelMask; const AudioFormat mFormat; const uint32_t mSampleRate; }; } // namespace service } // namespace audio_proxy