mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 02:15:31 +00:00
nle: Handle sending SEEK event recursively to our children
Instead of relying on it being implemented in core (as it is currently not!)
This commit is contained in:
parent
d3d1f85373
commit
79230eef1f
6 changed files with 46 additions and 3 deletions
|
@ -1433,7 +1433,7 @@ _seek_current_stack (NleComposition * comp, GstEvent * event,
|
|||
|
||||
if (flush_downstream) {
|
||||
priv->flush_seqnum = gst_event_get_seqnum (event);
|
||||
GST_ERROR_OBJECT (comp, "sending flushes downstream with seqnum %d",
|
||||
GST_INFO_OBJECT (comp, "sending flushes downstream with seqnum %d",
|
||||
priv->flush_seqnum);
|
||||
}
|
||||
|
||||
|
|
|
@ -642,6 +642,27 @@ nle_object_commit (NleObject * object, gboolean recurse)
|
|||
|
||||
}
|
||||
|
||||
static void
|
||||
_send_seek_event (const GValue * item, gpointer seek_event)
|
||||
{
|
||||
GstElement *child = g_value_get_object (item);
|
||||
|
||||
gst_element_send_event (child, gst_event_ref (seek_event));
|
||||
}
|
||||
|
||||
void
|
||||
nle_object_seek_all_children (NleObject * object, GstEvent * seek_event)
|
||||
{
|
||||
GstIterator *it = gst_bin_iterate_recurse (GST_BIN (object));
|
||||
|
||||
while (gst_iterator_foreach (it, _send_seek_event,
|
||||
seek_event) == GST_ITERATOR_RESYNC)
|
||||
gst_iterator_resync (it);
|
||||
|
||||
gst_iterator_free (it);
|
||||
gst_event_unref (seek_event);
|
||||
}
|
||||
|
||||
void
|
||||
nle_object_reset (NleObject * object)
|
||||
{
|
||||
|
|
|
@ -166,5 +166,7 @@ nle_object_reset (NleObject *object);
|
|||
GstStateChangeReturn
|
||||
nle_object_cleanup (NleObject * object);
|
||||
|
||||
void nle_object_seek_all_children (NleObject *object, GstEvent *seek_event);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* __NLE_OBJECT_H__ */
|
||||
|
|
|
@ -93,6 +93,24 @@ static void nle_operation_release_pad (GstElement * element, GstPad * pad);
|
|||
static void synchronize_sinks (NleOperation * operation);
|
||||
static gboolean remove_sink_pad (NleOperation * operation, GstPad * sinkpad);
|
||||
|
||||
|
||||
static gboolean
|
||||
nle_operation_send_event (GstElement * element, GstEvent * event)
|
||||
{
|
||||
gboolean res = TRUE;
|
||||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEEK:
|
||||
nle_object_seek_all_children (NLE_OBJECT (element), event);
|
||||
break;
|
||||
default:
|
||||
res = GST_ELEMENT_CLASS (parent_class)->send_event (element, event);
|
||||
break;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
nle_operation_class_init (NleOperationClass * klass)
|
||||
{
|
||||
|
@ -141,6 +159,7 @@ nle_operation_class_init (NleOperationClass * klass)
|
|||
gstelement_class->request_new_pad =
|
||||
GST_DEBUG_FUNCPTR (nle_operation_request_new_pad);
|
||||
gstelement_class->release_pad = GST_DEBUG_FUNCPTR (nle_operation_release_pad);
|
||||
gstelement_class->send_event = GST_DEBUG_FUNCPTR (nle_operation_send_event);
|
||||
|
||||
gstbin_class->add_element = GST_DEBUG_FUNCPTR (nle_operation_add_element);
|
||||
gstbin_class->remove_element =
|
||||
|
|
|
@ -406,7 +406,6 @@ nle_source_send_event (GstElement * element, GstEvent * event)
|
|||
|
||||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEEK:
|
||||
GST_ERROR ("saving seek now");
|
||||
source->priv->seek_event = event;
|
||||
break;
|
||||
/* Fall through that shit nigga */
|
||||
|
|
|
@ -44,10 +44,12 @@ check_PROGRAMS = \
|
|||
ges/project\
|
||||
nle/simple \
|
||||
nle/complex \
|
||||
nle/nlesource \
|
||||
nle/nleoperation \
|
||||
nle/nlecomposition
|
||||
|
||||
# We do not support sources outside composition
|
||||
# nle/nlesource
|
||||
|
||||
noinst_LTLIBRARIES=$(testutils_noisnt_libraries)
|
||||
noinst_HEADERS=$(testutils_noinst_headers)
|
||||
|
||||
|
|
Loading…
Reference in a new issue