diff options
author | Laurent Glayal <spglegle@yahoo.fr> | 2009-02-20 13:30:49 -0500 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2009-02-21 17:48:57 +0100 |
commit | 0bff57a39594f45e2ce1d05afaf2735f70ae3d87 (patch) | |
tree | 8589f7f8dd6f32814636f2cba7e368b005728c6f /gst | |
parent | a34534df7984529a856dd4a7d7576b08c40afcd8 (diff) | |
download | gst-plugins-bad-0bff57a39594f45e2ce1d05afaf2735f70ae3d87.tar.gz gst-plugins-bad-0bff57a39594f45e2ce1d05afaf2735f70ae3d87.tar.bz2 gst-plugins-bad-0bff57a39594f45e2ce1d05afaf2735f70ae3d87.zip |
[MOVED FROM GST-P-FARSIGHT] Add signals before stream lock and after unlocking
Diffstat (limited to 'gst')
-rw-r--r-- | gst/rtpmux/gstrtpdtmfmux.c | 25 | ||||
-rw-r--r-- | gst/rtpmux/gstrtpdtmfmux.h | 4 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gst/rtpmux/gstrtpdtmfmux.c b/gst/rtpmux/gstrtpdtmfmux.c index ea3e1fd4..98039c36 100644 --- a/gst/rtpmux/gstrtpdtmfmux.c +++ b/gst/rtpmux/gstrtpdtmfmux.c @@ -80,6 +80,15 @@ GST_ELEMENT_DETAILS ("RTP muxer", "mixes RTP DTMF streams into other RTP streams", "Zeeshan Ali <first.last@nokia.com>"); +enum +{ + SIGNAL_LOCKING_STREAM, + SIGNAL_UNLOCKED_STREAM, + LAST_SIGNAL +}; + +static guint gst_rtpdtmfmux_signals[LAST_SIGNAL] = { 0 }; + static void gst_rtp_dtmf_mux_base_init (gpointer g_class); static void gst_rtp_dtmf_mux_class_init (GstRTPDTMFMuxClass * klass); static void gst_rtp_dtmf_mux_finalize (GObject * object); @@ -137,6 +146,16 @@ gst_rtp_dtmf_mux_class_init (GstRTPDTMFMuxClass * klass) parent_class = g_type_class_peek_parent (klass); + gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM] = + g_signal_new ("locking", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTPDTMFMuxClass, locking),NULL, NULL, + gst_marshal_VOID__OBJECT, G_TYPE_NONE,1,GST_TYPE_PAD); + + gst_rtpdtmfmux_signals[SIGNAL_UNLOCKED_STREAM] = + g_signal_new ("unlocked", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GstRTPDTMFMuxClass, unlocked),NULL, NULL, + gst_marshal_VOID__OBJECT, G_TYPE_NONE,1,GST_TYPE_PAD); + gobject_class->finalize = gst_rtp_dtmf_mux_finalize; gstrtpmux_class->chain_func = gst_rtp_dtmf_mux_chain; gstrtpmux_class->sink_event_func = gst_rtp_dtmf_mux_sink_event; @@ -228,6 +247,9 @@ gst_rtp_dtmf_mux_handle_stream_lock_event (GstRTPDTMFMux *mux, GstPad * pad, if (!gst_structure_get_boolean (event_structure, "lock", &lock)) return FALSE; + if (lock) + g_signal_emit (G_OBJECT (mux), gst_rtpdtmfmux_signals[SIGNAL_LOCKING_STREAM], 0, pad); + GST_OBJECT_LOCK (mux); if (lock) gst_rtp_dtmf_mux_lock_stream (mux, pad); @@ -235,6 +257,9 @@ gst_rtp_dtmf_mux_handle_stream_lock_event (GstRTPDTMFMux *mux, GstPad * pad, gst_rtp_dtmf_mux_unlock_stream (mux, pad); GST_OBJECT_UNLOCK (mux); + if (!lock) + g_signal_emit (G_OBJECT (mux), gst_rtpdtmfmux_signals[SIGNAL_UNLOCKED_STREAM], 0, pad); + return TRUE; } diff --git a/gst/rtpmux/gstrtpdtmfmux.h b/gst/rtpmux/gstrtpdtmfmux.h index 36fabffc..1b0c1420 100644 --- a/gst/rtpmux/gstrtpdtmfmux.h +++ b/gst/rtpmux/gstrtpdtmfmux.h @@ -57,6 +57,10 @@ struct _GstRTPDTMFMux struct _GstRTPDTMFMuxClass { GstRTPMuxClass parent_class; + + /* signals */ + void (*locking) (GstElement *element, GstPad *pad); + void (*unlocked) (GstElement *element, GstPad *pad); }; GType gst_rtp_dtmf_mux_get_type (void); |