Sequentially reviewing many files using decodebin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sequentially reviewing many files using decodebin

W. Michael Petullo
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


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Sequentially reviewing many files using decodebin

Antoine Tremblay
You should wait for the no-more-pads signal

see :

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstElement.html#GstElement-no-more-pads


Before setting your pipeline to null..

Not quite sure if all the demuxers support it tought...


Antoine

On Mon, Feb 9, 2009 at 12:47 PM, W. Michael Petullo <[hidden email]> wrote:
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


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel