Commit graph

981 commits

Author SHA1 Message Date
Sebastian Dröge
e3530f434b playbin2: Use subset check instead of non-empty-intersection check to check if pads are compatible 2011-09-06 14:03:31 +02:00
Sebastian Dröge
4be8c44b08 decodebin2: Fix memory leak 2011-09-06 13:16:44 +02:00
Sebastian Dröge
20f9d0bec5 decodebin2: Correctly negotiate format for parsers that can convert different stream formats
This is done by adding a capsfilter after every parser/converter that contains
all possible caps supported by downstream elements. A capsfilter is necessary
here because the decoder is only selected after the parser selected a format
and the parser can't know what downstream would support otherwise.
2011-09-06 13:16:44 +02:00
Sebastian Dröge
1df9fa9ee8 playbin2: If a audio/video sink was already selected don't check caps of all other possible sinks 2011-09-06 13:16:44 +02:00
Sebastian Dröge
de4fc848fa decodebin2: Actually iterate over the factories instead of only taking the first one 2011-09-05 20:32:42 +02:00
Tim-Philipp Müller
b1c00adf31 Revert "playsink: Try include 'pitch', if no other sink is provided"
This reverts commit 105814e2c7.

The general consensus seems to be that we should revert this for
now. If such behaviour is desired, we should probably enable it
via a flag. And maybe use the scaletempo plugin instead.
2011-09-05 14:44:27 +01:00
Sebastian Dröge
705ca1d55a playsink: Don't leak the videochain ts-offset element
Also don't leak the audiochain ts-offset element if one is
found but the sink doesn't support volume settings.
2011-09-05 12:02:37 +02:00
Sebastian Dröge
89a899fd9d playsink: Use gst_object_unref() instead of g_object_unref() for better debugging 2011-09-05 11:55:59 +02:00
David Schleef
924f743981 playback: Add define for colorspace element
Single point of change if you want to switch from ffmpegcolorspace
to colorspace.
2011-09-01 11:41:31 -07:00
Sebastian Dröge
49b301bcd6 playsink: Only unref ts_offset elements if they're not NULL 2011-08-31 14:45:08 +02:00
Sebastian Dröge
425d3ae7bc decodebin2: Keep the chain mutex locked while connecting to the notify::caps signal 2011-08-31 12:40:30 +02:00
Jan Schmidt
105814e2c7 playsink: Try include 'pitch', if no other sink is provided
As a default, try the pipeline 'pitch ! audioconvert ! autoaudiosink'
before trying plain autoaudiosink
2011-08-30 18:21:31 +10:00
David Schleef
a912374342 playback: reference count ts_offset
Apparently this object is being used after it's freed.  This is one
way to fix it, although perhaps not the best way.  Fixes: #656715.
2011-08-25 14:08:34 -07:00
Sebastian Dröge
e9a5d4f8fd playsink{audio,video}convert: Send NEWSEGMENT events to sinkpads instead of pushing them 2011-08-24 14:05:27 +02:00
Edward Hervey
2ee31ccac9 playsink: Reconfigure when pads are added later
Instead of just assuming all pads are created at the same time,
remember which ones are actually new (via ->pending_blocked_pads).

This allows the following use-case to properly work:
* Upstream starts with audio-only
* Only that pad gets data, blocks and a real audio sink is created
* Upstream laters adds a video stream
* A new pad is requested, blocks and reconfiguration kicks in in
  order to add a new real video sink
2011-08-18 13:42:26 +02:00
Edward Hervey
38a6919a7b decodebin2: Allow all EOS to go through if we don't have a next group
Only drop them if the current group isn't drained .. AND there is a
next group to switch to.

Should Fix #655268
2011-07-26 12:33:56 +02:00
Edward Hervey
059db89633 playbin2: Avoid resetting playsink when not needed
When we don't have specific {audio|video|text}-sink properties, don't
set them on playsink when reconfiguring.
If we do that, we end up setting the previous configured sink to
GST_STATE_NULL resulting in any potentially pending push being returned
with GST_FLOW_WRONG_STATE which will cause the upstream elements to
silently stop.

