This repository has been archived on 2024-03-23. You can view files and clone it, but cannot push or open issues or pull requests.
2018-12-09 21:25:45 +00:00
|
|
|
// Copyright 2018 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include "audio_core/hle/decoder.h"
|
|
|
|
|
|
|
|
namespace AudioCore::HLE {
|
|
|
|
|
2018-12-16 14:03:23 +00:00
|
|
|
DecoderBase::~DecoderBase(){};
|
|
|
|
|
|
|
|
NullDecoder::NullDecoder() = default;
|
2018-12-09 21:25:45 +00:00
|
|
|
|
|
|
|
NullDecoder::~NullDecoder() = default;
|
|
|
|
|
|
|
|
std::optional<BinaryResponse> NullDecoder::ProcessRequest(const BinaryRequest& request) {
|
|
|
|
BinaryResponse response;
|
|
|
|
switch (request.cmd) {
|
|
|
|
case DecoderCommand::Init:
|
|
|
|
case DecoderCommand::Unknown:
|
|
|
|
std::memcpy(&response, &request, sizeof(response));
|
|
|
|
response.unknown1 = 0x0;
|
|
|
|
return response;
|
|
|
|
case DecoderCommand::Decode:
|
|
|
|
response.codec = request.codec;
|
|
|
|
response.cmd = DecoderCommand::Decode;
|
|
|
|
response.num_channels = 2; // Just assume stereo here
|
|
|
|
response.size = request.size;
|
|
|
|
response.num_samples = 1024; // Just assume 1024 here
|
|
|
|
return response;
|
|
|
|
default:
|
|
|
|
LOG_ERROR(Audio_DSP, "Got unknown binary request: {}", static_cast<u16>(request.cmd));
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} // namespace AudioCore::HLE
|