mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
ext/amrnb/: Core already took the lock.
Original commit message from CVS: * ext/amrnb/amrnbdec.c: (gst_amrnbdec_init), (gst_amrnbdec_chain), (gst_amrnbdec_state_change): * ext/amrnb/amrnbenc.c: (gst_amrnbenc_base_init), (gst_amrnbenc_finalize), (gst_amrnbenc_chain), (gst_amrnbenc_state_change): * ext/amrnb/amrnbparse.c: (gst_amrnbparse_init), (gst_amrnbparse_query), (gst_amrnbparse_chain), (gst_amrnbparse_read_header), (gst_amrnbparse_loop), (gst_amrnbparse_sink_activate), (gst_amrnbparse_state_change): Core already took the lock.
This commit is contained in:
parent
7a89ecf2dd
commit
0e06450bdf
4 changed files with 23 additions and 43 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
|||
2005-05-25 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* ext/amrnb/amrnbdec.c: (gst_amrnbdec_init), (gst_amrnbdec_chain),
|
||||
(gst_amrnbdec_state_change):
|
||||
* ext/amrnb/amrnbenc.c: (gst_amrnbenc_base_init),
|
||||
(gst_amrnbenc_finalize), (gst_amrnbenc_chain),
|
||||
(gst_amrnbenc_state_change):
|
||||
* ext/amrnb/amrnbparse.c: (gst_amrnbparse_init),
|
||||
(gst_amrnbparse_query), (gst_amrnbparse_chain),
|
||||
(gst_amrnbparse_read_header), (gst_amrnbparse_loop),
|
||||
(gst_amrnbparse_sink_activate), (gst_amrnbparse_state_change):
|
||||
Core already took the lock.
|
||||
|
||||
2005-05-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* configure.ac:
|
||||
|
|
|
@ -173,8 +173,6 @@ gst_amrnbdec_chain (GstPad * pad, GstBuffer * buffer)
|
|||
|
||||
amrnbdec = GST_AMRNBDEC (GST_PAD_PARENT (pad));
|
||||
|
||||
GST_STREAM_LOCK (pad);
|
||||
|
||||
if (amrnbdec->rate == 0 || amrnbdec->channels == 0)
|
||||
goto not_negotiated;
|
||||
|
||||
|
@ -219,13 +217,11 @@ gst_amrnbdec_chain (GstPad * pad, GstBuffer * buffer)
|
|||
/* play */
|
||||
ret = gst_pad_push (amrnbdec->srcpad, out);
|
||||
}
|
||||
GST_STREAM_UNLOCK (pad);
|
||||
|
||||
return ret;
|
||||
|
||||
not_negotiated:
|
||||
{
|
||||
GST_STREAM_UNLOCK (pad);
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,7 +192,6 @@ gst_amrnbenc_chain (GstPad * pad, GstBuffer * buffer)
|
|||
|
||||
amrnbenc = GST_AMRNBENC (GST_PAD_PARENT (pad));
|
||||
|
||||
GST_STREAM_LOCK (pad);
|
||||
if (amrnbenc->rate == 0 || amrnbenc->channels == 0)
|
||||
goto not_negotiated;
|
||||
|
||||
|
@ -230,13 +229,10 @@ gst_amrnbenc_chain (GstPad * pad, GstBuffer * buffer)
|
|||
ret = gst_pad_push (amrnbenc->srcpad, out);
|
||||
}
|
||||
|
||||
GST_STREAM_UNLOCK (pad);
|
||||
|
||||
return ret;
|
||||
|
||||
not_negotiated:
|
||||
{
|
||||
GST_STREAM_UNLOCK (pad);
|
||||
return GST_FLOW_NOT_NEGOTIATED;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -266,8 +266,6 @@ gst_amrnbparse_chain (GstPad * pad, GstBuffer * buffer)
|
|||
|
||||
amrnbparse = GST_AMRNBPARSE (GST_PAD_PARENT (pad));
|
||||
|
||||
GST_STREAM_LOCK (pad);
|
||||
|
||||
gst_adapter_push (amrnbparse->adapter, buffer);
|
||||
|
||||
res = GST_FLOW_OK;
|
||||
|
@ -317,7 +315,6 @@ gst_amrnbparse_chain (GstPad * pad, GstBuffer * buffer)
|
|||
gst_adapter_flush (amrnbparse->adapter, block);
|
||||
}
|
||||
done:
|
||||
GST_STREAM_UNLOCK (pad);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -373,7 +370,6 @@ gst_amrnbparse_loop (GstPad * pad)
|
|||
|
||||
amrnbparse = GST_AMRNBPARSE (GST_PAD_PARENT (pad));
|
||||
|
||||
GST_STREAM_LOCK (pad);
|
||||
/* init */
|
||||
if (amrnbparse->need_header) {
|
||||
gboolean got_header;
|
||||
|
@ -424,23 +420,19 @@ gst_amrnbparse_loop (GstPad * pad)
|
|||
if (ret != GST_FLOW_OK)
|
||||
goto need_pause;
|
||||
|
||||
GST_STREAM_UNLOCK (pad);
|
||||
|
||||
return;
|
||||
|
||||
need_pause:
|
||||
{
|
||||
GST_LOG_OBJECT (amrnbparse, "pausing task");
|
||||
gst_task_pause (GST_RPAD_TASK (pad));
|
||||
GST_STREAM_UNLOCK (pad);
|
||||
gst_pad_pause_task (pad);
|
||||
return;
|
||||
}
|
||||
eos:
|
||||
{
|
||||
GST_LOG_OBJECT (amrnbparse, "pausing task");
|
||||
gst_pad_push_event (amrnbparse->srcpad, gst_event_new (GST_EVENT_EOS));
|
||||
gst_task_pause (GST_RPAD_TASK (pad));
|
||||
GST_STREAM_UNLOCK (pad);
|
||||
gst_pad_pause_task (pad);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -459,37 +451,20 @@ gst_amrnbparse_sink_activate (GstPad * sinkpad, GstActivateMode mode)
|
|||
result = TRUE;
|
||||
break;
|
||||
case GST_ACTIVATE_PULL:
|
||||
/* if we have a scheduler we can start the task */
|
||||
if (GST_ELEMENT_SCHEDULER (amrnbparse)) {
|
||||
gst_pad_peer_set_active (sinkpad, mode);
|
||||
GST_STREAM_LOCK (sinkpad);
|
||||
GST_RPAD_TASK (sinkpad) =
|
||||
gst_scheduler_create_task (GST_ELEMENT_SCHEDULER (amrnbparse),
|
||||
(GstTaskFunction) gst_amrnbparse_loop, sinkpad);
|
||||
gst_pad_peer_set_active (sinkpad, mode);
|
||||
|
||||
amrnbparse->need_header = TRUE;
|
||||
amrnbparse->seekable = TRUE;
|
||||
amrnbparse->ts = 0;
|
||||
gst_task_start (GST_RPAD_TASK (sinkpad));
|
||||
GST_STREAM_UNLOCK (sinkpad);
|
||||
result = TRUE;
|
||||
}
|
||||
amrnbparse->need_header = TRUE;
|
||||
amrnbparse->seekable = TRUE;
|
||||
amrnbparse->ts = 0;
|
||||
|
||||
result = gst_pad_start_task (sinkpad,
|
||||
(GstTaskFunction) gst_amrnbparse_loop, sinkpad);
|
||||
break;
|
||||
case GST_ACTIVATE_NONE:
|
||||
/* step 1, unblock clock sync (if any) */
|
||||
|
||||
/* step 2, make sure streaming finishes */
|
||||
GST_STREAM_LOCK (sinkpad);
|
||||
|
||||
/* step 3, stop the task */
|
||||
if (GST_RPAD_TASK (sinkpad)) {
|
||||
gst_task_stop (GST_RPAD_TASK (sinkpad));
|
||||
gst_object_unref (GST_OBJECT (GST_RPAD_TASK (sinkpad)));
|
||||
GST_RPAD_TASK (sinkpad) = NULL;
|
||||
}
|
||||
GST_STREAM_UNLOCK (sinkpad);
|
||||
|
||||
result = TRUE;
|
||||
result = gst_pad_stop_task (sinkpad);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue