From 3844f8026637f1e7aadc34de0d4e0dcb759ec3f6 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 26 Jan 2012 11:01:21 +0100 Subject: [PATCH] pad: add probe id to the info --- gst/gstpad.c | 10 ++++++---- gst/gstpad.h | 3 +++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gst/gstpad.c b/gst/gstpad.c index c0d384b..413d978 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -1170,7 +1170,7 @@ gst_pad_add_probe (GstPad * pad, GstPadProbeType mask, "pad is in use, delay idle callback"); GST_OBJECT_UNLOCK (pad); } else { - GstPadProbeInfo info = { GST_PAD_PROBE_TYPE_IDLE, }; + GstPadProbeInfo info = { GST_PAD_PROBE_TYPE_IDLE, res, }; /* the pad is idle now, we can signal the idle callback now */ GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, @@ -2827,6 +2827,8 @@ probe_hook_marshal (GHook * hook, ProbeMarshall * data) if (callback == NULL) return; + info->id = hook->hook_id; + GST_OBJECT_UNLOCK (pad); ret = callback (pad, info, hook->data); @@ -2871,7 +2873,7 @@ no_match: G_STMT_START { \ if (G_UNLIKELY (pad->num_probes)) { \ /* we start with passing NULL as the data item */ \ - GstPadProbeInfo info = { mask, NULL, offs, size }; \ + GstPadProbeInfo info = { mask, 0, NULL, offs, size }; \ ret = do_probe_callbacks (pad, &info, defaultval); \ /* store the possibly updated data item */ \ data = GST_PAD_PROBE_INFO_DATA (&info); \ @@ -2890,7 +2892,7 @@ no_match: G_STMT_START { \ if (G_UNLIKELY (pad->num_probes)) { \ /* pass NULL as the data item */ \ - GstPadProbeInfo info = { mask, NULL, 0, 0 }; \ + GstPadProbeInfo info = { mask, 0, NULL, 0, 0 }; \ ret = do_probe_callbacks (pad, &info, defaultval); \ if (G_UNLIKELY (ret != defaultval && ret != GST_FLOW_OK)) \ goto label; \ @@ -2900,7 +2902,7 @@ no_match: #define PROBE_FULL(pad,mask,data,offs,size,label,defaultval) \ G_STMT_START { \ if (G_UNLIKELY (pad->num_probes)) { \ - GstPadProbeInfo info = { mask, data, offs, size }; \ + GstPadProbeInfo info = { mask, 0, data, offs, size }; \ ret = do_probe_callbacks (pad, &info, defaultval); \ data = GST_PAD_PROBE_INFO_DATA (&info); \ if (G_UNLIKELY (ret != defaultval && ret != GST_FLOW_OK)) \ diff --git a/gst/gstpad.h b/gst/gstpad.h index 93c4970..d4a66de 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -514,6 +514,7 @@ typedef enum /** * GstPadProbeInfo: * @type: the current probe type + * @id: the id of the probe * @data: type specific data, check the @type field to know the datatype. * This field can be NULL. * @offset: offset of pull probe, this field is valid when @type contains @@ -526,6 +527,7 @@ typedef enum typedef struct { GstPadProbeType type; + gulong id; gpointer data; guint64 offset; guint size; @@ -534,6 +536,7 @@ typedef struct } GstPadProbeInfo; #define GST_PAD_PROBE_INFO_TYPE(d) ((d)->type) +#define GST_PAD_PROBE_INFO_ID(d) ((d)->id) #define GST_PAD_PROBE_INFO_DATA(d) ((d)->data) #define GST_PAD_PROBE_INFO_BUFFER(d) GST_BUFFER_CAST(GST_PAD_PROBE_INFO_DATA(d)) -- 2.7.4