From 75fcfdb12dce5835c8d2ed9317ede4a1420aabf0 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 6 Nov 2024 18:51:21 +1100 Subject: [PATCH] video-converter: Set TIME segment format on appsrc Combine the appsrc and appsink settings into one place and ensure that the appsrc will output a TIME segment, to avoid incorrect segment format criticals in some situations. The D3D11 path was already setting the segment format correctly. Part-of: --- .../gst-libs/gst/video/convertframe.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/convertframe.c b/subprojects/gst-plugins-base/gst-libs/gst/video/convertframe.c index 2ece4a632d..0494108ad7 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/convertframe.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/convertframe.c @@ -282,8 +282,11 @@ build_convert_frame_pipeline (GstElement ** src_element, if (dl) gst_bin_add (GST_BIN (pipeline), dl); - /* set caps */ - g_object_set (src, "caps", from_caps, NULL); + /* set input and output caps */ + g_object_set (src, "caps", from_caps, "emit-signals", TRUE, + "format", GST_FORMAT_TIME, NULL); + g_object_set (sink, "caps", to_caps, "emit-signals", TRUE, NULL); + if (vcrop) { gst_video_info_from_caps (&info, from_caps); g_object_set (vcrop, "left", cmeta->x, NULL); @@ -295,7 +298,6 @@ build_convert_frame_pipeline (GstElement ** src_element, GST_DEBUG ("crop meta [x,y,width,height]: %d %d %d %d", cmeta->x, cmeta->y, cmeta->width, cmeta->height); } - g_object_set (sink, "caps", to_caps, NULL); /* FIXME: linking is still way too expensive, profile this properly */ if (vcrop) { @@ -362,9 +364,6 @@ build_convert_frame_pipeline (GstElement ** src_element, goto link_failed; } - g_object_set (src, "emit-signals", TRUE, NULL); - g_object_set (sink, "emit-signals", TRUE, NULL); - *src_element = src; *sink_element = sink;