update for task api change

This commit is contained in:
Wim Taymans 2012-06-20 10:34:48 +02:00
parent 9ad3761148
commit dbed726057
23 changed files with 49 additions and 38 deletions

View file

@ -256,7 +256,7 @@ gst_gme_dec_src_event (GstPad * pad, GstObject * parent, GstEvent * event)
gme->seeking = TRUE; gme->seeking = TRUE;
gst_pad_start_task (gme->srcpad, (GstTaskFunction) gst_gme_play, gst_pad_start_task (gme->srcpad, (GstTaskFunction) gst_gme_play,
gme->srcpad); gme->srcpad, NULL);
GST_PAD_STREAM_UNLOCK (gme->srcpad); GST_PAD_STREAM_UNLOCK (gme->srcpad);
result = TRUE; result = TRUE;
@ -461,7 +461,8 @@ gme_setup (GstGmeDec * gme)
gst_segment_init (&seg, GST_FORMAT_TIME); gst_segment_init (&seg, GST_FORMAT_TIME);
gst_pad_push_event (gme->srcpad, gst_event_new_segment (&seg)); gst_pad_push_event (gme->srcpad, gst_event_new_segment (&seg));
gst_pad_start_task (gme->srcpad, (GstTaskFunction) gst_gme_play, gme->srcpad); gst_pad_start_task (gme->srcpad, (GstTaskFunction) gst_gme_play, gme->srcpad,
NULL);
gme->initialized = TRUE; gme->initialized = TRUE;
gme->seeking = FALSE; gme->seeking = FALSE;

View file

