[gst-devel] Sequentially reviewing many files using decodebin

W. Michael Petullo mike at flyn.org
Mon Feb 9 18:47:26 CET 2009


What is the correct way to use decodebin in a synchronous, sequential
manner to review the stream types in many files?

I have an application that needs to classify files as having an audio or
video component (or both). Right now, I set up a decodebin pipeline,
register a new-decoded-pad callback and set the pipeline's state to
paused. The new-decoded-pad callback classifies each component. Soon
after, the pipeline's state is set to NULL and the pipeline is free'd.

What I am finding is that only the first pad is set up between the paused
and NULL states. For example, if a stream has both audio and video
components, then the audio pad is set up.

What I can do is enter a glib main loop between the paused and NULL
states. If I let this run for 1/10th of a second, then both pads will be
setup and my callback will be called twice. Of course, this depends on the
timing of events which may not always fit into 1/10th of a second. This
technique does not seem very elegant.

Is there a better way?

Mike





More information about the gstreamer-devel mailing list