gstreamer/gst/playback
Sebastian Dröge 175aae9e85 streamsynchronizer: Delay EOS events until all streams are EOS
This fixes a race condition in playbin2's gapless mode, where the
EOS of other streams might arrive in the sinks before the last stream
ends and the switch to the new track happens. The EOS sinks won't
accept any new data then and playback stops.

To prevent this, delay all EOS events until all streams are EOS
and advance the sinks of the EOS streams by filler newsegment
events if necessary.

Fixes bug #625118.
2010-07-24 18:17:43 +02:00
..
.gitignore gst/playback/.cvsignore: Ignore more. 2007-12-20 17:13:37 +00:00
decodetest.c Don't use bad gst_element_get_pad(). 2008-05-21 16:36:50 +00:00
gstdecodebin.c decodebin: use can_intersect to avoid a caps copy 2010-05-06 09:12:32 +03:00
gstdecodebin2.c decodebin2: Properly clean DecodeChain after errors. 2010-06-26 17:57:24 +02:00
gstfactorylists.c playbin2: don't iterate the factory lists in non-debug mode 2009-12-03 18:08:49 +02:00
gstfactorylists.h playbin2: don't iterate the factory lists in non-debug mode 2009-12-03 18:08:49 +02:00
gstinputselector.c gst_element_class_set_details => gst_element_class_set_details_simple 2010-03-16 17:41:50 +01:00
gstinputselector.h playbin2: use private copy of input-selector 2009-07-15 17:42:46 +01:00
gstplay-enum.c playbin2: Add flag for enabling/disabling automatic deinterlacing 2010-04-29 18:21:21 +02:00
gstplay-enum.h playbin2: Add flag for enabling/disabling automatic deinterlacing 2010-04-29 18:21:21 +02:00
gstplay-marshal.list playbin2: use private copy of input-selector 2009-07-15 17:42:46 +01:00
gstplayback.c Add -Wmissing-declarations -Wmissing-prototypes to warning flags 2010-03-11 13:50:31 +01:00
gstplayback.h playback, ogg: dist new gstplayback.h and gstogg.h 2010-04-09 09:26:08 +01:00
gstplaybasebin.c Add -Wwrite-strings to configure 2010-03-16 17:41:51 +01:00
gstplaybasebin.h playbin: Add simple 'raw decoding mode'. 2009-04-02 12:18:08 +01:00
gstplaybin.c playbin: Only unref the volume element on dispose and when a new audio sink is set 2010-04-09 08:23:33 +02:00
gstplaybin2.c playbin2: Remove QOS event adjustments for gapless playback mode 2010-07-16 17:40:46 +02:00
gstplaysink.c playsink: Switch to faster pad linking methods 2010-07-20 21:05:45 +02:00
gstplaysink.h playbin2: add av-offset property 2010-06-07 14:38:42 +02:00
gstrawcaps.h decodebin2: Use static caps for the default raw caps and put them into a separate header 2009-11-03 13:03:23 +01:00
gstscreenshot.c playsink: Set add-borders=true on the videoscale instances 2010-07-19 15:59:17 +02:00
gstscreenshot.h playbin2: move marshaller to screenshot 2010-06-05 11:09:41 +02:00
gststreaminfo.c Remove GST_DEBUG_FUNCPTR where they're pointless 2009-10-28 00:59:35 +00:00
gststreaminfo.h gst/playback/: Add playbin2. 2007-11-16 15:44:48 +00:00
gststreamselector.c gst_element_class_set_details => gst_element_class_set_details_simple 2010-03-16 17:41:50 +01:00
gststreamselector.h gst/playback/gststreamselector.*: Revert change that caused regression until a real fix is found. 2008-03-14 09:54:44 +00:00
gststreamsynchronizer.c streamsynchronizer: Delay EOS events until all streams are EOS 2010-07-24 18:17:43 +02:00
gststreamsynchronizer.h streamsynchronizer: Fix another deadlock when going PAUSED->READY while streams are waiting for the GCond 2010-07-22 09:13:48 +02:00
gstsubtitleoverlay.c playbin2, playsink, subtitleoverlay: Set subtitle encoding properly 2010-02-22 20:47:34 +01:00
gstsubtitleoverlay.h playbin2, playsink, subtitleoverlay: Set subtitle encoding properly 2010-02-22 20:47:34 +01:00
gsturidecodebin.c uridecodebin: Allow video/webm for progressive downloading 2010-06-12 16:16:37 +02:00
Makefile.am playsink: Fix gapless playback in many non-simple scenarios 2010-07-16 17:40:46 +02:00
README gst/playback/: Fix the build + little README update. 2007-11-17 15:25:15 +00:00
test.c Don't use bad gst_element_get_pad(). 2008-05-21 16:36:50 +00:00
test2.c All plugins updated for element state changes. 2005-09-02 15:43:18 +00:00
test3.c gst/playback/: Port these two tests as well. 2005-10-27 18:30:04 +00:00
test4.c gst/playback/: Also include config.h when relying on defines from it. Fixes the build. Its been a please to serve :) 2008-05-02 11:13:05 +00:00
test5.c gst/playback/: Also include config.h when relying on defines from it. Fixes the build. Its been a please to serve :) 2008-05-02 11:13:05 +00:00
test6.c Don't use bad gst_element_get_pad(). 2008-05-21 16:36:50 +00:00
test7.c playsink: Fix gapless playback in many non-simple scenarios 2010-07-16 17:40:46 +02:00

