diff options
author | Seungha Yang <seungha@centricular.com> | 2023-05-04 04:44:31 +0900 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2023-05-04 18:06:45 +0000 |
commit | ddcc5676d322d34989cca3b9b2403e4590d05b66 (patch) | |
tree | 72fe1e71f9eac876ff1a544859596643861cd63f /subprojects | |
parent | a79774be74426b47580eebc06c574e65f47033ca (diff) | |
download | gstreamer-ddcc5676d322d34989cca3b9b2403e4590d05b66.tar.gz |
mfvideoenc: Allow only even resolution numbers
Some H/W vendors support odd resolution if D3D11 texture is used
or via IMF2DBuffer, but not all vendors support it.
Also software MFT does not allow odd resolution.
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1165
Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2537
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4540>
Diffstat (limited to 'subprojects')
-rw-r--r-- | subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoencoder.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoencoder.cpp b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoencoder.cpp index 1c62740347..34e510ce26 100644 --- a/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoencoder.cpp +++ b/subprojects/gst-plugins-bad/sys/mediafoundation/gstmfvideoencoder.cpp @@ -1697,12 +1697,17 @@ gst_mf_video_encoder_enum_internal (GstMFTransform * transform, GUID & subtype, sink_caps = gst_caps_new_empty_simple ("video/x-raw"); /* FIXME: don't hardcode max resolution, but MF doesn't provide * API for querying supported max resolution... */ - gst_caps_set_simple (sink_caps, - "width", GST_TYPE_INT_RANGE, 64, 8192, - "height", GST_TYPE_INT_RANGE, 64, 8192, nullptr); - gst_caps_set_simple (src_caps, - "width", GST_TYPE_INT_RANGE, 64, 8192, - "height", GST_TYPE_INT_RANGE, 64, 8192, nullptr); + + GValue res_val = G_VALUE_INIT; + g_value_init (&res_val, GST_TYPE_INT_RANGE); + gst_value_set_int_range_step (&res_val, 64, 8192, 2); + + gst_caps_set_value (sink_caps, "width", &res_val); + gst_caps_set_value (sink_caps, "heigh", &res_val); + gst_caps_set_value (src_caps, "width", &res_val); + gst_caps_set_value (src_caps, "heigh", &res_val); + + g_value_unset (&res_val); #if GST_MF_HAVE_D3D11 /* Check whether this MFT can support D3D11 */ |