summaryrefslogtreecommitdiff
path: root/sys/mediafoundation
diff options
context:
space:
mode:
authorSeungha Yang <seungha@centricular.com>2021-07-15 16:44:18 +0900
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-07-15 16:50:26 +0000
commit9becc1fe7ebe1cc9934805c7c025bfadfb4324a4 (patch)
tree00445a74f4acf9c082e49a28a73015dd1825264d /sys/mediafoundation
parent67d482f8fbdffc97d36d9e747e93dc3571965f2f (diff)
downloadgstreamer-plugins-bad-9becc1fe7ebe1cc9934805c7c025bfadfb4324a4.tar.gz
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: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2410>
Diffstat (limited to 'sys/mediafoundation')
-rw-r--r--sys/mediafoundation/gstmfvideoenc.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/mediafoundation/gstmfvideoenc.cpp b/sys/mediafoundation/gstmfvideoenc.cpp
index c3a7e7912..f03edfb43 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);