@ -597,7 +597,8 @@ gst_mim_enc_change_state (GstElement * element, GstStateChange transition)
} }
GST_OBJECT_UNLOCK (mimenc); GST_OBJECT_UNLOCK (mimenc);
if (paused_mode) { if (paused_mode) {
if (!gst_pad_start_task (mimenc->srcpad, paused_mode_task, mimenc)) { if (!gst_pad_start_task (mimenc->srcpad, paused_mode_task, mimenc,
NULL)) {
ret = GST_STATE_CHANGE_FAILURE; ret = GST_STATE_CHANGE_FAILURE;
GST_ERROR_OBJECT (mimenc, "Can not start task"); GST_ERROR_OBJECT (mimenc, "Can not start task");
} }

View file

@ -402,7 +402,7 @@ gst_modplug_do_seek (GstModPlug * modplug, GstEvent * event)
gst_util_uint64_scale_int (cur, modplug->frequency, GST_SECOND); gst_util_uint64_scale_int (cur, modplug->frequency, GST_SECOND);
gst_pad_start_task (modplug->sinkpad, gst_pad_start_task (modplug->sinkpad,
(GstTaskFunction) gst_modplug_loop, modplug); (GstTaskFunction) gst_modplug_loop, modplug, NULL);
GST_PAD_STREAM_UNLOCK (modplug->sinkpad); GST_PAD_STREAM_UNLOCK (modplug->sinkpad);
@ -593,7 +593,7 @@ gst_modplug_sinkpad_activate_mode (GstPad * pad, GstObject * parent,
case GST_PAD_MODE_PULL: case GST_PAD_MODE_PULL:
if (active) { if (active) {
res = gst_pad_start_task (pad, (GstTaskFunction) gst_modplug_loop, res = gst_pad_start_task (pad, (GstTaskFunction) gst_modplug_loop,
modplug); modplug, NULL);
} else { } else {
res = gst_pad_stop_task (pad); res = gst_pad_stop_task (pad);
} }

View file

@ -406,7 +406,7 @@ gst_mpeg2enc_setcaps (GstMpeg2enc * enc, GstPad * pad, GstCaps * caps)
/* now that we have all the setup and buffers are expected incoming; /* now that we have all the setup and buffers are expected incoming;
* task can get going */ * task can get going */
gst_pad_start_task (enc->srcpad, (GstTaskFunction) gst_mpeg2enc_loop, enc); gst_pad_start_task (enc->srcpad, (GstTaskFunction) gst_mpeg2enc_loop, enc, NULL);
return TRUE; return TRUE;

View file

@ -537,7 +537,7 @@ gst_mplex_start_task (GstMplex * mplex)
if (G_UNLIKELY (mplex->srcresult == GST_FLOW_CUSTOM_SUCCESS) if (G_UNLIKELY (mplex->srcresult == GST_FLOW_CUSTOM_SUCCESS)
&& mplex->job->video_tracks == mplex->num_vpads && mplex->job->video_tracks == mplex->num_vpads
&& mplex->job->audio_tracks == mplex->num_apads) { && mplex->job->audio_tracks == mplex->num_apads) {
gst_pad_start_task (mplex->srcpad, (GstTaskFunction) gst_mplex_loop, mplex); gst_pad_start_task (mplex->srcpad, (GstTaskFunction) gst_mplex_loop, mplex, NULL);
mplex->srcresult = GST_FLOW_OK; mplex->srcresult = GST_FLOW_OK;
} }
} }

View file

@ -261,7 +261,7 @@ gst_musepackdec_handle_seek_event (GstMusepackDec * dec, GstEvent * event)
GST_DEBUG_OBJECT (dec, "seek successful"); GST_DEBUG_OBJECT (dec, "seek successful");
gst_pad_start_task (dec->sinkpad, gst_pad_start_task (dec->sinkpad,
(GstTaskFunction) gst_musepackdec_loop, dec->sinkpad); (GstTaskFunction) gst_musepackdec_loop, dec->sinkpad, NULL);
GST_PAD_STREAM_UNLOCK (dec->sinkpad); GST_PAD_STREAM_UNLOCK (dec->sinkpad);
@ -493,7 +493,7 @@ gst_musepackdec_sink_activate_pull (GstPad * sinkpad, gboolean active)
if (active) { if (active) {
result = gst_pad_start_task (sinkpad, result = gst_pad_start_task (sinkpad,
(GstTaskFunction) gst_musepackdec_loop, sinkpad); (GstTaskFunction) gst_musepackdec_loop, sinkpad, NULL);
} else { } else {
result = gst_pad_stop_task (sinkpad); result = gst_pad_stop_task (sinkpad);
} }

View file

@ -459,7 +459,7 @@ gst_sf_sink_activate_pull (GstBaseSink * basesink, gboolean active)
if (active) { if (active) {
/* start task */ /* start task */
result = gst_pad_start_task (basesink->sinkpad, result = gst_pad_start_task (basesink->sinkpad,
(GstTaskFunction) gst_sf_sink_loop, basesink->sinkpad); (GstTaskFunction) gst_sf_sink_loop, basesink->sinkpad, NULL);
} else { } else {
/* step 2, make sure streaming finishes */ /* step 2, make sure streaming finishes */
result = gst_pad_stop_task (basesink->sinkpad); result = gst_pad_stop_task (basesink->sinkpad);

View file

@ -325,7 +325,7 @@ gst_spc_dec_src_event (GstPad * pad, GstEvent * event)
spc->seeking = TRUE; spc->seeking = TRUE;
gst_pad_start_task (spc->srcpad, (GstTaskFunction) spc_play, gst_pad_start_task (spc->srcpad, (GstTaskFunction) spc_play,
spc->srcpad); spc->srcpad, NULL);
GST_PAD_STREAM_UNLOCK (spc->srcpad); GST_PAD_STREAM_UNLOCK (spc->srcpad);
result = TRUE; result = TRUE;
@ -534,7 +534,8 @@ spc_setup (GstSpcDec * spc)
gst_pad_push_event (spc->srcpad, gst_event_new_new_segment (FALSE, 1.0, gst_pad_push_event (spc->srcpad, gst_event_new_new_segment (FALSE, 1.0,
GST_FORMAT_TIME, 0, -1, 0)); GST_FORMAT_TIME, 0, -1, 0));
gst_pad_start_task (spc->srcpad, (GstTaskFunction) spc_play, spc->srcpad); gst_pad_start_task (spc->srcpad, (GstTaskFunction) spc_play, spc->srcpad,
NULL);
/* We can't unreference this buffer because we might need to re-initialize /* We can't unreference this buffer because we might need to re-initialize
* the emulator with the original data during a reverse seek * the emulator with the original data during a reverse seek

View file

@ -423,7 +423,7 @@ gst_timidity_src_event (GstPad * pad, GstEvent * event)
timidity->o_seek = TRUE; timidity->o_seek = TRUE;
gst_pad_start_task (timidity->sinkpad, gst_pad_start_task (timidity->sinkpad,
(GstTaskFunction) gst_timidity_loop, timidity->sinkpad); (GstTaskFunction) gst_timidity_loop, timidity->sinkpad, NULL);
GST_PAD_STREAM_UNLOCK (timidity->sinkpad); GST_PAD_STREAM_UNLOCK (timidity->sinkpad);
GST_DEBUG ("seek done"); GST_DEBUG ("seek done");
@ -451,7 +451,8 @@ static gboolean
gst_timidity_activatepull (GstPad * pad, gboolean active) gst_timidity_activatepull (GstPad * pad, gboolean active)
{ {
if (active) { if (active) {
return gst_pad_start_task (pad, (GstTaskFunction) gst_timidity_loop, pad); return gst_pad_start_task (pad, (GstTaskFunction) gst_timidity_loop, pad,
NULL);
} else { } else {
return gst_pad_stop_task (pad); return gst_pad_stop_task (pad);
} }

View file

@ -524,7 +524,7 @@ gst_wildmidi_do_seek (GstWildmidi * wildmidi, GstEvent * event)
gst_wildmidi_get_new_segment_event (wildmidi, GST_FORMAT_TIME)); gst_wildmidi_get_new_segment_event (wildmidi, GST_FORMAT_TIME));
gst_pad_start_task (wildmidi->sinkpad, gst_pad_start_task (wildmidi->sinkpad,
(GstTaskFunction) gst_wildmidi_loop, wildmidi->sinkpad); (GstTaskFunction) gst_wildmidi_loop, wildmidi->sinkpad, NULL);
wildmidi->discont = TRUE; wildmidi->discont = TRUE;
GST_PAD_STREAM_UNLOCK (wildmidi->sinkpad); GST_PAD_STREAM_UNLOCK (wildmidi->sinkpad);
@ -567,7 +567,8 @@ static gboolean
gst_wildmidi_activatepull (GstPad * pad, gboolean active) gst_wildmidi_activatepull (GstPad * pad, gboolean active)
{ {
if (active) { if (active) {
return gst_pad_start_task (pad, (GstTaskFunction) gst_wildmidi_loop, pad); return gst_pad_start_task (pad, (GstTaskFunction) gst_wildmidi_loop, pad,
NULL);
} else { } else {
return gst_pad_stop_task (pad); return gst_pad_stop_task (pad);
} }
@ -777,7 +778,7 @@ gst_wildmidi_sink_event (GstPad * pad, GstEvent * event)
wildmidi->state = GST_WILDMIDI_STATE_PARSE; wildmidi->state = GST_WILDMIDI_STATE_PARSE;
/* now start the parsing task */ /* now start the parsing task */
gst_pad_start_task (wildmidi->sinkpad, gst_pad_start_task (wildmidi->sinkpad,
(GstTaskFunction) gst_wildmidi_loop, wildmidi->sinkpad); (GstTaskFunction) gst_wildmidi_loop, wildmidi->sinkpad, NULL);
/* don't forward the event */ /* don't forward the event */
gst_event_unref (event); gst_event_unref (event);
break; break;

View file

@ -480,7 +480,7 @@ gst_aiff_parse_perform_seek (GstAiffParse * aiff, GstEvent * event)
aiff->segment_running = TRUE; aiff->segment_running = TRUE;
if (!aiff->streaming) { if (!aiff->streaming) {
gst_pad_start_task (aiff->sinkpad, (GstTaskFunction) gst_aiff_parse_loop, gst_pad_start_task (aiff->sinkpad, (GstTaskFunction) gst_aiff_parse_loop,
aiff->sinkpad); aiff->sinkpad, NULL);
} }
GST_PAD_STREAM_UNLOCK (aiff->sinkpad); GST_PAD_STREAM_UNLOCK (aiff->sinkpad);
@ -1600,7 +1600,7 @@ gst_aiff_parse_sink_activate_pull (GstPad * sinkpad, gboolean active)
if (active) { if (active) {
aiff->segment_running = TRUE; aiff->segment_running = TRUE;
return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_aiff_parse_loop, return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_aiff_parse_loop,
sinkpad); sinkpad, NULL);
} else { } else {
aiff->segment_running = FALSE; aiff->segment_running = FALSE;
return gst_pad_stop_task (sinkpad); return gst_pad_stop_task (sinkpad);

View file

@ -100,7 +100,8 @@ gst_asf_parse_sink_activate_mode (GstPad * pad, GstObject * parent,
case GST_PAD_MODE_PULL: case GST_PAD_MODE_PULL:
if (active) { if (active) {
res = res =
gst_pad_start_task (pad, (GstTaskFunction) gst_asf_parse_loop, pad); gst_pad_start_task (pad, (GstTaskFunction) gst_asf_parse_loop, pad,
NULL);
} else { } else {
res = gst_pad_stop_task (pad); res = gst_pad_stop_task (pad);
} }

View file

@ -192,7 +192,7 @@ gst_cdxa_parse_sink_activate_pull (GstPad * sinkpad, gboolean active)
if (active) { if (active) {
/* if we have a scheduler we can start the task */ /* if we have a scheduler we can start the task */
gst_pad_start_task (sinkpad, (GstTaskFunction) gst_cdxa_parse_loop, gst_pad_start_task (sinkpad, (GstTaskFunction) gst_cdxa_parse_loop,
sinkpad); sinkpad, NULL);
} else { } else {
gst_pad_stop_task (sinkpad); gst_pad_stop_task (sinkpad);
} }
@ -466,7 +466,7 @@ gst_cdxa_parse_do_seek (GstCDXAParse * cdxa, GstEvent * event)
/* and restart */ /* and restart */
gst_pad_start_task (cdxa->sinkpad, gst_pad_start_task (cdxa->sinkpad,
(GstTaskFunction) gst_cdxa_parse_loop, cdxa->sinkpad); (GstTaskFunction) gst_cdxa_parse_loop, cdxa->sinkpad, NULL);
GST_PAD_STREAM_UNLOCK (cdxa->sinkpad); GST_PAD_STREAM_UNLOCK (cdxa->sinkpad);
return TRUE; return TRUE;

View file

@ -316,7 +316,7 @@ gst_freeze_sink_activate_pull (GstPad * sinkpad, gboolean active)
if (active) { if (active) {
/* if we have a scheduler we can start the task */ /* if we have a scheduler we can start the task */
result = gst_pad_start_task (sinkpad, result = gst_pad_start_task (sinkpad,
(GstTaskFunction) gst_freeze_loop, sinkpad); (GstTaskFunction) gst_freeze_loop, sinkpad, NULL);
} else { } else {
result = gst_pad_stop_task (sinkpad); result = gst_pad_stop_task (sinkpad);
} }

View file

@ -234,14 +234,14 @@ gst_hls_demux_init (GstHLSDemux * demux)
/* Updates task */ /* Updates task */
g_rec_mutex_init (&demux->updates_lock); g_rec_mutex_init (&demux->updates_lock);
demux->updates_task = demux->updates_task =
gst_task_new ((GstTaskFunction) gst_hls_demux_updates_loop, demux); gst_task_new ((GstTaskFunction) gst_hls_demux_updates_loop, demux, NULL);
gst_task_set_lock (demux->updates_task, &demux->updates_lock); gst_task_set_lock (demux->updates_task, &demux->updates_lock);
g_mutex_init (&demux->updates_timed_lock); g_mutex_init (&demux->updates_timed_lock);
/* Streaming task */ /* Streaming task */
g_rec_mutex_init (&demux->stream_lock); g_rec_mutex_init (&demux->stream_lock);
demux->stream_task = demux->stream_task =
gst_task_new ((GstTaskFunction) gst_hls_demux_stream_loop, demux); gst_task_new ((GstTaskFunction) gst_hls_demux_stream_loop, demux, NULL);
gst_task_set_lock (demux->stream_task, &demux->stream_lock); gst_task_set_lock (demux->stream_task, &demux->stream_lock);
} }

View file

@ -458,7 +458,7 @@ gst_live_adder_src_activate_push (GstPad * pad, gboolean active)
/* start pushing out buffers */ /* start pushing out buffers */
GST_DEBUG_OBJECT (adder, "Starting task on srcpad"); GST_DEBUG_OBJECT (adder, "Starting task on srcpad");
gst_pad_start_task (adder->srcpad, gst_pad_start_task (adder->srcpad,
(GstTaskFunction) gst_live_adder_loop, adder); (GstTaskFunction) gst_live_adder_loop, adder, NULL);
} else { } else {
/* make sure all data processing stops ASAP */ /* make sure all data processing stops ASAP */
gst_live_adder_flush_start (adder); gst_live_adder_flush_start (adder);

View file

@ -1243,7 +1243,7 @@ gst_flups_demux_handle_seek_pull (GstFluPSDemux * demux, GstEvent * event)
gst_flups_demux_mark_discont (demux, TRUE, TRUE); gst_flups_demux_mark_discont (demux, TRUE, TRUE);
gst_pad_start_task (demux->sinkpad, gst_pad_start_task (demux->sinkpad,
(GstTaskFunction) gst_flups_demux_loop, demux->sinkpad); (GstTaskFunction) gst_flups_demux_loop, demux->sinkpad, NULL);
GST_PAD_STREAM_UNLOCK (demux->sinkpad); GST_PAD_STREAM_UNLOCK (demux->sinkpad);
@ -2920,7 +2920,7 @@ gst_flups_demux_sink_activate_pull (GstPad * sinkpad, GstObject * parent,
demux->random_access = TRUE; demux->random_access = TRUE;
gst_object_unref (demux); gst_object_unref (demux);
return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_flups_demux_loop, return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_flups_demux_loop,
sinkpad); sinkpad, NULL);
} else { } else {
demux->random_access = FALSE; demux->random_access = FALSE;
gst_object_unref (demux); gst_object_unref (demux);

View file

@ -1712,7 +1712,8 @@ mpegts_base_handle_seek_event (MpegTSBase * base, GstPad * pad,
} }
//else //else
done: done:
gst_pad_start_task (base->sinkpad, (GstTaskFunction) mpegts_base_loop, base); gst_pad_start_task (base->sinkpad, (GstTaskFunction) mpegts_base_loop, base,
NULL);
push_mode: push_mode:
GST_PAD_STREAM_UNLOCK (base->sinkpad); GST_PAD_STREAM_UNLOCK (base->sinkpad);
return ret == GST_FLOW_OK; return ret == GST_FLOW_OK;
@ -1766,7 +1767,8 @@ mpegts_base_sink_activate_mode (GstPad * pad, GstObject * parent,
base->mode = BASE_MODE_SCANNING; base->mode = BASE_MODE_SCANNING;
base->packetizer->calculate_offset = TRUE; base->packetizer->calculate_offset = TRUE;
res = res =
gst_pad_start_task (pad, (GstTaskFunction) mpegts_base_loop, base); gst_pad_start_task (pad, (GstTaskFunction) mpegts_base_loop, base,
NULL);
} else } else
res = gst_pad_stop_task (pad); res = gst_pad_stop_task (pad);
break; break;

