playbin2 using appsrc

James jkim at jetheaddev.com
Mon Dec 23 11:18:29 PST 2013


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.
As an experiment, I manually called push_data() function myself as below
and I do not see any error at all in the log. GStreamer pipeline is
constructed to handle video/mpegts
but 'need-data' is not triggered automatically by GStreamer.

  /* Create a GLib Main Loop and set it to run */
  g_print("create main loop\n");
  data.main_loop = g_main_loop_new (NULL, FALSE);

  g_print("call push data\n");
  push_data(&data);
  g_print("run main loop\n");
  g_main_loop_run (data.main_loop);
  
  g_print("exiting\n");

Here is a log file I captured with GST_DEBUG set to 3.
GStreamer-appsrc-playbin2-log.txt
<http://gstreamer-devel.966125.n4.nabble.com/file/n4664242/GStreamer-appsrc-playbin2-log.txt>  














--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/playbin2-using-appsrc-tp4664197p4664242.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list