gst/playback/: Refcount fix and more comments.

Original commit message from CVS:
* gst/playback/gstplaybasebin.c: (gen_preroll_element):
* gst/playback/gstplaybin.c: (setup_sinks),
(gst_play_bin_change_state):
Refcount fix and more comments.
This commit is contained in:
Wim Taymans 2005-07-21 20:01:46 +00:00
parent 10c6b4727b
commit fab0527680
3 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2005-07-21 Wim Taymans <wim@fluendo.com>
* gst/playback/gstplaybasebin.c: (gen_preroll_element):
* gst/playback/gstplaybin.c: (setup_sinks),
(gst_play_bin_change_state):
Refcount fix and more comments.
2005-07-21 Zaheer Abbas Merali <zaheerabbas at merali dot org> 2005-07-21 Zaheer Abbas Merali <zaheerabbas at merali dot org>
* sys/ximage/Makefile.am: * sys/ximage/Makefile.am:

View file

@ -560,17 +560,17 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin,
g_return_if_reached (); g_return_if_reached ();
/* create stream selector */ /* create stream selector */
selector = g_object_new (GST_TYPE_STREAM_SELECTOR, NULL);
padname = gst_pad_get_name (pad); padname = gst_pad_get_name (pad);
name = g_strdup_printf ("selector_%s_%s", prename, padname); name = g_strdup_printf ("selector_%s_%s", prename, padname);
selector = g_object_new (GST_TYPE_STREAM_SELECTOR, NULL);
gst_object_set_name (GST_OBJECT (selector), name); gst_object_set_name (GST_OBJECT (selector), name);
g_free (name); g_free (name);
/* create preroll queue */ /* create preroll queue */
name = g_strdup_printf ("preroll_%s_%s", prename, padname); name = g_strdup_printf ("preroll_%s_%s", prename, padname);
preroll = gst_element_factory_make ("queue", name); preroll = gst_element_factory_make ("queue", name);
g_free (padname);
g_free (name); g_free (name);
g_free (padname);
g_object_set (G_OBJECT (preroll), g_object_set (G_OBJECT (preroll),
"max-size-buffers", 0, "max-size-bytes", "max-size-buffers", 0, "max-size-bytes",
@ -611,9 +611,11 @@ gen_preroll_element (GstPlayBaseBin * play_base_bin,
/* listen for EOS */ /* listen for EOS */
preroll_pad = gst_element_get_pad (preroll, "src"); preroll_pad = gst_element_get_pad (preroll, "src");
gst_pad_add_event_probe (preroll_pad, G_CALLBACK (probe_triggered), info); gst_pad_add_event_probe (preroll_pad, G_CALLBACK (probe_triggered), info);
gst_object_unref (preroll_pad);
/* add to group list */ /* add to group list */
/* FIXME refcount elements */ /* FIXME refcount elements, after bin_add, object refs are invalid since
* it takes ownership. */
group->type[type - 1].selector = selector; group->type[type - 1].selector = selector;
group->type[type - 1].preroll = preroll; group->type[type - 1].preroll = preroll;
if (type == GST_STREAM_TYPE_TEXT && play_base_bin->subtitle) { if (type == GST_STREAM_TYPE_TEXT && play_base_bin->subtitle) {

View file

@ -827,6 +827,8 @@ setup_sinks (GstPlayBaseBin * play_base_bin, GstPlayBaseGroup * group)
gst_object_unref (pad); gst_object_unref (pad);
} }
/* remove the sinks now, pipeline get_state will now wait for the
* sinks to preroll */
if (play_bin->fakesink) { if (play_bin->fakesink) {
gst_bin_remove (GST_BIN (play_bin), play_bin->fakesink); gst_bin_remove (GST_BIN (play_bin), play_bin->fakesink);
play_bin->fakesink = NULL; play_bin->fakesink = NULL;
@ -846,6 +848,8 @@ gst_play_bin_change_state (GstElement * element)
switch (transition) { switch (transition) {
case GST_STATE_READY_TO_PAUSED: case GST_STATE_READY_TO_PAUSED:
/* this really is the easiest way to make the state change return
* ASYNC until we added the sinks */
if (!play_bin->fakesink) { if (!play_bin->fakesink) {
play_bin->fakesink = gst_element_factory_make ("fakesink", "test"); play_bin->fakesink = gst_element_factory_make ("fakesink", "test");
gst_bin_add (GST_BIN (play_bin), play_bin->fakesink); gst_bin_add (GST_BIN (play_bin), play_bin->fakesink);