[nvdec, android] proper detection and support for GPU decoder (#4068)

Detects Android MediaCodec FFmpeg decoders for H.264/VP8/VP9 when NVDEC GPU decoding is selected.
Required proper support of ffmpeg extradata, h264 frame dimensions and decoder frame handling.
Reenabled (uncommented) NVDEC Emulation selector on Android interface.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4068
This commit is contained in:
xbzk
2026-06-05 23:51:29 +02:00
committed by crueter
parent 52c6011d21
commit 01ea402bcf
9 changed files with 220 additions and 53 deletions
+10
View File
@@ -50,6 +50,16 @@ bool H264::IsInterlaced() {
current_context.h264_parameter_set.luma_bot_offset.Address() != 0;
}
std::optional<FFmpeg::FrameDimensions> H264::GetFrameDimensions() {
const auto& params = current_context.h264_parameter_set;
const s32 width = static_cast<s32>(params.pic_width_in_mbs) * 16;
const s32 height = static_cast<s32>(params.frame_height_in_mbs) * 16;
if (width <= 0 || height <= 0) {
return std::nullopt;
}
return FFmpeg::FrameDimensions{width, height};
}
std::span<const u8> H264::ComposeFrame() {
host1x.gmmu_manager.ReadBlock(regs.picture_info_offset.Address(), &current_context, sizeof(H264DecoderContext));
const s64 frame_number = current_context.h264_parameter_set.frame_number.Value();