playbin2 using appsrc

Sebastian Dröge sebastian at centricular.com
Tue Dec 24 05:50:46 PST 2013


On Mo, 2013-12-23 at 11:18 -0800, James wrote:
> Nothing looks wrong in the code from a first look. Setting caps is not
> required in your case, playbin will detect the correct caps for you
> already (which it can't in the raw audio case).
> Do you get any errors messages or anything printed on the terminal? Also
> check the debug logs about why this never requests any data (are the
> need-data and enough-data callbacks ever called? is the source-setup
> callback ever called?).
> And last but not least, which version of GStreamer 0.10 are you using?
> The source-setup signal was added rather late in 0.10. And also you
> should if somehow possible upgrade to GStreamer 1.x as 0.10 is no longer
> maintained.
> 
> Thank you so much for your reply, Sebastian.
> First of all, I agree that I should upgrade my system to GStreamer 1.x.
> I am currently using GStreamer 0.10.36 (gst-inspect-0.10 version 0.10.36),
> which basically is the version that GstSDK Tutorials is written on
> (I obtained the tutorial source code from
> http://docs.gstreamer.com/display/GstSDK/Tutorials).
> It's basically basic-tutorial-8 example code replaced with playbin2.
> 
> To answer your questions:
> 1. Do you get any errors messages or anything printed on the terminal? 
> JK> No error at all. Below is the logs from my app:
> 
>    init gstreamer
>    open stream file
>    launch playbin2
>    get pipeline bus
>    add signal watch
>    pipeline set to PLAYING
>    Source, source has been created. Configuring.
>    set appsrc caps to video/mpegts
>    connect appsrc signals
>    create main loop
>    run main loop
> 
> 2. are theneed-data and enough-data callbacks ever called? 
> JK> They are not called at all and obviously that is the source of the
> problem.
> 
> 3. is the source-setup callback ever called?
> JK> Yes, this gets called as you can see in the log in my answer 1 above
> 
> So the problem I am having does not seem to be feature support issue or
> version issue.
> The original tutorial-8 triggers triggers 'need-data' automatically and
> everything goes from there.
> 
> Somehow my code does not cause GStreamer to send this event when changed to
> PLAYING.

I tested your code locally with 0.10.36 and it works just fine after
fixing the two calls to g_signal_connect() in source_setup(). You have
to pass data there, not &data.

After changing that it reads a MPEGTS file properly here and all the
callbacks are called. They are called before that change too but
everything will crash because of that mistake ;)

Why are you using appsrc for this btw, what's the plan in your
application? There are multiple ways how appsrc can be used, and the way
implemented here is not always the most optimal one.

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131224/f31cfc30/attachment-0001.pgp>


More information about the gstreamer-devel mailing list