decodebin:

  A bin with a sinkpad that decodes the data into raw formats. It works by sending
  the input data through a typefind element and then recursively autoplugs elements 
  from the registry until a raw format is obtained. It will then create a new ghostpad
  on itself to signal the app of the new pad. 

  Decodebin will also remove pads when they are removed from the stream.

  TODO
   - reuse of decoderbin, cleanup in READY state
   - threading after demuxing?
   - new_media events should be handled.
   - caching of elements.
   - abstract more elements, pads (typefind, ...);

   The autoplugging happens as follows:

   1) typefind is added internally to the bin.
   2) the have_type signal is connected to typefind.
   3) in the have_type callback the close_pad_link function is called
   4) close_pad_link checks the type on the pad, if it is raw, a ghostpad
      is created and autoplugging for that pad stops.
   5) if the type of the pad is not raw, a list of possible elements that
      can connect to this type is generated in find_compatibles.
   6) try_to_link_1 with the element list is called. The function will loop
      over the element list and will try to connect one of the elements to
      the pad. If the link works, a call is made to close_link.
   7) close_link loops over all the source pads of the element and 
      recursively calls 4) for any ALWAYS pad. For elements with
      a SOMETIMES pad, a structure is set up and is passed to the callback
      of the new_pad signal.
   8) in the new_pad callback, 4) is called to try to autoplug the
      new pad.


playbasebin:

  A bin with an uri property. It will find the right source element from the registry
  and connect a decoderbin to it. When going to the PAUSED state, it will iterate the
  decoderbin and listen for new pad signals from it. It will connect a queue to each
  new pad and will iterate the decoderbin until one of the queues is filled. It is
  assumed that by that time all the streams will be found so that when leaving the
  PAUSED state, one can query the number of streams in the media file with the given
  uri.

  Playbasebin internally groups related streams together in a GstPlayBaseGroup. This
  is particulary important for chained oggs. Initially, a new group is created in 
  the 'building' state. All new streams will be added to the building group until
  no-more-pads is signaled or one of the preroll queues overflows. When this happens,
  the group is commited to a list of groups ready for playback. PlaybaseBin will then
  attach a padprobe to each stream to figure out when it finished. It will remove
  the current group and install the next playable group, then.

  Before going to the PLAYING state, it is possible to connect a custom element to
  each of the streams. To do that, you have to add the element to the bin and then
  connect the pad(s) from the stream(s). You do not have to add the elements in
  a thread, the bin will take care of then when it's needed. You are allowed to use
  threads inside the elements, of course.
  The bin tries to be smart and doesn't add a queue when there is only one possible 
  stream.

  
  TODO
  - reuse, cleanup in ready state
  - when the first pad is closed, it's possible that another dynamic element is
    added somewhere so that we need a queue for the first pad as well.


playbin:
  
   Extends playbasebin, sets up default audiosink and videosink for first audio/video
   stream detected. implements seeking and querying on the configured sinks.

   It also waits for new notifications from playbasebin about any new groups that are
   becomming active. It then disconnects the sinks and reconnects them to the new
   pads in the group.

   TODO
   - reuse, refcounting, cleanup in READY state
   - be smarter about replugging the sinks instead of removing them and readding them.
   - Do not crap out when the audio device is in use.


general

   TODO
   - playlist support. maybe use a playlist bin that streams the contents of the
     playlist on a pad, interleaved with new_media events. Also add a tuner 
     interface while we're at it.