mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-30 04:00:37 +00:00
d3d12decoder: Fix SDK debug layer warning
Address below message reported by SDK debug layer. ID3D12Device::CheckFeatureSupport: Unsupported Decode Profile Specified. Use ID3D12VideoDevice::CheckFeatureSupport with D3D12_FEATURE_VIDEO_DECODE_PROFILES to retrieve a list of supported profiles Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6839>
This commit is contained in:
parent
07dceabdfc
commit
9d23c26027
1 changed files with 24 additions and 0 deletions
|
@ -2016,10 +2016,34 @@ gst_d3d12_decoder_check_feature_support (GstD3D12Device * device,
|
|||
g_return_val_if_fail (GST_IS_D3D12_DEVICE (device), nullptr);
|
||||
g_return_val_if_fail (video_device != nullptr, nullptr);
|
||||
|
||||
D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT profile_cnt = { };
|
||||
hr = video_device->CheckFeatureSupport
|
||||
(D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT, &profile_cnt,
|
||||
sizeof (profile_cnt));
|
||||
if (FAILED (hr) || profile_cnt.ProfileCount == 0) {
|
||||
GST_INFO_OBJECT (device, "device does not support decoding");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector < GUID > profile_guids;
|
||||
profile_guids.resize (profile_cnt.ProfileCount);
|
||||
D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES profiles_data = { };
|
||||
profiles_data.ProfileCount = profile_cnt.ProfileCount;
|
||||
profiles_data.pProfiles = profile_guids.data ();
|
||||
hr = video_device->CheckFeatureSupport (D3D12_FEATURE_VIDEO_DECODE_PROFILES,
|
||||
&profiles_data, sizeof (profiles_data));
|
||||
if (!gst_d3d12_result (hr, device))
|
||||
return nullptr;
|
||||
|
||||
for (guint i = 0; i < G_N_ELEMENTS (format_list); i++) {
|
||||
if (format_list[i].codec != codec)
|
||||
continue;
|
||||
|
||||
if (std::find (profile_guids.begin (), profile_guids.end (),
|
||||
format_list[i].decode_profile) == profile_guids.end ()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT s;
|
||||
s.NodeIndex = 0;
|
||||
s.Configuration.DecodeProfile = format_list[i].decode_profile;
|
||||
|
|
Loading…
Reference in a new issue