mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
[MOVED FROM GST-P-FARSIGHT] Request for stream lock when generating DTMF packets
20070314171756-65035-0b497dfac203ff4f579525485d5804e5f5093b3f.gz
This commit is contained in:
parent
8806b93151
commit
19e3f39751
1 changed files with 19 additions and 0 deletions
|
@ -449,6 +449,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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue