From 79612de80319efbe613f6e160f110d9bbca1743c Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Tue, 10 Oct 2023 16:05:34 -0300 Subject: [PATCH] autoconvert: Force raw memory when using videoconvertscale videoconvertscale advertises `ANY` feature, but it supports it only in passthrough. Our goal with autoconvert is to ensure that conversion is possible with the elements that are being plugged so we avoid plugging `videoconvertscale` if the memory type is not system memory. Part-of: --- .../gst-plugins-bad/gst/autoconvert/gstautovideoconvert.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst/autoconvert/gstautovideoconvert.c b/subprojects/gst-plugins-bad/gst/autoconvert/gstautovideoconvert.c index 6bb8b489d7..cf5468316c 100644 --- a/subprojects/gst-plugins-bad/gst/autoconvert/gstautovideoconvert.c +++ b/subprojects/gst-plugins-bad/gst/autoconvert/gstautovideoconvert.c @@ -79,14 +79,14 @@ gst_auto_video_convert_init (GstAutoVideoConvert * autovideoconvert) .rank = GST_RANK_SECONDARY, }, { - .first_elements = { NULL, }, + .first_elements = { "capsfilter caps=\"video/x-raw\"", NULL, }, .colorspace_converters = { "videoconvertscale", NULL }, .last_elements = { "rgb2bayer", NULL }, .filters = { NULL }, .rank = GST_RANK_SECONDARY, }, { - .first_elements = { NULL, }, + .first_elements = { "capsfilter caps=\"video/x-raw\"", NULL, }, .colorspace_converters = { "videoconvertscale", NULL }, .last_elements = { NULL, }, .filters = { NULL }, @@ -107,7 +107,7 @@ gst_auto_video_convert_init (GstAutoVideoConvert * autovideoconvert) .rank = GST_RANK_PRIMARY, }, { - .first_elements = { "videoconvertscale", "glupload", NULL }, + .first_elements = { "capsfilter caps=\"video/x-raw\"", "videoconvertscale", "glupload", NULL }, .colorspace_converters = { NULL }, .last_elements = { NULL }, .filters = { NULL }, @@ -156,7 +156,7 @@ gst_auto_video_convert_init (GstAutoVideoConvert * autovideoconvert) .rank = GST_RANK_MARGINAL, }, { /* System memory to cuda */ - .first_elements = { NULL }, + .first_elements = { "capsfilter caps=\"video/x-raw\"", NULL }, .colorspace_converters = { "videoconvertscale", NULL }, .last_elements = { "cudaupload", "capsfilter caps=video/x-raw(memory:CUDAMemory)", NULL }, .filters = { NULL },