Merge pull request #8842 from Kelebek1/AudOut

[audio_core] Rework audio output
This commit is contained in:
bunnei 2022-09-10 11:01:11 -07:00 committed by GitHub
commit cd4b9bffb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 573 additions and 831 deletions

View file

@ -117,6 +117,7 @@ union Result {
BitField<0, 9, ErrorModule> module;
BitField<9, 13, u32> description;
Result() = default;
constexpr explicit Result(u32 raw_) : raw(raw_) {}
constexpr Result(ErrorModule module_, u32 description_)
@ -130,6 +131,7 @@ union Result {
return !IsSuccess();
}
};
static_assert(std::is_trivial_v<Result>);
[[nodiscard]] constexpr bool operator==(const Result& a, const Result& b) {
return a.raw == b.raw;

View file

@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "audio_core/audio_core.h"
#include "common/assert.h"
#include "common/logging/log.h"
#include "core/core.h"
@ -65,7 +66,10 @@ NvResult nvhost_nvdec::Ioctl3(DeviceFD fd, Ioctl command, const std::vector<u8>&
return NvResult::NotImplemented;
}
void nvhost_nvdec::OnOpen(DeviceFD fd) {}
void nvhost_nvdec::OnOpen(DeviceFD fd) {
LOG_INFO(Service_NVDRV, "NVDEC video stream started");
system.AudioCore().SetNVDECActive(true);
}
void nvhost_nvdec::OnClose(DeviceFD fd) {
LOG_INFO(Service_NVDRV, "NVDEC video stream ended");
@ -73,6 +77,7 @@ void nvhost_nvdec::OnClose(DeviceFD fd) {
if (iter != fd_to_id.end()) {
system.GPU().ClearCdmaInstance(iter->second);
}
system.AudioCore().SetNVDECActive(false);
}
} // namespace Service::Nvidia::Devices