GESTimeline is not entirely compatible with GstPipeline
@ding
Submitted by David Ing Link to original bug (#796754)
Description
The GESTimeline wraps NleComposition elements which requires a "query-position" signal to the pipeline (as described below). Unfortunately, the signal cannot be made connected using only the public header API which is provided as part of the Gstreamer distro.
Here is an example of the connection that needs to be made. Notice that below I am using the private
bits of GESTrack which is bad practice. (I had to pull in the definition of _GESTrackPrivate to make this compile.)
// It is necessary to connect the "query-position" signal to each track
g_signal_connect(
gesTrack->priv->composition, // (GESTrack*)->priv->composition, where the GESTrack is part of my GESTimeline
"query-position",
G_CALLBACK(cbQueryPosition), // my callback method
gstPipeline); // The GstPipeline* which contains GESTimeline
// My callback method
gint64 cbQueryPosition(GstElement* nleComposition, GstPipeline* gstPipeline)
{
gint64 position;
if (gst_element_query_position(reinterpret_cast<GstElement*>(gstPipeline), GST_FORMAT_TIME, &position))
{
return position;
}
return GST_CLOCK_TIME_NONE;
}
Another approach suggested by Thibault is to search the GESTrack using gst_bin_iterate_elements
to find the NleComposition element. Unfortunately, that is not possible either without including "nle.h" which is not provided in the gstreamer distro. Without "nle.h" I don't have the GType of the element that I am searching for (which is NLE_TYPE_COMPOSITION).
Here is the relevant email thread with Thibault Saunier: https://lists.freedesktop.org/archives/gstreamer-devel/2018-July/068441.html
One way to fix the problem is to give GESTimeline a "query-position" signal, and it would mediate the flow of information between the GstPipeline and all elements of type NleComposition.
Version: 1.12.x