Remove the _full variants and add the destroy notify to the regular methods.
* @pad: pad to add the data probe handler to
* @handler: function to call when data is passed over pad
* @data: (closure): data to pass along with the handler
- *
- * Adds a "data probe" to a pad. This function will be called whenever data
- * passes through a pad. In this case data means both events and buffers. The
- * probe will be called with the data as an argument, meaning @handler should
- * have the same callback signature as the #GstPad::have-data signal.
- * Note that the data will have a reference count greater than 1, so it will
- * be immutable -- you must not change it.
- *
- * For source pads, the probe will be called after the blocking function, if any
- * (see gst_pad_set_blocked_async()), but before looking up the peer to chain
- * to. For sink pads, the probe function will be called before configuring the
- * sink with new caps, if any, and before calling the pad's chain function.
- *
- * Your data probe should return TRUE to let the data continue to flow, or FALSE
- * to drop it. Dropping data is rarely useful, but occasionally comes in handy
- * with events.
- *
- * Although probes are implemented internally by connecting @handler to the
- * have-data signal on the pad, if you want to remove a probe it is insufficient
- * to only call g_signal_handler_disconnect on the returned handler id. To
- * remove a probe, use the appropriate function, such as
- * gst_pad_remove_data_probe().
- *
- * Returns: The handler id.
- */
-gulong
-gst_pad_add_data_probe (GstPad * pad, GCallback handler, gpointer data)
-{
- return gst_pad_add_data_probe_full (pad, handler, data, NULL);
-}
-
-/**
- * gst_pad_add_data_probe_full:
- * @pad: pad to add the data probe handler to
- * @handler: function to call when data is passed over pad
- * @data: (closure): data to pass along with the handler
* @notify: (allow-none): function to call when the probe is disconnected,
* or NULL
*
* Since: 0.10.20
*/
gulong
-gst_pad_add_data_probe_full (GstPad * pad, GCallback handler,
+gst_pad_add_data_probe (GstPad * pad, GCallback handler,
gpointer data, GDestroyNotify notify)
{
gulong sigid;
* gst_pad_add_event_probe:
* @pad: pad to add the event probe handler to
* @handler: function to call when events are passed over pad
- * @data: (closure): data to pass along with the handler
- *
- * Adds a probe that will be called for all events passing through a pad. See
- * gst_pad_add_data_probe() for more information.
- *
- * Returns: The handler id
- */
-gulong
-gst_pad_add_event_probe (GstPad * pad, GCallback handler, gpointer data)
-{
- return gst_pad_add_event_probe_full (pad, handler, data, NULL);
-}
-
-/**
- * gst_pad_add_event_probe_full:
- * @pad: pad to add the event probe handler to
- * @handler: function to call when events are passed over pad
* @data: (closure): data to pass along with the handler, or NULL
* @notify: (allow-none): function to call when probe is disconnected, or NULL
*
* Since: 0.10.20
*/
gulong
-gst_pad_add_event_probe_full (GstPad * pad, GCallback handler,
+gst_pad_add_event_probe (GstPad * pad, GCallback handler,
gpointer data, GDestroyNotify notify)
{
gulong sigid;
/**
* gst_pad_add_buffer_probe:
* @pad: pad to add the buffer probe handler to
- * @handler: function to call when buffers are passed over pad
- * @data: (closure): data to pass along with the handler
- *
- * Adds a probe that will be called for all buffers passing through a pad. See
- * gst_pad_add_data_probe() for more information.
- *
- * Returns: The handler id
- */
-gulong
-gst_pad_add_buffer_probe (GstPad * pad, GCallback handler, gpointer data)
-{
- return gst_pad_add_buffer_probe_full (pad, handler, data, NULL);
-}
-
-/**
- * gst_pad_add_buffer_probe_full:
- * @pad: pad to add the buffer probe handler to
* @handler: function to call when buffer are passed over pad
* @data: (closure): data to pass along with the handler
* @notify: (allow-none): function to call when the probe is disconnected,
* Since: 0.10.20
*/
gulong
-gst_pad_add_buffer_probe_full (GstPad * pad, GCallback handler,
+gst_pad_add_buffer_probe (GstPad * pad, GCallback handler,
gpointer data, GDestroyNotify notify)
{
gulong sigid;
GstBuffer * gst_buffer_join (GstBuffer * buf1, GstBuffer * buf2);
/* probes */
-gulong gst_pad_add_data_probe (GstPad * pad,
- GCallback handler,
- gpointer data);
-
-gulong gst_pad_add_data_probe_full (GstPad * pad,
+gulong gst_pad_add_data_probe (GstPad * pad,
GCallback handler,
gpointer data,
GDestroyNotify notify);
void gst_pad_remove_data_probe (GstPad * pad, guint handler_id);
-gulong gst_pad_add_event_probe (GstPad * pad,
- GCallback handler,
- gpointer data);
-
-gulong gst_pad_add_event_probe_full (GstPad * pad,
+gulong gst_pad_add_event_probe (GstPad * pad,
GCallback handler,
gpointer data,
GDestroyNotify notify);
void gst_pad_remove_event_probe (GstPad * pad, guint handler_id);
-gulong gst_pad_add_buffer_probe (GstPad * pad,
- GCallback handler,
- gpointer data);
-
-gulong gst_pad_add_buffer_probe_full (GstPad * pad,
+gulong gst_pad_add_buffer_probe (GstPad * pad,
GCallback handler,
gpointer data,
GDestroyNotify notify);
{
GstStateChangeReturn ret;
- id = gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe), NULL);
+ id = gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe), NULL, NULL);
cond = g_cond_new ();
lock = g_mutex_new ();
consist = g_new0 (GstStreamConsistency, 1);
consist->pad = g_object_ref (pad);
consist->probeid =
- gst_pad_add_data_probe (pad, (GCallback) source_pad_data_cb, consist);
+ gst_pad_add_data_probe (pad, (GCallback) source_pad_data_cb, consist,
+ NULL);
return consist;
}
fail_if (output_pad == NULL, "Could not create a output_pad");
/* add probe */
- probe_id = gst_pad_add_data_probe (output_pad, G_CALLBACK (probe_cb), NULL);
+ probe_id =
+ gst_pad_add_data_probe (output_pad, G_CALLBACK (probe_cb), NULL, NULL);
g_object_set_data (G_OBJECT (output_pad), "probe_id",
GINT_TO_POINTER (probe_id));
input_pads = g_list_append (input_pads, setup_input_pad (sel));
}
/* add probe */
- probe_id = gst_pad_add_data_probe (output_pad, G_CALLBACK (probe_cb), NULL);
+ probe_id =
+ gst_pad_add_data_probe (output_pad, G_CALLBACK (probe_cb), NULL, NULL);
g_object_set_data (G_OBJECT (output_pad), "probe_id",
GINT_TO_POINTER (probe_id));
/* add pad-probes to faksrc.src and fakesink.sink */
fail_if ((srcpad = gst_element_get_static_pad (fakesrc, "src")) == NULL);
gst_pad_add_event_probe (srcpad, (GCallback) event_probe,
- GINT_TO_POINTER (TRUE));
+ GINT_TO_POINTER (TRUE), NULL);
fail_if ((sinkpad = gst_element_get_static_pad (fakesink, "sink")) == NULL);
gst_pad_add_event_probe (sinkpad, (GCallback) event_probe,
- GINT_TO_POINTER (FALSE));
+ GINT_TO_POINTER (FALSE), NULL);
/* Upstream events */
test_event (pipeline, GST_EVENT_CUSTOM_UPSTREAM, sinkpad, TRUE, srcpad);
/* adding a probe that returns FALSE will drop the buffer without trying
* to chain */
id = gst_pad_add_buffer_probe (src, (GCallback) _probe_handler,
- GINT_TO_POINTER (0));
+ GINT_TO_POINTER (0), NULL);
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
fail_unless (gst_pad_push (src, buffer) == GST_FLOW_OK);
/* adding a probe that returns TRUE will still chain the buffer,
* and hence drop because pad is unlinked */
id = gst_pad_add_buffer_probe (src, (GCallback) _probe_handler,
- GINT_TO_POINTER (1));
+ GINT_TO_POINTER (1), NULL);
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
fail_unless (gst_pad_push (src, buffer) == GST_FLOW_NOT_LINKED);
/* adding a probe that returns FALSE will drop the buffer without trying
* to chain */
id = gst_pad_add_buffer_probe (src, (GCallback) _probe_handler,
- GINT_TO_POINTER (0));
+ GINT_TO_POINTER (0), NULL);
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
fail_unless (gst_pad_push (src, buffer) == GST_FLOW_OK);
/* adding a probe that returns TRUE will still chain the buffer */
id = gst_pad_add_buffer_probe (src, (GCallback) _probe_handler,
- GINT_TO_POINTER (1));
+ GINT_TO_POINTER (1), NULL);
buffer = gst_buffer_new ();
gst_buffer_ref (buffer);
fail_unless (gst_pad_push (src, buffer) == GST_FLOW_OK);
gst_element_link (fakesrc, fakesink);
sink = gst_element_get_static_pad (fakesink, "sink");
- gst_pad_add_buffer_probe (sink, G_CALLBACK (sink_pad_probe), &observed);
+ gst_pad_add_buffer_probe (sink, G_CALLBACK (sink_pad_probe), &observed, NULL);
fail_unless (gst_element_set_state (pipeline, GST_STATE_PAUSED)
== GST_STATE_CHANGE_NO_PREROLL, "expected no-preroll from live pipeline");
pad = gst_element_get_static_pad (fakesink, "sink");
/* add the probes we need for the test */
- gst_pad_add_data_probe (pad, G_CALLBACK (data_probe), SPECIAL_POINTER (0));
- gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe),
- SPECIAL_POINTER (1));
- gst_pad_add_event_probe (pad, G_CALLBACK (event_probe), SPECIAL_POINTER (2));
-
- /* add some probes just to test that _full works and the data is free'd
+ gst_pad_add_data_probe (pad, G_CALLBACK (data_probe), SPECIAL_POINTER (0),
+ NULL);
+ gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe), SPECIAL_POINTER (1),
+ NULL);
+ gst_pad_add_event_probe (pad, G_CALLBACK (event_probe), SPECIAL_POINTER (2),
+ NULL);
+
+ /* add some string probes just to test that the data is free'd
* properly as it should be */
- gst_pad_add_data_probe_full (pad, G_CALLBACK (probe_do_nothing),
+ gst_pad_add_data_probe (pad, G_CALLBACK (probe_do_nothing),
g_strdup ("data probe string"), (GDestroyNotify) g_free);
- gst_pad_add_buffer_probe_full (pad, G_CALLBACK (probe_do_nothing),
+ gst_pad_add_buffer_probe (pad, G_CALLBACK (probe_do_nothing),
g_strdup ("buffer probe string"), (GDestroyNotify) g_free);
- gst_pad_add_event_probe_full (pad, G_CALLBACK (probe_do_nothing),
+ gst_pad_add_event_probe (pad, G_CALLBACK (probe_do_nothing),
g_strdup ("event probe string"), (GDestroyNotify) g_free);
gst_object_unref (pad);
gst_element_link (fakesrc, fakesink);
pad = gst_element_get_static_pad (fakesink, "sink");
- id1 = gst_pad_add_data_probe (pad, G_CALLBACK (data_probe_once), &id1);
- id2 = gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe_once), &id2);
- id3 = gst_pad_add_event_probe (pad, G_CALLBACK (event_probe_once), &id3);
+ id1 = gst_pad_add_data_probe (pad, G_CALLBACK (data_probe_once), &id1, NULL);
+ id2 =
+ gst_pad_add_buffer_probe (pad, G_CALLBACK (buffer_probe_once), &id2,
+ NULL);
+ id3 =
+ gst_pad_add_event_probe (pad, G_CALLBACK (event_probe_once), &id3, NULL);
gst_object_unref (pad);
gst_element_set_state (pipeline, GST_STATE_PLAYING);
fail_unless (srcpad != NULL);
probe = gst_pad_add_event_probe (srcpad,
- G_CALLBACK (eos_event_counter), &num_eos);
+ G_CALLBACK (eos_event_counter), &num_eos, NULL);
bus = gst_element_get_bus (pipe);
fail_unless (srcpad != NULL);
probe = gst_pad_add_event_probe (srcpad,
- G_CALLBACK (eos_event_counter), &num_eos);
+ G_CALLBACK (eos_event_counter), &num_eos, NULL);
bus = gst_element_get_bus (pipe);
fail_unless (srcpad != NULL);
probe = gst_pad_add_event_probe (srcpad,
- G_CALLBACK (eos_event_counter), &num_eos);
+ G_CALLBACK (eos_event_counter), &num_eos, NULL);
gst_element_set_state (pipe, GST_STATE_PLAYING);
state_ret = gst_element_get_state (pipe, NULL, NULL, -1);
fail_unless (srcpad != NULL);
probe = gst_pad_add_event_probe (srcpad,
- G_CALLBACK (eos_event_counter), &num_eos);
+ G_CALLBACK (eos_event_counter), &num_eos, NULL);
bus = gst_element_get_bus (pipe);
fail_unless (srcpad != NULL);
probe = gst_pad_add_event_probe (srcpad,
- G_CALLBACK (eos_event_counter), &num_eos);
+ G_CALLBACK (eos_event_counter), &num_eos, NULL);
bus = gst_element_get_bus (pipe);
fail_unless (srcpad != NULL);
probe = gst_pad_add_event_probe (srcpad,
- G_CALLBACK (eos_event_counter), &num_eos);
+ G_CALLBACK (eos_event_counter), &num_eos, NULL);
bus = gst_element_get_bus (pipe);
fail_unless (probe_pad != NULL);
probe = gst_pad_add_event_probe (probe_pad,
- G_CALLBACK (segment_event_catcher), &seg_event);
+ G_CALLBACK (segment_event_catcher), &seg_event, NULL);
/* prepare the seek */
rate_seek = gst_event_new_seek (0.5, GST_FORMAT_TIME, GST_SEEK_FLAG_NONE,
fail_unless (queue != NULL);
pad = gst_element_get_static_pad (queue, "sink");
fail_unless (pad != NULL);
- probe = gst_pad_add_event_probe (pad, G_CALLBACK (modify_caps), filter);
+ probe = gst_pad_add_event_probe (pad, G_CALLBACK (modify_caps), filter, NULL);
bus = gst_element_get_bus (pipeline);