pad: add probe id to the info
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 26 Jan 2012 10:01:21 +0000 (11:01 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 26 Jan 2012 10:04:01 +0000 (11:04 +0100)
gst/gstpad.c
gst/gstpad.h

index c0d384b..413d978 100644 (file)
@@ -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))        \
index 93c4970..d4a66de 100644 (file)
@@ -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))