mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
tee: only message once per received buffer
Avoids checking for each source pad. The messages would be almost identical anyway.
This commit is contained in:
parent
8715e3ec36
commit
15bac7df00
1 changed files with 23 additions and 17 deletions
|
@ -580,28 +580,30 @@ gst_tee_sink_acceptcaps (GstPad * pad, GstCaps * caps)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_tee_do_message (GstTee * tee, GstPad * pad, gpointer data, gboolean is_list)
|
||||||
|
{
|
||||||
|
GST_OBJECT_LOCK (tee);
|
||||||
|
g_free (tee->last_message);
|
||||||
|
if (is_list) {
|
||||||
|
tee->last_message =
|
||||||
|
g_strdup_printf ("chain-list ******* (%s:%s)t %p",
|
||||||
|
GST_DEBUG_PAD_NAME (pad), data);
|
||||||
|
} else {
|
||||||
|
tee->last_message =
|
||||||
|
g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %"
|
||||||
|
G_GUINT64_FORMAT ") %p", GST_DEBUG_PAD_NAME (pad),
|
||||||
|
GST_BUFFER_SIZE (data), GST_BUFFER_TIMESTAMP (data), data);
|
||||||
|
}
|
||||||
|
GST_OBJECT_UNLOCK (tee);
|
||||||
|
g_object_notify (G_OBJECT (tee), "last_message");
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_tee_do_push (GstTee * tee, GstPad * pad, gpointer data, gboolean is_list)
|
gst_tee_do_push (GstTee * tee, GstPad * pad, gpointer data, gboolean is_list)
|
||||||
{
|
{
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
|
|
||||||
if (G_UNLIKELY (!tee->silent)) {
|
|
||||||
GST_OBJECT_LOCK (tee);
|
|
||||||
g_free (tee->last_message);
|
|
||||||
if (is_list) {
|
|
||||||
tee->last_message =
|
|
||||||
g_strdup_printf ("chain-list ******* (%s:%s)t %p",
|
|
||||||
GST_DEBUG_PAD_NAME (pad), data);
|
|
||||||
} else {
|
|
||||||
tee->last_message =
|
|
||||||
g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %"
|
|
||||||
G_GUINT64_FORMAT ") %p", GST_DEBUG_PAD_NAME (pad),
|
|
||||||
GST_BUFFER_SIZE (data), GST_BUFFER_TIMESTAMP (data), data);
|
|
||||||
}
|
|
||||||
GST_OBJECT_UNLOCK (tee);
|
|
||||||
g_object_notify (G_OBJECT (tee), "last_message");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Push */
|
/* Push */
|
||||||
if (pad == tee->pull_pad) {
|
if (pad == tee->pull_pad) {
|
||||||
/* don't push on the pad we're pulling from */
|
/* don't push on the pad we're pulling from */
|
||||||
|
@ -637,7 +639,11 @@ gst_tee_handle_data (GstTee * tee, gpointer data, gboolean is_list)
|
||||||
guint32 cookie;
|
guint32 cookie;
|
||||||
GstFlowReturn ret, cret;
|
GstFlowReturn ret, cret;
|
||||||
|
|
||||||
|
if (G_UNLIKELY (!tee->silent))
|
||||||
|
gst_tee_do_message (tee, tee->sinkpad, data, is_list);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (tee);
|
GST_OBJECT_LOCK (tee);
|
||||||
|
|
||||||
/* mark all pads as 'not pushed on yet' */
|
/* mark all pads as 'not pushed on yet' */
|
||||||
g_list_foreach (GST_ELEMENT_CAST (tee)->srcpads, (GFunc) clear_pads, tee);
|
g_list_foreach (GST_ELEMENT_CAST (tee)->srcpads, (GFunc) clear_pads, tee);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue