diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2024-02-23 17:34:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-23 17:34:21 +0100 |
commit | 215e887be088ed572da999e9ec7fd8559198524b (patch) | |
tree | 793415b72d36bb07d0174dfcf731f81235008936 /src/core/hle/service/audio/hardware_opus_decoder.h | |
parent | Merge pull request #13073 from FearlessTobi/fsp-srv-ipc (diff) | |
parent | oboe_sink: handle temporary stream creation failure (diff) | |
download | yuzu-215e887be088ed572da999e9ec7fd8559198524b.tar yuzu-215e887be088ed572da999e9ec7fd8559198524b.tar.gz yuzu-215e887be088ed572da999e9ec7fd8559198524b.tar.bz2 yuzu-215e887be088ed572da999e9ec7fd8559198524b.tar.lz yuzu-215e887be088ed572da999e9ec7fd8559198524b.tar.xz yuzu-215e887be088ed572da999e9ec7fd8559198524b.tar.zst yuzu-215e887be088ed572da999e9ec7fd8559198524b.zip |
Diffstat (limited to 'src/core/hle/service/audio/hardware_opus_decoder.h')
-rw-r--r-- | src/core/hle/service/audio/hardware_opus_decoder.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/core/hle/service/audio/hardware_opus_decoder.h b/src/core/hle/service/audio/hardware_opus_decoder.h new file mode 100644 index 000000000..511bf46bd --- /dev/null +++ b/src/core/hle/service/audio/hardware_opus_decoder.h @@ -0,0 +1,63 @@ +// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include "audio_core/opus/decoder.h" +#include "core/hle/service/cmif_types.h" +#include "core/hle/service/service.h" + +namespace Service::Audio { + +class IHardwareOpusDecoder final : public ServiceFramework<IHardwareOpusDecoder> { +public: + explicit IHardwareOpusDecoder(Core::System& system_, + AudioCore::OpusDecoder::HardwareOpus& hardware_opus); + ~IHardwareOpusDecoder() override; + + Result Initialize(const AudioCore::OpusDecoder::OpusParametersEx& params, + Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size); + Result Initialize(const AudioCore::OpusDecoder::OpusMultiStreamParametersEx& params, + Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size); + +private: + Result DecodeInterleavedOld(OutBuffer<BufferAttr_HipcMapAlias> out_pcm_data, + Out<u32> out_data_size, Out<u32> out_sample_count, + InBuffer<BufferAttr_HipcMapAlias> opus_data); + Result SetContext(InBuffer<BufferAttr_HipcMapAlias> decoder_context); + Result DecodeInterleavedForMultiStreamOld(OutBuffer<BufferAttr_HipcMapAlias> out_pcm_data, + Out<u32> out_data_size, Out<u32> out_sample_count, + InBuffer<BufferAttr_HipcMapAlias> opus_data); + Result SetContextForMultiStream(InBuffer<BufferAttr_HipcMapAlias> decoder_context); + Result DecodeInterleavedWithPerfOld( + OutBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> out_pcm_data, + Out<u32> out_data_size, Out<u32> out_sample_count, Out<u64> out_time_taken, + InBuffer<BufferAttr_HipcMapAlias> opus_data); + Result DecodeInterleavedForMultiStreamWithPerfOld( + OutBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> out_pcm_data, + Out<u32> out_data_size, Out<u32> out_sample_count, Out<u64> out_time_taken, + InBuffer<BufferAttr_HipcMapAlias> opus_data); + Result DecodeInterleavedWithPerfAndResetOld( + OutBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> out_pcm_data, + Out<u32> out_data_size, Out<u32> out_sample_count, Out<u64> out_time_taken, + InBuffer<BufferAttr_HipcMapAlias> opus_data, bool reset); + Result DecodeInterleavedForMultiStreamWithPerfAndResetOld( + OutBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> out_pcm_data, + Out<u32> out_data_size, Out<u32> out_sample_count, Out<u64> out_time_taken, + InBuffer<BufferAttr_HipcMapAlias> opus_data, bool reset); + Result DecodeInterleaved( + OutBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> out_pcm_data, + Out<u32> out_data_size, Out<u32> out_sample_count, Out<u64> out_time_taken, + InBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> opus_data, + bool reset); + Result DecodeInterleavedForMultiStream( + OutBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> out_pcm_data, + Out<u32> out_data_size, Out<u32> out_sample_count, Out<u64> out_time_taken, + InBuffer<BufferAttr_HipcMapAlias | BufferAttr_HipcMapTransferAllowsNonSecure> opus_data, + bool reset); + + std::unique_ptr<AudioCore::OpusDecoder::OpusDecoder> impl; + Common::ScratchBuffer<u8> output_data; +}; + +} // namespace Service::Audio |