View file

@ -3360,7 +3360,7 @@ gst_mxf_demux_seek_pull (GstMXFDemux * demux, GstEvent * event)
demux->seqnum = seqnum; demux->seqnum = seqnum;
gst_pad_start_task (demux->sinkpad, gst_pad_start_task (demux->sinkpad,
(GstTaskFunction) gst_mxf_demux_loop, demux->sinkpad); (GstTaskFunction) gst_mxf_demux_loop, demux->sinkpad, NULL);
GST_PAD_STREAM_UNLOCK (demux->sinkpad); GST_PAD_STREAM_UNLOCK (demux->sinkpad);
@ -3380,7 +3380,7 @@ wrong_rate:
unresolved_metadata: unresolved_metadata:
{ {
gst_pad_start_task (demux->sinkpad, gst_pad_start_task (demux->sinkpad,
(GstTaskFunction) gst_mxf_demux_loop, demux->sinkpad); (GstTaskFunction) gst_mxf_demux_loop, demux->sinkpad, NULL);
GST_PAD_STREAM_UNLOCK (demux->sinkpad); GST_PAD_STREAM_UNLOCK (demux->sinkpad);
GST_WARNING_OBJECT (demux, "metadata can't be resolved"); GST_WARNING_OBJECT (demux, "metadata can't be resolved");
return FALSE; return FALSE;
@ -3592,7 +3592,7 @@ gst_mxf_demux_sink_activate_pull (GstPad * sinkpad, gboolean active)
demux->random_access = TRUE; demux->random_access = TRUE;
gst_object_unref (demux); gst_object_unref (demux);
return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_mxf_demux_loop, return gst_pad_start_task (sinkpad, (GstTaskFunction) gst_mxf_demux_loop,
sinkpad); sinkpad, NULL);
} else { } else {
demux->random_access = FALSE; demux->random_access = FALSE;
gst_object_unref (demux); gst_object_unref (demux);

View file

@ -397,7 +397,7 @@ start_play_tune (GstNsfDec * nsfdec)
gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, 0, -1, 0)); gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_TIME, 0, -1, 0));
res = gst_pad_start_task (nsfdec->srcpad, res = gst_pad_start_task (nsfdec->srcpad,
(GstTaskFunction) play_loop, nsfdec->srcpad); (GstTaskFunction) play_loop, nsfdec->srcpad, NULL);
return res; return res;

View file

@ -824,7 +824,8 @@ gst_nuv_demux_sink_activate_pull (GstPad * sinkpad, gboolean active)
GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad)); GstNuvDemux *nuv = GST_NUV_DEMUX (gst_pad_get_parent (sinkpad));
if (active) { if (active) {
gst_pad_start_task (sinkpad, (GstTaskFunction) gst_nuv_demux_loop, sinkpad); gst_pad_start_task (sinkpad, (GstTaskFunction) gst_nuv_demux_loop, sinkpad,
NULL);
} else { } else {
gst_pad_stop_task (sinkpad); gst_pad_stop_task (sinkpad);
} }

View file

@ -864,7 +864,8 @@ gst_raw_parse_handle_seek_pull (GstRawParse * rp, GstEvent * event)
rp->discont = TRUE; rp->discont = TRUE;
GST_LOG_OBJECT (rp, "start streaming"); GST_LOG_OBJECT (rp, "start streaming");
gst_pad_start_task (rp->sinkpad, (GstTaskFunction) gst_raw_parse_loop, rp); gst_pad_start_task (rp->sinkpad, (GstTaskFunction) gst_raw_parse_loop, rp,
NULL);
GST_PAD_STREAM_UNLOCK (rp->sinkpad); GST_PAD_STREAM_UNLOCK (rp->sinkpad);

