From c92e15020764cb1232572b264ed9033dda38efdd Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sun, 28 Jul 2024 02:01:24 +0900 Subject: [PATCH] qsv: Fix critical warnings Fixing warnings GStreamer-CRITICAL **: 01:21:25.862: gst_value_set_int_range_step: assertion 'start < end' failed Although when QSV runtime reports a codec is supported, resolution query fails sometimes, espeically VP9 encoder case on Windows. Don't try to register an element if resolution query returned an error Part-of: --- subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp | 3 +++ subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp | 3 +++ subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp | 3 +++ subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp | 3 +++ subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp | 3 +++ 5 files changed, 15 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp index 833e2694e4..659ef82ca9 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvav1enc.cpp @@ -703,6 +703,9 @@ gst_qsv_av1_enc_register (GstPlugin * plugin, guint rank, guint impl_index, max_resolution.height = gst_qsv_resolutions[i].height; } + if (max_resolution.width == 0 || max_resolution.height == 0) + return; + GST_INFO ("Maximum supported resolution: %dx%d", max_resolution.width, max_resolution.height); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp index 7f558ff25b..54bd114b21 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh264enc.cpp @@ -2174,6 +2174,9 @@ gst_qsv_h264_enc_register (GstPlugin * plugin, guint rank, guint impl_index, max_resolution.height = gst_qsv_resolutions[i].height; } + if (max_resolution.width == 0 || max_resolution.height == 0) + return; + GST_INFO ("Maximum supported resolution: %dx%d", max_resolution.width, max_resolution.height); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp index ea4c734668..ddd2195b57 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvh265enc.cpp @@ -1532,6 +1532,9 @@ gst_qsv_h265_enc_register (GstPlugin * plugin, guint rank, guint impl_index, max_resolution.height = gst_qsv_resolutions[i].height; } + if (max_resolution.width == 0 || max_resolution.height == 0) + return; + GST_INFO ("Maximum supported resolution: %dx%d", max_resolution.width, max_resolution.height); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp index 4cf4c36453..d9ea61cbca 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvjpegenc.cpp @@ -439,6 +439,9 @@ gst_qsv_jpeg_enc_register (GstPlugin * plugin, guint rank, guint impl_index, max_resolution.height = gst_qsv_resolutions[i].height; } + if (max_resolution.width == 0 || max_resolution.height == 0) + return; + GST_INFO ("Maximum supported resolution: %dx%d", max_resolution.width, max_resolution.height); diff --git a/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp b/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp index 7e2d3d07a9..14f6040397 100644 --- a/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp +++ b/subprojects/gst-plugins-bad/sys/qsv/gstqsvvp9enc.cpp @@ -922,6 +922,9 @@ gst_qsv_vp9_enc_register (GstPlugin * plugin, guint rank, guint impl_index, max_resolution.height = gst_qsv_resolutions[i].height; } + if (max_resolution.width == 0 || max_resolution.height == 0) + return; + GST_INFO ("Maximum supported resolution: %dx%d", max_resolution.width, max_resolution.height);