From d72a1ca3c57bc426012145e19d27fb62fb114dad Mon Sep 17 00:00:00 2001 From: Aryan Salmanpour Date: Wed, 8 Nov 2023 10:25:45 -0500 Subject: [PATCH] Add support to GetDecoderCaps to correctly return decoder caps for gfx arch names with a suffix (#43) [ROCm/rocdecode commit: 3a5fc3608bd08c61a0fd06adb61e169d47807c23] --- projects/rocdecode/src/rocdecode/roc_decoder_caps.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/projects/rocdecode/src/rocdecode/roc_decoder_caps.h b/projects/rocdecode/src/rocdecode/roc_decoder_caps.h index 26c17eb6c3..f831c8b513 100644 --- a/projects/rocdecode/src/rocdecode/roc_decoder_caps.h +++ b/projects/rocdecode/src/rocdecode/roc_decoder_caps.h @@ -25,6 +25,7 @@ THE SOFTWARE. #include #include #include +#include #include "../commons.h" #include "../../api/rocdecode.h" @@ -55,7 +56,9 @@ public: } rocDecStatus GetDecoderCaps(std::string gcn_arch_name, RocdecDecodeCaps *pdc) { std::lock_guard lock(mutex); - auto it = vcn_spec_table.find(gcn_arch_name); + std::size_t pos = gcn_arch_name.find_first_of(":"); + std::string gcn_arch_name_base = (pos != std::string::npos) ? gcn_arch_name.substr(0, pos) : gcn_arch_name; + auto it = vcn_spec_table.find(gcn_arch_name_base); if (it != vcn_spec_table.end()) { const VcnCodecsSpec& vcn_spec = it->second; auto it1 = vcn_spec.codecs_spec.find(pdc->eCodecType); @@ -84,7 +87,9 @@ public: } bool IsCodecConfigSupported(std::string gcn_arch_name, rocDecVideoCodec codec_type, rocDecVideoChromaFormat chroma_format, uint32_t bit_depth_minus8, rocDecVideoSurfaceFormat output_format) { std::lock_guard lock(mutex); - auto it = vcn_spec_table.find(gcn_arch_name); + std::size_t pos = gcn_arch_name.find_first_of(":"); + std::string gcn_arch_name_base = (pos != std::string::npos) ? gcn_arch_name.substr(0, pos) : gcn_arch_name; + auto it = vcn_spec_table.find(gcn_arch_name_base); if (it != vcn_spec_table.end()) { const VcnCodecsSpec& vcn_spec = it->second; auto it1 = vcn_spec.codecs_spec.find(codec_type);