Commit ded2471f authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠
Browse files

Fix for collect pads API change. Also fix textoverlay state change function.

Original commit message from CVS:
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_init),
(gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad),
(gst_matroska_mux_best_pad), (gst_matroska_mux_change_state):
* gst/smpte/gstsmpte.c: (gst_smpte_init), (gst_smpte_collected):
* gst/videomixer/videomixer.c: (gst_videomixer_init),
(gst_videomixer_request_new_pad), (gst_videomixer_fill_queues),
(gst_videomixer_change_state):
Fix for collect pads API change. Also fix textoverlay state
change function.
parent 7ab7f62d
2005-11-21 Tim-Philipp Müller <tim at centricular dot net>
* ext/cairo/gsttextoverlay.c: (gst_text_overlay_finalize),
(gst_text_overlay_init), (gst_text_overlay_text_pad_linked),
(gst_text_overlay_text_pad_unlinked), (gst_text_overlay_pop_video),
(gst_text_overlay_pop_text), (gst_text_overlay_collected),
(gst_text_overlay_change_state):
* gst/matroska/matroska-mux.c: (gst_matroska_mux_init),
(gst_matroska_mux_reset), (gst_matroska_mux_request_new_pad),
(gst_matroska_mux_best_pad), (gst_matroska_mux_change_state):
* gst/smpte/gstsmpte.c: (gst_smpte_init), (gst_smpte_collected):
* gst/videomixer/videomixer.c: (gst_videomixer_init),
(gst_videomixer_request_new_pad), (gst_videomixer_fill_queues),
(gst_videomixer_change_state):
Fix for collect pads API change. Also fix textoverlay state
change function.
2005-11-20 Julien MOUTTE <julien@moutte.net>
* gst/matroska/matroska-mux.c: (gst_matroska_mux_start): Replace
......
......@@ -192,7 +192,7 @@ gst_text_overlay_finalize (GObject * object)
{
GstTextOverlay *overlay = GST_TEXT_OVERLAY (object);
gst_collectpads_stop (overlay->collect);
gst_collect_pads_stop (overlay->collect);
gst_object_unref (overlay->collect);
g_free (overlay->text_fill_image);
......@@ -253,12 +253,12 @@ gst_text_overlay_init (GstTextOverlay * overlay, GstTextOverlayClass * klass)
overlay->framerate = 0.0;
overlay->collect = gst_collectpads_new ();
overlay->collect = gst_collect_pads_new ();
gst_collectpads_set_function (overlay->collect,
gst_collect_pads_set_function (overlay->collect,
GST_DEBUG_FUNCPTR (gst_text_overlay_collected), overlay);
overlay->video_collect_data = gst_collectpads_add_pad (overlay->collect,
overlay->video_collect_data = gst_collect_pads_add_pad (overlay->collect,
overlay->video_sinkpad, sizeof (GstCollectData));
/* text pad will be added when it is linked */
......@@ -563,7 +563,7 @@ gst_text_overlay_text_pad_linked (GstPad * pad, GstPad * peer)
GST_DEBUG_OBJECT (overlay, "Text pad linked");
if (overlay->text_collect_data == NULL) {
overlay->text_collect_data = gst_collectpads_add_pad (overlay->collect,
overlay->text_collect_data = gst_collect_pads_add_pad (overlay->collect,
overlay->text_sinkpad, sizeof (GstCollectData));
}
......@@ -583,7 +583,7 @@ gst_text_overlay_text_pad_unlinked (GstPad * pad)
GST_DEBUG_OBJECT (overlay, "Text pad unlinked");
if (overlay->text_collect_data) {
gst_collectpads_remove_pad (overlay->collect, overlay->text_sinkpad);
gst_collect_pads_remove_pad (overlay->collect, overlay->text_sinkpad);
overlay->text_collect_data = NULL;
}
......@@ -724,7 +724,7 @@ gst_text_overlay_pop_video (GstTextOverlay * overlay)
{
GstBuffer *buf;
buf = gst_collectpads_pop (overlay->collect, overlay->video_collect_data);
buf = gst_collect_pads_pop (overlay->collect, overlay->video_collect_data);
g_return_if_fail (buf != NULL);
gst_buffer_unref (buf);
}
......@@ -735,7 +735,7 @@ gst_text_overlay_pop_text (GstTextOverlay * overlay)
GstBuffer *buf;
if (overlay->text_collect_data) {
buf = gst_collectpads_pop (overlay->collect, overlay->text_collect_data);
buf = gst_collect_pads_pop (overlay->collect, overlay->text_collect_data);
g_return_if_fail (buf != NULL);
gst_buffer_unref (buf);
}
......@@ -757,14 +757,14 @@ gst_text_overlay_collected (GstCollectPads * pads, gpointer data)
GST_DEBUG ("Collecting");
video_frame = gst_collectpads_peek (overlay->collect,
video_frame = gst_collect_pads_peek (overlay->collect,
overlay->video_collect_data);
/* send EOS if video stream EOSed regardless of text stream */
if (video_frame == NULL) {
GST_DEBUG ("Video stream at EOS");
if (overlay->text_collect_data) {
text_buf = gst_collectpads_pop (overlay->collect,
text_buf = gst_collect_pads_pop (overlay->collect,
overlay->text_collect_data);
}
gst_pad_push_event (overlay->srcpad, gst_event_new_eos ());
......@@ -806,7 +806,7 @@ gst_text_overlay_collected (GstCollectPads * pads, gpointer data)
goto done;
}
text_buf = gst_collectpads_peek (overlay->collect,
text_buf = gst_collect_pads_peek (overlay->collect,
overlay->text_collect_data);
/* just push the video frame if the text stream has EOSed */
......@@ -880,7 +880,12 @@ gst_text_overlay_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_collectpads_start (overlay->collect);
gst_collect_pads_start (overlay->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
/* need to unblock the collectpads before calling the
* parent change_state so that streaming can finish */
gst_collect_pads_stop (overlay->collect);
break;
default:
break;
......@@ -891,9 +896,6 @@ gst_text_overlay_change_state (GstElement * element, GstStateChange transition)
return ret;
switch (transition) {
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_collectpads_stop (overlay->collect);
break;
default:
break;
}
......
......@@ -230,8 +230,8 @@ gst_matroska_mux_init (GstMatroskaMux * mux, GstMatroskaMuxClass * g_class)
gst_pad_set_event_function (mux->srcpad, gst_matroska_mux_handle_src_event);
gst_element_add_pad (GST_ELEMENT (mux), mux->srcpad);
mux->collect = gst_collectpads_new ();
gst_collectpads_set_function (mux->collect,
mux->collect = gst_collect_pads_new ();
gst_collect_pads_set_function (mux->collect,
(GstCollectPadsFunction) gst_matroska_mux_collected, mux);
mux->ebml_write = gst_ebml_write_new (mux->srcpad);
......@@ -339,7 +339,7 @@ gst_matroska_mux_reset (GstElement * element)
}
/* remove from collectpads */
gst_collectpads_remove_pad (mux->collect, thepad);
gst_collect_pads_remove_pad (mux->collect, thepad);
}
mux->num_streams = 0;
mux->num_a_streams = 0;
......@@ -873,7 +873,7 @@ gst_matroska_mux_request_new_pad (GstElement * element,
newpad = gst_pad_new_from_template (templ, name);
g_free (name);
collect_pad = (GstMatroskaPad *)
gst_collectpads_add_pad (mux->collect, newpad, sizeof (GstMatroskaPad));
gst_collect_pads_add_pad (mux->collect, newpad, sizeof (GstMatroskaPad));
context->flags = GST_MATROSKA_TRACK_ENABLED | GST_MATROSKA_TRACK_DEFAULT;
collect_pad->track = context;
collect_pad->buffer = NULL;
......@@ -1261,7 +1261,7 @@ gst_matroska_mux_best_pad (GstMatroskaMux * mux)
collect_pad = (GstMatroskaPad *) collected->data;
/* fetch a new buffer if needed */
if (collect_pad->buffer == NULL) {
collect_pad->buffer = gst_collectpads_pop (mux->collect,
collect_pad->buffer = gst_collect_pads_pop (mux->collect,
(GstCollectData *) collect_pad);
}
......@@ -1521,7 +1521,7 @@ gst_matroska_mux_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_NULL_TO_READY:
break;
case GST_STATE_CHANGE_READY_TO_PAUSED:
gst_collectpads_start (mux->collect);
gst_collect_pads_start (mux->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
break;
......@@ -1535,7 +1535,7 @@ gst_matroska_mux_change_state (GstElement * element, GstStateChange transition)
case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
gst_collectpads_stop (mux->collect);
gst_collect_pads_stop (mux->collect);
gst_matroska_mux_reset (GST_ELEMENT (mux));
break;
case GST_STATE_CHANGE_READY_TO_NULL:
......
......@@ -278,14 +278,14 @@ gst_smpte_init (GstSMPTE * smpte)
(&gst_smpte_src_template), "src");
gst_element_add_pad (GST_ELEMENT (smpte), smpte->srcpad);
smpte->collect = gst_collectpads_new ();
gst_collectpads_set_function (smpte->collect,
smpte->collect = gst_collect_pads_new ();
gst_collect_pads_set_function (smpte->collect,
(GstCollectPadsFunction) gst_smpte_collected, smpte);
gst_collectpads_start (smpte->collect);
gst_collect_pads_start (smpte->collect);
gst_collectpads_add_pad (smpte->collect, smpte->sinkpad1,
gst_collect_pads_add_pad (smpte->collect, smpte->sinkpad1,
sizeof (GstCollectData));
gst_collectpads_add_pad (smpte->collect, smpte->sinkpad2,
gst_collect_pads_add_pad (smpte->collect, smpte->sinkpad2,
sizeof (GstCollectData));
smpte->width = 320;
......@@ -357,9 +357,9 @@ gst_smpte_collected (GstCollectPads * pads, GstSMPTE * smpte)
data = (GstCollectData *) collected->data;
if (data->pad == smpte->sinkpad1)
in1 = gst_collectpads_pop (pads, data);
in1 = gst_collect_pads_pop (pads, data);
else if (data->pad == smpte->sinkpad2)
in2 = gst_collectpads_pop (pads, data);
in2 = gst_collect_pads_pop (pads, data);
}
if (in1 == NULL) {
......
......@@ -490,14 +490,14 @@ gst_videomixer_init (GstVideoMixer * mix)
gst_pad_set_getcaps_function (GST_PAD (mix->srcpad), gst_videomixer_getcaps);
gst_element_add_pad (GST_ELEMENT (mix), mix->srcpad);
mix->collect = gst_collectpads_new ();
mix->collect = gst_collect_pads_new ();
mix->background = DEFAULT_BACKGROUND;
mix->in_width = 0;
mix->in_height = 0;
mix->out_width = 0;
mix->out_height = 0;
gst_collectpads_set_function (mix->collect,
gst_collect_pads_set_function (mix->collect,
(GstCollectPadsFunction) gst_videomixer_collected, mix);
}
......@@ -572,7 +572,7 @@ gst_videomixer_request_new_pad (GstElement * element,
mixpad->alpha = DEFAULT_PAD_ALPHA;
mixcol = (GstVideoMixerCollect *)
gst_collectpads_add_pad (mix->collect, GST_PAD (mixpad),
gst_collect_pads_add_pad (mix->collect, GST_PAD (mixpad),
sizeof (GstVideoMixerCollect));
/* Keep track of eachother */
......@@ -885,7 +885,7 @@ gst_videomixer_fill_queues (GstVideoMixer * mix)
GST_LOG ("we need a new buffer");
buf = gst_collectpads_pop (mix->collect, data);
buf = gst_collect_pads_pop (mix->collect, data);
if (buf) {
guint64 duration;
......@@ -1175,11 +1175,11 @@ gst_videomixer_change_state (GstElement * element, GstStateChange transition)
switch (transition) {
case GST_STATE_CHANGE_READY_TO_PAUSED:
GST_LOG ("starting collectpads");
gst_collectpads_start (mix->collect);
gst_collect_pads_start (mix->collect);
break;
case GST_STATE_CHANGE_PAUSED_TO_READY:
GST_LOG ("stopping collectpads");
gst_collectpads_stop (mix->collect);
gst_collect_pads_stop (mix->collect);
break;
default:
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment