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:
Wim Taymans 2005-05-25 12:55:50 +00:00
parent 7a89ecf2dd
commit 0e06450bdf
4 changed files with 23 additions and 43 deletions

View file

@ -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> 2005-05-19 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* configure.ac: * configure.ac:

View file

@ -173,8 +173,6 @@ gst_amrnbdec_chain (GstPad * pad, GstBuffer * buffer)
amrnbdec = GST_AMRNBDEC (GST_PAD_PARENT (pad)); amrnbdec = GST_AMRNBDEC (GST_PAD_PARENT (pad));
GST_STREAM_LOCK (pad);
if (amrnbdec->rate == 0 || amrnbdec->channels == 0) if (amrnbdec->rate == 0 || amrnbdec->channels == 0)
goto not_negotiated; goto not_negotiated;
@ -219,13 +217,11 @@ gst_amrnbdec_chain (GstPad * pad, GstBuffer * buffer)
/* play */ /* play */
ret = gst_pad_push (amrnbdec->srcpad, out); ret = gst_pad_push (amrnbdec->srcpad, out);
} }
GST_STREAM_UNLOCK (pad);
return ret; return ret;
not_negotiated: not_negotiated:
{ {
GST_STREAM_UNLOCK (pad);
return GST_FLOW_NOT_NEGOTIATED; return GST_FLOW_NOT_NEGOTIATED;
} }
} }

View file

@ -192,7 +192,6 @@ gst_amrnbenc_chain (GstPad * pad, GstBuffer * buffer)
amrnbenc = GST_AMRNBENC (GST_PAD_PARENT (pad)); amrnbenc = GST_AMRNBENC (GST_PAD_PARENT (pad));
GST_STREAM_LOCK (pad);
if (amrnbenc->rate == 0 || amrnbenc->channels == 0) if (amrnbenc->rate == 0 || amrnbenc->channels == 0)
goto not_negotiated; goto not_negotiated;
@ -230,13 +229,10 @@ gst_amrnbenc_chain (GstPad * pad, GstBuffer * buffer)
ret = gst_pad_push (amrnbenc->srcpad, out); ret = gst_pad_push (amrnbenc->srcpad, out);
} }
GST_STREAM_UNLOCK (pad);
return ret; return ret;
not_negotiated: not_negotiated:
{ {
GST_STREAM_UNLOCK (pad);
return GST_FLOW_NOT_NEGOTIATED; return GST_FLOW_NOT_NEGOTIATED;
} }
} }

View file

@ -266,8 +266,6 @@ gst_amrnbparse_chain (GstPad * pad, GstBuffer * buffer)
amrnbparse = GST_AMRNBPARSE (GST_PAD_PARENT (pad)); amrnbparse = GST_AMRNBPARSE (GST_PAD_PARENT (pad));
GST_STREAM_LOCK (pad);
gst_adapter_push (amrnbparse->adapter, buffer); gst_adapter_push (amrnbparse->adapter, buffer);
res = GST_FLOW_OK; res = GST_FLOW_OK;
@ -317,7 +315,6 @@ gst_amrnbparse_chain (GstPad * pad, GstBuffer * buffer)
gst_adapter_flush (amrnbparse->adapter, block); gst_adapter_flush (amrnbparse->adapter, block);
} }
done: done:
GST_STREAM_UNLOCK (pad);
return res; return res;
} }
@ -373,7 +370,6 @@ gst_amrnbparse_loop (GstPad * pad)
amrnbparse = GST_AMRNBPARSE (GST_PAD_PARENT (pad)); amrnbparse = GST_AMRNBPARSE (GST_PAD_PARENT (pad));
GST_STREAM_LOCK (pad);
/* init */ /* init */
if (amrnbparse->need_header) { if (amrnbparse->need_header) {
gboolean got_header; gboolean got_header;
@ -424,23 +420,19 @@ gst_amrnbparse_loop (GstPad * pad)
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)
goto need_pause; goto need_pause;
GST_STREAM_UNLOCK (pad);
return; return;
need_pause: need_pause:
{ {
GST_LOG_OBJECT (amrnbparse, "pausing task"); GST_LOG_OBJECT (amrnbparse, "pausing task");
gst_task_pause (GST_RPAD_TASK (pad)); gst_pad_pause_task (pad);
GST_STREAM_UNLOCK (pad);
return; return;
} }
eos: eos:
{ {
GST_LOG_OBJECT (amrnbparse, "pausing task"); GST_LOG_OBJECT (amrnbparse, "pausing task");
gst_pad_push_event (amrnbparse->srcpad, gst_event_new (GST_EVENT_EOS)); gst_pad_push_event (amrnbparse->srcpad, gst_event_new (GST_EVENT_EOS));
gst_task_pause (GST_RPAD_TASK (pad)); gst_pad_pause_task (pad);
GST_STREAM_UNLOCK (pad);
return; return;
} }
} }
@ -459,37 +451,20 @@ gst_amrnbparse_sink_activate (GstPad * sinkpad, GstActivateMode mode)
result = TRUE; result = TRUE;
break; break;
case GST_ACTIVATE_PULL: case GST_ACTIVATE_PULL:
/* if we have a scheduler we can start the task */ gst_pad_peer_set_active (sinkpad, mode);
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);
amrnbparse->need_header = TRUE; amrnbparse->need_header = TRUE;
amrnbparse->seekable = TRUE; amrnbparse->seekable = TRUE;
amrnbparse->ts = 0; amrnbparse->ts = 0;
gst_task_start (GST_RPAD_TASK (sinkpad));
GST_STREAM_UNLOCK (sinkpad); result = gst_pad_start_task (sinkpad,
result = TRUE; (GstTaskFunction) gst_amrnbparse_loop, sinkpad);
}
break; break;
case GST_ACTIVATE_NONE: case GST_ACTIVATE_NONE:
/* step 1, unblock clock sync (if any) */ /* step 1, unblock clock sync (if any) */
/* step 2, make sure streaming finishes */ /* step 2, make sure streaming finishes */
GST_STREAM_LOCK (sinkpad); result = gst_pad_stop_task (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;
break; break;
} }
return result; return result;