d3d12encoder: Do not print error log for not-supported feature

gst_d3d12_result() will print message with ERROR level if failed.
Use FAILED/SUCCEEDED macros instead, since not-supported feature
is not a critical error

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6955>
This commit is contained in:
Seungha Yang 2024-05-29 18:54:18 +09:00 committed by GStreamer Marge Bot
parent ec11bb8253
commit 96cf3d7063

View file

@ -2165,7 +2165,7 @@ gst_d3d12_h264_enc_register (GstPlugin * plugin, GstD3D12Device * device,
hr = video_device->CheckFeatureSupport (D3D12_FEATURE_VIDEO_ENCODER_CODEC, hr = video_device->CheckFeatureSupport (D3D12_FEATURE_VIDEO_ENCODER_CODEC,
&feature_codec, sizeof (feature_codec)); &feature_codec, sizeof (feature_codec));
if (!gst_d3d12_result (hr, device) || !feature_codec.IsSupported) { if (FAILED (hr) || !feature_codec.IsSupported) {
GST_INFO_OBJECT (device, "Device does not support H.264 encoding"); GST_INFO_OBJECT (device, "Device does not support H.264 encoding");
return; return;
} }
@ -2191,7 +2191,7 @@ gst_d3d12_h264_enc_register (GstPlugin * plugin, GstD3D12Device * device,
hr = video_device->CheckFeatureSupport hr = video_device->CheckFeatureSupport
(D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL, &feature_profile_level, (D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL, &feature_profile_level,
sizeof (feature_profile_level)); sizeof (feature_profile_level));
if (!gst_d3d12_result (hr, device) || !feature_profile_level.IsSupported) { if (FAILED (hr) || !feature_profile_level.IsSupported) {
GST_WARNING_OBJECT (device, "Main profile is not supported"); GST_WARNING_OBJECT (device, "Main profile is not supported");
return; return;
} }
@ -2200,7 +2200,7 @@ gst_d3d12_h264_enc_register (GstPlugin * plugin, GstD3D12Device * device,
hr = video_device->CheckFeatureSupport hr = video_device->CheckFeatureSupport
(D3D12_FEATURE_VIDEO_ENCODER_INPUT_FORMAT, &feature_input_format, (D3D12_FEATURE_VIDEO_ENCODER_INPUT_FORMAT, &feature_input_format,
sizeof (feature_input_format)); sizeof (feature_input_format));
if (!gst_d3d12_result (hr, device) || !feature_input_format.IsSupported) { if (FAILED (hr) || !feature_input_format.IsSupported) {
GST_WARNING_OBJECT (device, "NV12 format is not supported"); GST_WARNING_OBJECT (device, "NV12 format is not supported");
return; return;
} }
@ -2214,7 +2214,7 @@ gst_d3d12_h264_enc_register (GstPlugin * plugin, GstD3D12Device * device,
hr = video_device->CheckFeatureSupport hr = video_device->CheckFeatureSupport
(D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL, &feature_profile_level, (D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL, &feature_profile_level,
sizeof (feature_profile_level)); sizeof (feature_profile_level));
if (gst_d3d12_result (hr, device) && feature_profile_level.IsSupported) { if (SUCCEEDED (hr) && feature_profile_level.IsSupported) {
profiles.push_back ("high"); profiles.push_back ("high");
GST_INFO_OBJECT (device, "High profile is supported, level [%d, %d]", GST_INFO_OBJECT (device, "High profile is supported, level [%d, %d]",
level_h264_min, level_h264_max); level_h264_min, level_h264_max);
@ -2231,7 +2231,7 @@ gst_d3d12_h264_enc_register (GstPlugin * plugin, GstD3D12Device * device,
hr = video_device->CheckFeatureSupport hr = video_device->CheckFeatureSupport
(D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT, (D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT,
&ratios_count, sizeof (ratios_count)); &ratios_count, sizeof (ratios_count));
if (!gst_d3d12_result (hr, device)) { if (FAILED (hr)) {
GST_WARNING_OBJECT (device, GST_WARNING_OBJECT (device,
"Couldn't query output resolution ratios count"); "Couldn't query output resolution ratios count");
return; return;
@ -2250,7 +2250,7 @@ gst_d3d12_h264_enc_register (GstPlugin * plugin, GstD3D12Device * device,
hr = video_device->CheckFeatureSupport hr = video_device->CheckFeatureSupport
(D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION, &feature_resolution, (D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION, &feature_resolution,
sizeof (feature_resolution)); sizeof (feature_resolution));
if (!gst_d3d12_result (hr, device) || !feature_resolution.IsSupported) { if (FAILED (hr) || !feature_resolution.IsSupported) {
GST_WARNING_OBJECT (device, "Couldn't query output resolution"); GST_WARNING_OBJECT (device, "Couldn't query output resolution");
return; return;
} }
@ -2377,7 +2377,7 @@ gst_d3d12_h264_enc_register (GstPlugin * plugin, GstD3D12Device * device,
hr = video_device->CheckFeatureSupport hr = video_device->CheckFeatureSupport
(D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT, (D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT,
&feature_pic_ctrl, sizeof (feature_pic_ctrl)); &feature_pic_ctrl, sizeof (feature_pic_ctrl));
if (!gst_d3d12_result (hr, device) || !feature_pic_ctrl.IsSupported) { if (FAILED (hr) || !feature_pic_ctrl.IsSupported) {
GST_WARNING_OBJECT (device, "Couldn't query picture control support"); GST_WARNING_OBJECT (device, "Couldn't query picture control support");
return; return;
} }