ges-pipeline: Configure encodebin before linking

Modifying the `avoid-reencoding` property of `encodebin` could potentially cause
it to reconfigure itself, in which case the source pad will be removed and then
re-added.

Therefore set that property *before* attempting to link to that pad.

Fixes smart-render

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6757>
This commit is contained in:
Edward Hervey 2024-04-17 10:23:29 +02:00 committed by GStreamer Marge Bot
parent 0c81d1a1e7
commit dd3344fd2e

View file

@ -1270,6 +1270,8 @@ ges_pipeline_set_mode (GESPipeline * pipeline, GESPipelineFlags mode)
return FALSE;
}
g_object_set (pipeline->priv->encodebin, "avoid-reencoding",
!(!(mode & GES_PIPELINE_MODE_SMART_RENDER)), NULL);
if (!gst_bin_add (GST_BIN_CAST (pipeline), pipeline->priv->encodebin)) {
GST_ERROR_OBJECT (pipeline, "Couldn't add encodebin");
return FALSE;
@ -1294,8 +1296,6 @@ ges_pipeline_set_mode (GESPipeline * pipeline, GESPipelineFlags mode)
GST_INFO_OBJECT (pipeline,
"Using an muxing sink, not adding any sink element");
}
g_object_set (pipeline->priv->encodebin, "avoid-reencoding",
!(!(mode & GES_PIPELINE_MODE_SMART_RENDER)), NULL);
}
if (pipeline->priv->timeline) {