summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeeshan.ali@nokia.com <zeeshan.ali@nokia.com>2007-03-14 17:17:56 +0000
committerEdward Hervey <bilboed@bilboed.com>2009-02-21 17:47:56 +0100
commit19e3f397512c0563f6279fbf3394fa321789f910 (patch)
tree2fdff9b6af1302c7465cab90d6c643d22b50392f
parent8806b9315125f29566c105b150bfda50459651da (diff)
downloadgst-plugins-bad-19e3f397512c0563f6279fbf3394fa321789f910.tar.gz
gst-plugins-bad-19e3f397512c0563f6279fbf3394fa321789f910.tar.bz2
gst-plugins-bad-19e3f397512c0563f6279fbf3394fa321789f910.zip
[MOVED FROM GST-P-FARSIGHT] Request for stream lock when generating DTMF packets
20070314171756-65035-0b497dfac203ff4f579525485d5804e5f5093b3f.gz
-rw-r--r--gst/rtpdtmf/gstrtpdtmfsrc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gst/rtpdtmf/gstrtpdtmfsrc.c b/gst/rtpdtmf/gstrtpdtmfsrc.c
index 5d84b6ae..38e64b0e 100644
--- a/gst/rtpdtmf/gstrtpdtmfsrc.c
+++ b/gst/rtpdtmf/gstrtpdtmfsrc.c
@@ -450,6 +450,19 @@ gst_rtp_dtmf_src_get_property (GObject * object, guint prop_id, GValue * value,
}
static void
+gst_rtp_dtmf_src_set_stream_lock (GstRTPDTMFSrc *dtmfsrc, gboolean lock)
+{
+ GstEvent *event;
+ GstStructure *structure;
+
+ structure = gst_structure_new ("stream-lock",
+ "lock", G_TYPE_BOOLEAN, lock, NULL);
+
+ event = gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM_OOB, structure);
+ gst_pad_push_event (dtmfsrc->srcpad, event);
+}
+
+static void
gst_rtp_dtmf_src_start (GstRTPDTMFSrc *dtmfsrc,
gint event_number, gint event_volume)
{
@@ -490,6 +503,9 @@ gst_rtp_dtmf_src_start (GstRTPDTMFSrc *dtmfsrc,
else
dtmfsrc->ts_base = dtmfsrc->ts_offset;
+ /* Don't forget to get exclusive access to the stream */
+ gst_rtp_dtmf_src_set_stream_lock (dtmfsrc, TRUE);
+
if (!gst_pad_start_task (dtmfsrc->srcpad,
(GstTaskFunction) gst_rtp_dtmf_src_push_next_rtp_packet, dtmfsrc)) {
GST_ERROR_OBJECT (dtmfsrc, "Failed to start task on src pad");
@@ -510,6 +526,9 @@ gst_rtp_dtmf_src_stop (GstRTPDTMFSrc *dtmfsrc)
dtmfsrc->payload->e = 1;
gst_rtp_dtmf_src_push_next_rtp_packet (dtmfsrc);
+ /* Don't forget to release the stream lock */
+ gst_rtp_dtmf_src_set_stream_lock (dtmfsrc, FALSE);
+
g_free (dtmfsrc->payload);
dtmfsrc->payload = NULL;
}