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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7839>
This commit is contained in:
Jan Schmidt 2024-11-06 18:51:21 +11:00
parent 1e2d488e97
commit 75fcfdb12d

View file

@ -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;