[gst-devel] GStreamer and audio and video bins

Oscar Östlund oscar.ostlund at gmail.com
Wed Nov 26 05:52:08 CET 2008


Hi

I have a beginner question here.

I wrote an email a few days ago. I still haven't managed to solve it  
yet. I have attached a file that gives an example of the problem(ther  
might be unreffed variables but that shouldn't be the problem here).  
If you uncomment line 267, it doesn't work anymore.

Does anyone have a clue ?

Than you in advance

Oscar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: application/octet-stream
Size: 8807 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20081125/8b1a6580/attachment.obj>
-------------- next part --------------



PS: compile with
gcc -Wall $(pkg-config --cflags --libs gstreamer-0.10) main.c -o test1
run with
./test1 filename.ogg


Le 23 nov. 08 ? 18:15, Oscar ?stlund a ?crit :

> Hi
>
> I am pretty new on GStreamer. I am trying to setup an appliaction  
> that uses this cool library.
>
> I have a problem. This is the following setup I use:
> pipeline:
>  - filersrc
>  - decodebin
>  - videodin (type: bin)
>    * ffmpegcolorspace
>    * autovideosink
>  - audiobin (type: bin)
>    * audioconverter
>    * autoaudiosink
>
> So I create the audiobin et videobin first, and add them to the  
> pipeline. Then create the filesrc and the decodebin. A callback is  
> called on new-decoded-pad. This one links the audiobin's and the  
> video bin's ghost pads to the decoder if appliacable. Then I set the  
> state to playing and start the main loop.
>
> If the file is Ogg/Vorbis, then it doesn't work. If I create the  
> videobin but I don't add the videobin to the pipeline, it works  
> fine. If on the other hand I create the videobin and then add it  
> (even if it doesn't get linked), then everything works fine until I  
> start the main loop. Then it just waits and doesn't play the music.  
> It just open the viedo window and runs the mainloop but doesn't play  
> anything. On the other hand, if the file is Ogg/Theora. Then  
> everything works perfectly, in both situations.
>
> Now I have a second problem. If I don't create the videobin, things  
> work fine... as long as I add the audiobin to the pipeline not in  
> the new-decoded-pad callback. My thought was that I wanted to add  
> the video and audiobin to the pipeline only if needed. Apparently, I  
> can't add them in the callback. Is that due to the fact that the  
> callback is called in another thread (if it is) ??
>
> Do you have any idea ?
>
> Thank you for your help.
>
> Oscar
>
> PS I am running GStreamer on MacOSX.
>
> PSS:
> In the normal case, the bus gets a GST_MESSAGE_TAG, then a  
> GST_MESSAGE_ASYNC_DONE and finally GST_MESSAGE_NEW_CLOCK
> When I add the videobin to the pipeline, the bus receives the  
> GST_MESSAGE_TAG but then nothing, just waits...



More information about the gstreamer-devel mailing list