From 9becc1fe7ebe1cc9934805c7c025bfadfb4324a4 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Thu, 15 Jul 2021 16:44:18 +0900 Subject: [PATCH] mfvideoenc: Disable RGB format support Some GPUs support BGRA format and it will be converted to subsampled YUV format by GPU internally. Disable this implicit conversion since the conversion parameters such as input/output colorimetry are not exposed nor it's written in bitstream (e.g., VUI). We prefer explicit conversion via our conversion elements. Part-of: --- sys/mediafoundation/gstmfvideoenc.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/mediafoundation/gstmfvideoenc.cpp b/sys/mediafoundation/gstmfvideoenc.cpp index c3a7e7912b..f03edfb43c 100644 --- a/sys/mediafoundation/gstmfvideoenc.cpp +++ b/sys/mediafoundation/gstmfvideoenc.cpp @@ -1528,12 +1528,20 @@ gst_mf_video_enc_enum_internal (GstMFTransform * transform, GUID & subtype, for (i = 0; i < info_size / sizeof (MFT_REGISTER_TYPE_INFO); i++) { GstVideoFormat format; + const GstVideoFormatInfo *format_info; GValue val = G_VALUE_INIT; format = gst_mf_video_subtype_to_video_format (&infos[i].guidSubtype); if (format == GST_VIDEO_FORMAT_UNKNOWN) continue; + format_info = gst_video_format_get_info (format); + if (GST_VIDEO_FORMAT_INFO_IS_RGB (format_info)) { + GST_DEBUG_OBJECT (transform, "Skip %s format", + GST_VIDEO_FORMAT_INFO_NAME (format_info)); + continue; + } + if (!supported_formats) { supported_formats = g_new0 (GValue, 1); g_value_init (supported_formats, GST_TYPE_LIST);