[gst-devel] spider snippet and looping question
Thomas Comiotto
comiotto at rcfmedia.ch
Tue Jan 27 14:53:08 CET 2004
hi ronald and all,
> > I am successfully running the following pipeline with gst-launch-0.7:
> > filesrc location=pathtosomempegfile ! spider ! colorspace ! ximagesink
> >
> > However, the equivalent c-code fails with:
> > WARNING **: error scheduling group 0x822f1c8
> > ERROR scheduler( 2746)
> > gstoptimalscheduler.c(2074):gst_opt_scheduler_iterate:
> > [GstOptScheduler at 0x81dcd88] in error state
> >
> > The minimalistic code basically consists of an iterated bin containing
> > the four listed elements above. Shouldn't be a coding error or something.
>
> Could you provide the code? Seems like you're forgetting something.
Code below...
I also have a question about playing videofiles looped - possibely without
seeking since I seem to have some basic misunderstandings about GST_STATEs or
the implementation is just inconsistent (guess not) and would like to get a
clearer picture here.
Goal: Play a file looped- replay file after it reaches EOF/EOS
Aproach:
* catch EOS signal of filesrc
* possibely set pipeline to GST_PAUSED, altough according to docs should
already be in paused
* set filesrc and/or pipeline to GST_STATE_READY (or possibely NULL)
* set filesrc and/or pipeline to GST_STATE_PLAYING again
Result:
Video stops after eos.
I tried all sorts of GST_STATE combinations on all of the involved elements
(filesrc, spider / mpegdemux -> mpeg2dec w. dyn pads, colorspace, ximagesink)
and yes, I found working combinations (the ones mentioned above), but not
inside eos-handler of filesrc, only _before_ eos was issues by filesrc.
How does the containing bin knows about filesrc eos-state ? Is there a way to
keep the bin untouched and just re-activate filesrc again once eos is
reached ?
Setting the pipeline AND filesrc explicitly to paused or ready and then
playing again issues a 'push on peer, but peer is not active' msg, at least
in the case of a working pipeline containing spider via gst_parse_launch
(see, I'm doing bad hacks only to get a videofile played looped and
autoplugged:)
Putting a queue between filesrc and eg. spider (filesrc ! queue ! spider !
colorspace) issues a 'queue does not connect different schedulers' error.
hmm, should be easy I guess.
Greetings and thanx,
Thomas
// Small spider snippet ment to play the video portion of a mpeg2 file
autoplugged //
#include <gst/gst.h>
GstElement *pipeline;
GstElement *filesrc, *spider, *colorspace, *videosink;
gint
main (gint argc, char *argv[])
{
gst_init (&argc, &argv);
pipeline = gst_pipeline_new ("pipeline");
filesrc = gst_element_factory_make ("filesrc", "filesrc");
g_object_set (G_OBJECT (filesrc), "location", "/home/thomas/slsk-shared/
cash.mpg", NULL);
spider = gst_element_factory_make ("spider", "spider");
colorspace = gst_element_factory_make("colorspace", "colorspace");
videosink = gst_element_factory_make ("ximagesink", "videosink");
gst_element_link_pads (filesrc, "src", spider, "sink");
gst_element_link_pads (spider, "src", colorspace, "sink");
gst_element_link_pads (colorspace, "src", videosink, "sink");
gst_bin_add_many (GST_BIN (pipeline), filesrc, spider, colorspace, videosink,
NULL);
gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
while (gst_bin_iterate (GST_BIN(pipeline)));
return 0;
}
WARNING **: error scheduling group 0x822f1c8
ERROR scheduler( 2746)
gstoptimalscheduler.c(2074):gst_opt_scheduler_iterate:
[GstOptScheduler at 0x81dcd88] in error state
More information about the gstreamer-devel
mailing list