gst/gstutils.*: now returns the signal id for better wrapping in bindings.

Original commit message from CVS:
* gst/gstutils.c:
* gst/gstutils.h:
(gst_pad_add_*_probe): now returns the signal id for better wrapping
in bindings.
This commit is contained in:
Edward Hervey 2005-07-04 15:08:30 +00:00
parent d7a711c35f
commit e3141fc8f5
3 changed files with 40 additions and 15 deletions

View file

@ -1,3 +1,10 @@
2005-07-04 Edward Hervey <edward@fluendo.com>
* gst/gstutils.c:
* gst/gstutils.h:
(gst_pad_add_*_probe): now returns the signal id for better wrapping
in bindings.
2005-07-04 Andy Wingo <wingo@pobox.com> 2005-07-04 Andy Wingo <wingo@pobox.com>
* check/gst/gstpad.c: Only set explicit caps on pads. * check/gst/gstpad.c: Only set explicit caps on pads.

View file

@ -2083,22 +2083,28 @@ gst_atomic_int_set (gint * atomic_int, gint value)
* Connects a signal handler to the pad's have-data signal, and increases * Connects a signal handler to the pad's have-data signal, and increases
* the do_{buffer,event}_signals number on the pads so that those * the do_{buffer,event}_signals number on the pads so that those
* signals are actually fired. * signals are actually fired.
*
* Returns: The handler id
*/ */
void gulong
gst_pad_add_data_probe (GstPad * pad, GCallback handler, gpointer data) gst_pad_add_data_probe (GstPad * pad, GCallback handler, gpointer data)
{ {
g_return_if_fail (GST_IS_PAD (pad)); gulong sigid;
g_return_if_fail (handler != NULL);
g_return_val_if_fail (GST_IS_PAD (pad), 0);
g_return_val_if_fail (handler != NULL, 0);
GST_LOCK (pad); GST_LOCK (pad);
g_signal_connect (pad, "have-data", handler, data); sigid = g_signal_connect (pad, "have-data", handler, data);
GST_PAD_DO_EVENT_SIGNALS (pad)++; GST_PAD_DO_EVENT_SIGNALS (pad)++;
GST_PAD_DO_BUFFER_SIGNALS (pad)++; GST_PAD_DO_BUFFER_SIGNALS (pad)++;
GST_DEBUG ("adding data probe to pad %s:%s, now %d data, %d event probes", GST_DEBUG ("adding data probe to pad %s:%s, now %d data, %d event probes",
GST_DEBUG_PAD_NAME (pad), GST_DEBUG_PAD_NAME (pad),
GST_PAD_DO_BUFFER_SIGNALS (pad), GST_PAD_DO_EVENT_SIGNALS (pad)); GST_PAD_DO_BUFFER_SIGNALS (pad), GST_PAD_DO_EVENT_SIGNALS (pad));
GST_UNLOCK (pad); GST_UNLOCK (pad);
return sigid;
} }
/** /**
@ -2110,20 +2116,26 @@ gst_pad_add_data_probe (GstPad * pad, GCallback handler, gpointer data)
* Connects a signal handler to the pad's have-data signal, and increases * Connects a signal handler to the pad's have-data signal, and increases
* the do_event_signals number on the pads so that this signal * the do_event_signals number on the pads so that this signal
* is actually fired. * is actually fired.
*
* Returns: The handler id
*/ */
void gulong
gst_pad_add_event_probe (GstPad * pad, GCallback handler, gpointer data) gst_pad_add_event_probe (GstPad * pad, GCallback handler, gpointer data)
{ {
g_return_if_fail (GST_IS_PAD (pad)); gulong sigid;
g_return_if_fail (handler != NULL);
g_return_val_if_fail (GST_IS_PAD (pad), 0);
g_return_val_if_fail (handler != NULL, 0);
GST_LOCK (pad); GST_LOCK (pad);
g_signal_connect (pad, "have-data", handler, data); sigid = g_signal_connect (pad, "have-data", handler, data);
GST_PAD_DO_EVENT_SIGNALS (pad)++; GST_PAD_DO_EVENT_SIGNALS (pad)++;
GST_DEBUG ("adding event probe to pad %s:%s, now %d probes", GST_DEBUG ("adding event probe to pad %s:%s, now %d probes",
GST_DEBUG_PAD_NAME (pad), GST_PAD_DO_EVENT_SIGNALS (pad)); GST_DEBUG_PAD_NAME (pad), GST_PAD_DO_EVENT_SIGNALS (pad));
GST_UNLOCK (pad); GST_UNLOCK (pad);
return sigid;
} }
/** /**
@ -2135,20 +2147,26 @@ gst_pad_add_event_probe (GstPad * pad, GCallback handler, gpointer data)
* Connects a signal handler to the pad's have-data signal, and increases * Connects a signal handler to the pad's have-data signal, and increases
* the do_buffer_signals number on the pads so that this signal * the do_buffer_signals number on the pads so that this signal
* is actually fired. * is actually fired.
*
* Returns: The handler id
*/ */
void gulong
gst_pad_add_buffer_probe (GstPad * pad, GCallback handler, gpointer data) gst_pad_add_buffer_probe (GstPad * pad, GCallback handler, gpointer data)
{ {
g_return_if_fail (GST_IS_PAD (pad)); gulong sigid;
g_return_if_fail (handler != NULL);
g_return_val_if_fail (GST_IS_PAD (pad), 0);
g_return_val_if_fail (handler != NULL, 0);
GST_LOCK (pad); GST_LOCK (pad);
g_signal_connect (pad, "have-data", handler, data); sigid = g_signal_connect (pad, "have-data", handler, data);
GST_PAD_DO_BUFFER_SIGNALS (pad)++; GST_PAD_DO_BUFFER_SIGNALS (pad)++;
GST_DEBUG ("adding buffer probe to pad %s:%s, now %d probes", GST_DEBUG ("adding buffer probe to pad %s:%s, now %d probes",
GST_DEBUG_PAD_NAME (pad), GST_PAD_DO_BUFFER_SIGNALS (pad)); GST_DEBUG_PAD_NAME (pad), GST_PAD_DO_BUFFER_SIGNALS (pad));
GST_UNLOCK (pad); GST_UNLOCK (pad);
return sigid;
} }
/** /**

View file

@ -293,19 +293,19 @@ void gst_buffer_stamp (GstBuffer * dest, const GstBuffer * src);
void gst_atomic_int_set (gint * atomic_int, gint value); void gst_atomic_int_set (gint * atomic_int, gint value);
/* probes */ /* probes */
void gst_pad_add_data_probe (GstPad * pad, gulong gst_pad_add_data_probe (GstPad * pad,
GCallback handler, GCallback handler,
gpointer data); gpointer data);
void gst_pad_remove_data_probe (GstPad * pad, void gst_pad_remove_data_probe (GstPad * pad,
GCallback handler, GCallback handler,
gpointer data); gpointer data);
void gst_pad_add_event_probe (GstPad * pad, gulong gst_pad_add_event_probe (GstPad * pad,
GCallback handler, GCallback handler,
gpointer data); gpointer data);
void gst_pad_remove_event_probe (GstPad * pad, void gst_pad_remove_event_probe (GstPad * pad,
GCallback handler, GCallback handler,
gpointer data); gpointer data);
void gst_pad_add_buffer_probe (GstPad * pad, gulong gst_pad_add_buffer_probe (GstPad * pad,
GCallback handler, GCallback handler,
gpointer data); gpointer data);
void gst_pad_remove_buffer_probe (GstPad * pad, void gst_pad_remove_buffer_probe (GstPad * pad,