#define DEFAULT_TIMELINE_MODE TIMELINE_MODE_PREVIEW
-/* lock to protect dynamic callbacks, like pad-added or nmp */
-#define DYN_LOCK(pipeline) (&GES_TIMELINE_PIPELINE (pipeline)->priv->dyn_mutex)
-#define LOCK_DYN(pipeline) G_STMT_START { \
- GST_INFO_OBJECT (pipeline, "Getting dynamic lock from %p", \
- g_thread_self()); \
- g_mutex_lock (DYN_LOCK (pipeline)); \
- GST_INFO_OBJECT (pipeline, "Got Dynamic lock from %p", \
- g_thread_self()); \
- } G_STMT_END
-
-#define UNLOCK_DYN(pipeline) G_STMT_START { \
- GST_INFO_OBJECT (pipeline, "Unlocking dynamic lock from %p", \
- g_thread_self()); \
- g_mutex_unlock (DYN_LOCK (pipeline)); \
- GST_INFO_OBJECT (pipeline, "Unlocked Dynamic lock from %p", \
- g_thread_self()); \
- } G_STMT_END
-
/* Structure corresponding to a timeline - sink link */
typedef struct
return chain;
}
-/* Should be called with LOCK_DYN */
static OutputChain *
get_output_chain_for_track (GESPipeline * self, GESTrack * track)
{
GstCaps *caps;
gboolean reconfigured = FALSE;
- LOCK_DYN (self);
caps = gst_pad_query_caps (pad, NULL);
GST_DEBUG_OBJECT (self, "new pad %s:%s , caps:%" GST_PTR_FORMAT,
if (G_UNLIKELY (!track)) {
GST_WARNING_OBJECT (self, "Couldn't find coresponding track !");
- UNLOCK_DYN (self);
return;
}
if (!get_output_chain_for_track (self, track))
self->priv->chains = g_list_append (self->priv->chains, chain);
- UNLOCK_DYN (self);
GST_DEBUG ("done");
return;
if (sinkpad)
gst_object_unref (sinkpad);
g_free (chain);
- UNLOCK_DYN (self);
}
}
GESTrack *track;
GstPad *peer;
- LOCK_DYN (self);
GST_DEBUG_OBJECT (self, "pad removed %s:%s", GST_DEBUG_PAD_NAME (pad));
if (G_UNLIKELY (!(track =
ges_timeline_get_track_for_pad (self->priv->timeline, pad)))) {
GST_WARNING_OBJECT (self, "Couldn't find coresponding track !");
- UNLOCK_DYN (self);
return;
}
if (G_UNLIKELY (!(chain = get_output_chain_for_track (self, track)))) {
GST_DEBUG_OBJECT (self, "Pad wasn't used");
- UNLOCK_DYN (self);
return;
}
self->priv->chains = g_list_remove (self->priv->chains, chain);
g_free (chain);
- UNLOCK_DYN (self);
GST_DEBUG ("done");
}
GList *tmp;
GST_DEBUG ("received no-more-pads");
- LOCK_DYN (self);
for (tmp = self->priv->chains; tmp; tmp = g_list_next (tmp)) {
OutputChain *chain = (OutputChain *) tmp->data;
chain->probe_id = 0;
}
}
- UNLOCK_DYN (self);
}
/**