https://bugzilla.gnome.org/show_bug.cgi?id=655279
2011-07-25 18:44:33 +02:00
Edward Hervey
c91928f7a2 decodebin2: Properly handle multi-stream chains
When we have a multi-stream (i.e. audio and video) input and the demuxer
adds/removes pads for a new stream (common in a mpeg-ts stream when the
program stream mapping is updated), the algorithm for EOS handling was
previously wrong (it would only drop the EOS of the *last* pad but would
let the EOS on the other pads go through).

The logic has only been changed a tiny bit for EOS handling resulting in:
* If there is no next group, let the EOS go through
* If there is a next group, but not all pads are drained in the active
  group, drop the EOS event
* If there is a next group and all pads are drained, then the ghostpads
  will be removed and the EOS event will be dropped automatically.
2011-07-25 10:45:36 +02:00
Tim-Philipp Müller
9edbc92a27 decodebin: don't plug the same parser multiple times in a row
This allows us to make parsers accept both parsed and unparsed input
without decodebin plugging them in a loop until things blow up, ie.
without affecting applications that still use the old playbin or the
old decodebin.

(Making parsers accept parsed input is useful for later when we want
to use parsers to convert the stream-format into something the decoder
can handle. It's also much more convenient for application authors
who can plug parsers unconditionally in transcoding pipelines, for
example).
2011-07-15 16:14:11 +01:00
Sebastian Dröge
5c97aa2e5c playsink: Fix deadlock in the audio/video converter bins when linking fails 2011-06-02 11:54:35 +02:00
Sebastian Dröge
216258fbc2 playbin2: Let the input-selectors sync all streams to the running time
This is especially needed when switching between a non-sparse and sparse
video stream, see bug #537382. It also lowers the time needed for switching
between streams a bit.
2011-05-26 11:41:50 +02:00
Mark Nauwelaerts
4ba6acdba5 uridecodebin: use bitrate to configure streaming buffer-duration default case
In particular, in audio only cases whose (estimated) metadata provides bitrate
information, the buffer-size based on such bitrate (and buffer-duration)
will be much more reasonable than queue2 default buffer-size.
2011-05-16 12:44:52 +02:00
Mark Nauwelaerts
8480b1ef1d uridecodebin: remove some dead code
... which was dead as pads were never added to the list, and need not be added,
since removing them is handled by a pad callback.
2011-05-16 12:44:50 +02:00
Andoni Morales Alastruey
dd36e4cd0e decodebin2: fix preroll for streams at low bitrates
For streams at low bitrates we need to set a limit in time because the limit
in bytes might not reached too late, sometimes more than 30 seconds.
This limit can only be set if upstream is seekable (see #584104)
Closes #647769
2011-05-14 11:42:33 +02:00
Sebastian Dröge
9337a293e1 playsink: Use new ghostpad/proxypad API to get the internal pad 2011-05-14 11:42:33 +02:00
Sebastian Dröge
9b6e1952a4 playsink: Use new ghostpad/proxypad API 2011-05-14 11:42:33 +02:00
Sebastian Dröge
2f8467d682 playsink: Add audio and video converter convenience bins
These reconfigure based on the caps and plugin in converters if
necessary. This also makes switching between compressed and raw
streams work flawlessly without loosing the states of any element
somewhere or having running time problems.
2011-05-14 11:42:32 +02:00
Sebastian Dröge
105da803ad playbin2/playsink: Decide if A/V caps are raw only inside playsink
Before playbin2 would use different selectors for raw audio and
compressed audio (and the same for video) and used different
pads from playsink. This made the involved logic much more
complex and was not implemented completely in playsink, which
made it impossible to support files with a compressed and
uncompressed stream that is support by the sink.

playbin2 handles raw/non-raw streams the same now and the
decision is left to playsink, which now can also handle
caps changes from raw to non-raw and the other way around.

Fixes bug #632788.
2011-05-14 11:42:32 +02:00
Sebastian Dröge
45bf51dcdf subtitleoverlay: Use new, public ghostpad functions 2011-05-14 11:42:32 +02:00
Mark Nauwelaerts
961226e0cd playbin2: avoid foregoing READY_TO_NULL when appropriate 2011-04-15 11:13:31 +02:00
Mark Nauwelaerts
2bb91c4880 playbin2: ensure proper PAUSED_TO_READY cleanup
... since going async to PAUSED might fail, and never making it to PAUSED
subsequently skips going down to READY.

Fixes #647781.
2011-04-14 22:14:50 +02:00
Marc Plano-Lesay
bf2b14f860 fix unused-but-set-variable warnings with gcc 4.6
https://bugzilla.gnome.org/show_bug.cgi?id=647294
2011-04-12 12:24:37 +01:00
Alessandro Decina
030f639a8e android: make it ready for androgenizer
Remove the android/ top dir
Fixe the Makefile.am to be androgenized

To build gstreamer for android we are now using androgenizer which generates the
needed Android.mk files.
Androgenizer can be found here:
http://git.collabora.co.uk/?p=user/derek/androgenizer.git
2011-04-11 07:23:21 +02:00
David Schleef
12513a9537 Remove setting of plugindir from Makefiles 2011-04-01 13:55:56 -07:00
Sebastian Dröge
c27cd709bf playsink: Update comment about why an audio queue is needed 2011-03-24 14:22:00 +01:00
Sebastian Dröge
65320a04ab Revert "playsink: Only add a queue before the audio sink if visualizations are enabled"
This reverts commit df886c0622.
2011-03-24 14:21:01 +01:00
Sebastian Dröge
df886c0622 playsink: Only add a queue before the audio sink if visualizations are enabled
The queue is not needed otherwise and will add some delay to track
switches.
2011-03-24 14:04:54 +01:00
Sebastian Dröge
2c057f745f playsink: Remember automatically created sinks for future reconfigures
Also allow reuse of sink elements in error cases.
2011-03-23 15:08:13 +01:00
Sebastian Dröge
9c13edef4e playbin2: Check if an already existing sink supports the non-raw format too
Before we were assuming that a sink will always support all non-raw formats
in a single stream.
2011-03-23 14:43:36 +01:00
Arun Raghavan
b0ef98001f playbin2: Check if an element accepts requisite caps before selecting
In addition to ensuring that an element we want to select in
autoplug-select can enter the READY state, we also now check if it can
accept the caps we wish to plug it for. This is handy for sinks that
need to perform a probe to figure out whether they can actually handle a
given format.
2011-03-23 14:42:05 +01:00
Sebastian Dröge
b76efc7f5d playbin2: Set sinks to READY before checking if it accept caps
Fixes bug #642732.
2011-03-23 14:33:17 +01:00
Sebastian Dröge
a0ff13217a playbin2: Always prefer the custom set sink and also set it back to NULL in all cases. 2011-03-23 14:31:40 +01:00
Sebastian Dröge
4e49d58917 playbin2: Only consider the audio/video sinks in autoplug_continue for the normal uridecodebin
Considering them for the subtitle uridecodebin will add audio/video
streams that might be in a file used as subtitle file.
2011-03-23 14:28:36 +01:00
Tim-Philipp Müller
e8f5b3a579 uridecodebin: post proper error message if decodebin2/typefind elements are missing
Post better error messages in case typefind/decodebin2 are missing or
could not be loaded for some reason (e.g. because they inadvertently
got blacklisted).

https://bugzilla.gnome.org/show_bug.cgi?id=644892
2011-03-16 10:19:42 +00:00
Stefan Kost
63be375c21 plaback: trim trailing whitespace 2011-03-14 10:43:42 +02:00
Stefan Kost
7f1382112e decodebin2: reflow configuring new multiqueue instance
Use a single g_object_set to configure the new multiqueue instance. Also don't
needlessly set "use-buffering" if it is the default.
2011-03-14 10:43:42 +02:00
Stefan Kost
cf9aaffcb9 playbin2: set several properties in one go
g_object_set is a varargs function. Save 7 g_obvject_calls (and the overhead of
them) by using it accordingly.
2011-03-04 14:43:20 +02:00
Sebastian Dröge
4ac6f5ff83 decodebin2: Only prevent to autoplug the same parser multiple times for the same chain
Parsers are the only element class that are not changing the data and
could lead to an infinite loop. Other element classes like demuxers,
e.g. id3demux, can be used multiple times in a row and sometimes are.
2011-02-27 09:32:55 +01:00
Sebastian Dröge
c7f5290247 decodebin2: Break the double-factory checking loop immediately if the factory was used already 2011-02-26 23:43:39 +01:00
Sebastian Dröge
5058f79226 decodebin2: Don't use the same element multiple times in the same chain
This is going to lead to an infinite loop of this element and can easily
happen with parsers that accept their own src caps on the sinkpad.
2011-02-26 23:40:48 +01:00
Sebastian Dröge
32c30b88ff decodebin2: Improve detection of raw caps in expose-all-streams=false mode
Previously we only checked against the raw caps but we should also
check against the return value of autoplug-continue. Additionally fix
a thread-safety issue with accessing the raw caps.
2011-02-26 23:24:11 +01:00
Tim-Philipp Müller
c48c193b56 playbin2, uridecodebin: add "source-setup" signal
Add "source-setup" signal for convenience and discoverability. No need
to figure out "notify::source", look up the notify callback signature,
then do an g_object_get() to get the source element..

https://bugzilla.gnome.org/show_bug.cgi?id=626152
2011-02-24 16:53:01 +00:00
Mark Nauwelaerts
19052a847d playsink: release all chains when going to NULL
Also fixes #642466.
2011-02-23 14:33:40 +01:00
Mark Nauwelaerts
102b4feddf playsink: undo state change side effect on error way out
... to avoid subsequent cleanup disposing an element not in NULL state.
2011-02-23 14:33:35 +01:00
Mark Nauwelaerts
948e4d50a6 playsink: avoid crashing on the way out when needed chain missing 2011-02-23 10:33:44 +01:00
Sebastian Dröge
0e3c32ac72 playbin2: If a sink claims to support ANY caps assume that it only supports the usual raw formats
This should be changed again in 0.11, if a sink really claims to support ANY
caps it should support everything or provide correct caps.
2011-02-18 17:29:07 +01:00
Sebastian Dröge
2fc70442a7 playbin2: Use gst_pad_accept_caps() instead of intersecting with the getcaps caps
This might be faster and more accurate in some cases to detect if a
sink supports a format and autoplugging can be stopped.
2011-02-18 14:04:38 +01:00
Sebastian Dröge
09750a0132 uridecodebin: Add default handler for autoplug-select
uridecodebin proxies this signal and only the first signal handler
will ever be called from decodebin2, which is uridecodebin's proxy
signal handler.
2011-02-18 12:06:30 +01:00
Sebastian Dröge
91122e4efc uridecodebin: Return NULL from the default autoplug-sort handler
...instead of copying the array. Returning NULL will result
in the original factories array to be used and prevents a useless
array copy in most use cases.
2011-02-18 12:02:18 +01:00
Sebastian Dröge
2a6602d994 decodebin2: Return NULL from the default autoplug-sort handler
...instead of copying the array. Returning NULL will result
in the original factories array to be used and prevents a useless
array copy in most use cases.
2011-02-18 12:01:05 +01:00
Sebastian Dröge
da4b5bf9f9 uridecodebin: Update autoplug-* signal docs from decodebin2
uridecodebin proxies these signals.
2011-02-18 12:00:34 +01:00
Sebastian Dröge
ef5f73206d decodebin2: Update documentation of the autoplug-* signals
Add notes about the behaviour if multiple signal handlers are connected.
For most autoplug-* signals only the first signal handler will ever
be invoked.

Also add to the autoplug-sort docs that the signal handler can return NULL
to specify that the order should change and other handlers get the chance
to sort the array.
2011-02-18 11:58:44 +01:00
Sebastian Dröge
785f35a48e decodebin2: Keep the original factory list if the sort signal handlers returned NULL 2011-02-18 11:57:12 +01:00
tskd2@yahoo.co.jp
0641eabeb2 uridecodebin: expose "autoplug-sort" signal
It is a proxy of the decodebin2's one, and was missing
in the previous code.

See bug #642433.
2011-02-18 11:17:11 +01:00
Sebastian Dröge
1351597381 playbin2: Use a recursive mutex for the playbin lock
This lock is taken when activating a group, which could result in
calling the autoplug-continue callback, which also needs this lock
to access the sinks.

See bug #642174.
2011-02-18 10:57:40 +01:00
Sebastian Dröge
6ca5bb72a4 decodebin2: Disconnect signal handlers when removing a failed element
This prevents crashes later if one of the signals is emitted after the
element was removed from decodebin2 already, which can happen in discoverer.
2011-02-18 09:44:49 +01:00
Sebastian Dröge
140dca43f3 playbin2: Optimize autoplug-continue handler a bit
Don't build merge the caps of all sinks but check them one-by-one
until one supports the caps. Also get reffed caps from the sinkpads
instead of a writable copy and add debug output if a sink claims to
support ANY caps.
2011-02-15 17:46:22 +01:00
Akihiro Tsukada
555e338008 playbin2: Fix handling of non-raw custom sinks
When autoplugging elements in decodebin2, check if
the caps are supported by one of the sink before
continuing autoplugging.

Fixes bug #642174.
2011-02-15 17:24:28 +01:00
Sebastian Dröge
fbf9729795 decodebin2: Don't leak elements that fail to go to PAUSED after being autoplugged
Fixes bug #642381.
2011-02-15 17:05:42 +01:00
Stefan Kost
fe59f50468 decodebin2: caps can be NULL
Don't use and unref NULL caps.
2011-02-08 12:32:23 +02:00
Mark Nauwelaerts
2c017d2a70 uridecodebin: fix copy-and-paste typo in property docs 2011-02-02 15:39:19 +01:00
Wim Taymans
1fb7c7e5dc uridecodebin: also add https to buffer protocols
HTTPS also needs buffering.
2011-01-31 10:34:44 +01:00
Stefan Kost
69436bb8a6 decodebin2: add comment and whitespace trimming 2011-01-25 18:03:58 +02:00
Tim-Philipp Müller
dcd4222716 playbin2: use input-selector from core instead of internal copy 2010-12-31 12:14:22 +00:00
Vincent Penquerc'h
f221466099 playbin2: delay stream-changed messages
https://bugzilla.gnome.org/show_bug.cgi?id=637586
2010-12-21 17:42:58 +01:00
Sebastian Dröge
09ff04a00a decodebin2: Deprecate new-decoded-pad and removed-decoded-pad signals
They're really the same as pad-added and pad-removed from GstElement
and it doesn't make sense to have two signals for the same thing.
2010-12-11 17:18:49 +01:00
Sebastian Dröge
42dee942d4 decodebin2: Emit "remove-decoded-pad" signal when pads are removed from decodebin2
Fixes bug #636198.
2010-12-11 17:15:28 +01:00
Stefan Kost
95b259f9c9 playbin2: add some logging for failure case 2010-12-02 23:04:51 +02:00
Stefan Kost
baa2fbbb68 inputselector: log times in human readable form 2010-12-02 23:04:51 +02:00
Stefan Kost
7f787249bb inputselector: more G_PARAM_STATIC_STRINGS use 2010-12-02 23:04:51 +02:00
Stefan Kost
3b35063ceb inputselector: move reoccuring logs to LOG and remove a double info
Less debug spew in DEBUG category. No need to log pad again if we use
GST_LOG_OBJECT(pad,...).
2010-12-02 23:04:51 +02:00
Sebastian Dröge
66ce6200a8 playsink: gen_video_chain() always returns a bin, no need to check for that 2010-12-02 19:04:28 +01:00
Sebastian Dröge
92133f7ce4 streamsynchronizer: If we get EOS for an unknown stream just do nothing
instead of dereferencing NULL pointers. This can happen if the stream
was just removed from the streamsynchronizer in a bad time.
2010-12-02 19:04:28 +01:00
Sebastian Dröge
fe856a3f7c playsink: gen_video_deinterlace_chain() always returns a bin, no need to check that 2010-12-02 19:04:28 +01:00
Stefan Kost
7b312c5980 uridecodebin: disconnect signal handlers before disposing 2010-11-24 17:53:42 +02:00
Tim-Philipp Müller
1bfefc50af docs: improve decodebin2 docs a little
Mention that new pads may be created even after no-more-pads.

https://bugzilla.gnome.org/show_bug.cgi?id=634584
2010-11-22 00:54:35 +00:00
Tim-Philipp Müller
8a423f8f00 decodebin: fix one more pad template ref leak 2010-11-18 00:33:22 +00:00
Harri Mähönen
7c5e39664e *decodebin*: don't leak pad templates set on ghostpads
https://bugzilla.gnome.org/show_bug.cgi?id=635067
2010-11-18 00:11:41 +00:00
Tim-Philipp Müller
8f039997f0 playbin2: disable streamsynchronizer magic for this release
Some things aren't quite right yet and cause problems (0-sized buffers
with PREROLL flag set cause crashes in elements that don't expect those;
getting pipeline back to preroll/playing again when audio/video streams
have different lengths and a seek past the end of one of the stream
happens doesn't always work, etc.). Needs further investigation in the
next cycle.

https://bugzilla.gnome.org/show_bug.cgi?id=633700
https://bugzilla.gnome.org/show_bug.cgi?id=634699
2010-11-17 01:01:03 +00:00
Jan Schmidt
ee303c441d playsink: Fix subpicture overlay when deinterlacing disabled.
Fix a bug when reconfiguring the playsink where the subpicture
stream is broken by attempting to connect it through
streamsynchroniser and second time.
2010-10-28 23:15:43 +01:00
Edward Hervey
a5752d8ea7 decodebin2: Don't add non prerolled stream to topology
If a final stream didn't preroll, don't add it to the topology since
it doesn't give any information at all.

https://bugzilla.gnome.org/show_bug.cgi?id=632988
2010-10-24 16:18:17 +02:00
Mark Nauwelaerts
9d0fefc617 uridecodebin: workaround internal decodebin2 failing state change
Fixes #632656.
2010-10-21 19:07:24 +02:00
Stefan Kost
2a00fefd2a *decodebin*: set pad-templates on ghostpads
This makes calling gst_pad_get_pad_template() work.
2010-10-13 23:30:55 +03:00
Stefan Kost
83c14483ed various: add a missing G_PARAM_STATIC_STRINGS flag to object properties 2010-10-13 16:13:31 +03:00
Tim-Philipp Müller
8d29594491 decodebin2: declare decodebin2 stable, deprecate the old decodebin
https://bugzilla.gnome.org/show_bug.cgi?id=624949
2010-10-13 13:05:12 +01:00
Tim-Philipp Müller
8effe1e5ba playbin2: declare stable, deprecate the old playbin
https://bugzilla.gnome.org/show_bug.cgi?id=624949
2010-10-13 12:55:31 +01:00
Sebastian Dröge
491b7af1fa uridecodebin: Set GST_ELEMENT_IS_SOURCE flag
uridecodebin behaves like a source, let's mark it as a source
2010-10-11 14:31:05 +02:00
Thiago Santos
6d8cb1f42d streamsynchronizer: Do not advance segment starts beyond stop times
Advance stop times too when they are getting higher than the
stop time of segments, avoiding assertions.

The stop time has to be advanced too so that running time keep in sync
for gapless mode.

https://bugzilla.gnome.org/show_bug.cgi?id=631312
2010-10-07 11:20:48 -03:00
Edward Hervey
b8dea19bbd decodebin2: Don't post async-done when not needed
Where it was previously located, we would get async-done for the first
unknown-type, even if other valid streams would appear afterwards.
decode_bin_expose() will take care of posting async-done when the group
is exposed.

But we still want to post it in case the typefinding returned an unknown
type, in which case we will post it after posting an error.

These two changes ensure we do as much as possible before posting async-done.
2010-09-29 18:59:16 +02:00
Edward Hervey
75b522dacf decodebin2: Actually dispose the unused ghostpads 2010-09-15 14:17:58 +02:00