}
static void
-gst_dtmf_src_set_stream_lock (GstDTMFSrc * dtmfsrc, gboolean lock)
-{
- GstPad *srcpad = GST_BASE_SRC_PAD (dtmfsrc);
- 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);
- if (!gst_pad_push_event (srcpad, event)) {
- GST_WARNING_OBJECT (dtmfsrc, "stream-lock event not handled");
- }
-}
-
-static void
gst_dtmf_prepare_timestamps (GstDTMFSrc * dtmfsrc)
{
GstClock *clock;
case DTMF_EVENT_TYPE_START:
gst_dtmf_prepare_timestamps (dtmfsrc);
- /* Don't forget to get exclusive access to the stream */
- gst_dtmf_src_set_stream_lock (dtmfsrc, TRUE);
-
event->packet_count = 0;
dtmfsrc->last_event = event;
event = NULL;
"Received two consecutive DTMF start events");
break;
case DTMF_EVENT_TYPE_STOP:
- gst_dtmf_src_set_stream_lock (dtmfsrc, FALSE);
-
g_slice_free (GstDTMFSrcEvent, dtmfsrc->last_event);
dtmfsrc->last_event = NULL;
break;
if (dtmfsrc->last_event) {
GST_DEBUG_OBJECT (dtmfsrc, "Stopping current event");
/* Don't forget to release the stream lock */
- gst_dtmf_src_set_stream_lock (dtmfsrc, FALSE);
g_slice_free (GstDTMFSrcEvent, dtmfsrc->last_event);
dtmfsrc->last_event = NULL;
}
}
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);
- if (!gst_pad_push_event (GST_BASE_SRC_PAD (dtmfsrc), event)) {
- GST_WARNING_OBJECT (dtmfsrc, "stream-lock event not handled");
- }
-
-}
-
-static void
gst_rtp_dtmf_prepare_timestamps (GstRTPDTMFSrc * dtmfsrc)
{
GstClock *clock;
dtmfsrc->redundancy_count = dtmfsrc->packet_redundancy;
gst_rtp_dtmf_prepare_timestamps (dtmfsrc);
- /* Don't forget to get exclusive access to the stream */
- gst_rtp_dtmf_src_set_stream_lock (dtmfsrc, TRUE);
-
dtmfsrc->payload = event->payload;
event->payload = NULL;
break;
/* This is the end of the event */
if (dtmfsrc->last_packet == TRUE && dtmfsrc->redundancy_count == 0) {
- /* Don't forget to release the stream lock */
- gst_rtp_dtmf_src_set_stream_lock (dtmfsrc, FALSE);
-
g_slice_free (GstRTPDTMFPayload, dtmfsrc->payload);
dtmfsrc->payload = NULL;