View file

@ -215,7 +215,7 @@ gst_tta_parse_src_event (GstPad * pad, GstEvent * event)
ttaparse->num_frames * FRAME_TIME * GST_SECOND, 0)); ttaparse->num_frames * FRAME_TIME * GST_SECOND, 0));
gst_pad_start_task (ttaparse->sinkpad, gst_pad_start_task (ttaparse->sinkpad,
(GstTaskFunction) gst_tta_parse_loop, ttaparse); (GstTaskFunction) gst_tta_parse_loop, ttaparse, NULL);
GST_PAD_STREAM_UNLOCK (ttaparse->sinkpad); GST_PAD_STREAM_UNLOCK (ttaparse->sinkpad);
@ -312,7 +312,8 @@ gst_tta_parse_activate_pull (GstPad * pad, gboolean active)
GstTtaParse *ttaparse = GST_TTA_PARSE (GST_OBJECT_PARENT (pad)); GstTtaParse *ttaparse = GST_TTA_PARSE (GST_OBJECT_PARENT (pad));
if (active) { if (active) {
gst_pad_start_task (pad, (GstTaskFunction) gst_tta_parse_loop, ttaparse); gst_pad_start_task (pad, (GstTaskFunction) gst_tta_parse_loop, ttaparse,
NULL);
} else { } else {
gst_pad_stop_task (pad); gst_pad_stop_task (pad);
} }