mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 22:15:46 +00:00
Improve detection for hardware capabilities
This commit is contained in:
parent
9dfe3cece0
commit
5a7cc28dbc
1 changed files with 15 additions and 12 deletions
|
@ -113,19 +113,22 @@ Decoder::Decoder(Tegra::Host1x::NvdecCommon::VideoCodec codec) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Decoder::SupportsDecodingOnDevice(AVPixelFormat* out_pix_fmt, AVHWDeviceType type) const {
|
bool Decoder::SupportsDecodingOnDevice(AVPixelFormat* out_pix_fmt, AVHWDeviceType type) const {
|
||||||
for (int i = 0;; i++) {
|
AVCodec *decoder = avcodec_find_decoder(m_codec);
|
||||||
const AVCodecHWConfig* config = avcodec_get_hw_config(m_codec, i);
|
if (decoder) {
|
||||||
if (!config) {
|
for (int i = 0;; i++) {
|
||||||
LOG_DEBUG(HW_GPU, "{} decoder does not support device type {}", m_codec->name, av_hwdevice_get_type_name(type));
|
const AVCodecHWConfig* config = avcodec_get_hw_config(m_codec, i);
|
||||||
break;
|
if (!config) {
|
||||||
}
|
LOG_DEBUG(HW_GPU, "{} decoder does not support device type {}", m_codec->name, av_hwdevice_get_type_name(type));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX && config->device_type == type) {
|
if (config->methods & AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX && config->device_type == type) {
|
||||||
LOG_INFO(HW_GPU, "Using {} GPU decoder", av_hwdevice_get_type_name(type));
|
LOG_INFO(HW_GPU, "Using {} GPU decoder", av_hwdevice_get_type_name(type));
|
||||||
*out_pix_fmt = config->pix_fmt;
|
*out_pix_fmt = config->pix_fmt;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue