GNOME Bugzilla – Bug 796754
GESTimeline is not entirely compatible with GstPipeline
Last modified: 2018-11-03 12:54:19 UTC
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.
For now you can do (this is python): ``` from gi.repository import Gst Gst.init(None) from gi.repository import GES GES.init() track = GES.AudioTrack.new() for elem in track.iterate_elements(): if elem.get_factory().get_name() == "nlecomposition": print(elem) break ``` which prints: <__gi__.NleComposition object at 0x7f9bf8789678 (NleComposition at 0x555e87fe4260)> I agree we might want to proxy the signal, patch welcome :-)
I think that proxying the "query-position" signal through GESTimeline makes sense from a design perspective. But from the perspective of the person making this patch, it might be easiest to simply add the following method to the public header file (ges-track.h) ges_track_get_composition It is currently declared in ges-internal.h
(In reply to David Ing from comment #2) > I think that proxying the "query-position" signal through GESTimeline makes > sense from a design perspective. > > But from the perspective of the person making this patch, it might be > easiest to simply add the following method to the public header file > (ges-track.h) > > ges_track_get_composition > > It is currently declared in ges-internal.h Yeah and it is good enough fmpov, let's just do that.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-editing-services/issues/39.