Commit graph

428 commits

Author SHA1 Message Date
Sebastian Dröge
d802c7395a playback: Only do a subset filtering for the factories if we have fixed caps
Otherwise we're plugging a parser/converter currently and have unfixed caps.
2013-05-15 17:15:18 +02:00
Sebastian Dröge
062246fc6e decodebin: Return immediately from checking if a chain is complete if we're shutting down 2013-05-15 14:51:16 +02:00
Sebastian Dröge
83f2476976 decodebin: Hold the expose lock when freeing a chain
https://bugzilla.gnome.org/show_bug.cgi?id=700342
2013-05-15 14:47:53 +02:00
Sebastian Dröge
450a47c0a5 playback: Use subset checks instead of intersection
https://bugzilla.gnome.org/show_bug.cgi?id=700272
2013-05-14 10:07:44 +02:00
Sebastian Dröge
b719dd9f89 decodebin: Expose pads when they receive EOS before any buffers
Stops decodebin from waiting forever to expose a pad if there
is never data on it.

https://bugzilla.gnome.org/show_bug.cgi?id=691072
2013-05-06 15:49:00 +02:00
Wim Taymans
c5840ebbd9 decodebin2: also remove the bytes limit
Remove the byte limit for adaptive http streaming. Because some fragments might
be very big, we might need a lot of buffering. I also suspect another problem
where data is actually missing and things go out of sync somehow.
2013-04-23 11:20:28 -03:00
Wim Taymans
26c5bc1ce4 decodebin2: update buffer size in multiqueue
When we disable buffering in the more upstream multiqueue elements,
we need to also update the queue limits. In particular, the max_size_time should
be set to 0 or else we might simply deadlock.
2013-04-23 11:20:28 -03:00
Thiago Santos
5cd07bd2af decodebin2: only allow 'lower' multiqueues to emit buffering messages
When we have a scenario of demuxers linked to demuxers, decodebin2
will create multiqueue at different levels of the pipeline. The problem
is that only the lowest multiqueue's should do the buffering messaging,
as they will handle with the raw streams data.

When all multiqueues are doing buffering, the upper ones can handle
large buffers that easily fill them, moving from 0% to 100% from
buffer to buffer, causing too much buffering messages to be posted.
This hangs the pipeline unnecessarily and might lead to deadlocks.
2013-04-23 11:20:28 -03:00
Thiago Santos
6382d4c0ad decodebin2: do not handle the next-groups list as if it was a single item
Decodebin2's chains store a next_groups list that was being handled as
it could only have a single element. This is true for most of the
chaining streams scenarios where streams change not very often.

In more stressfull changing scenarios, like adaptive streams, those
changes can happen very often, and in short time intervals. This could
confuse decodebin2 as this list was always being used as a single
element list.

This patches makes it handle as a real list, using iteration instead
of picking the first element as the correct one always.
2013-04-23 10:32:19 -03:00
Thiago Santos
054ffc6e2b decodebin2: preserve next groups order 2013-04-23 10:32:19 -03:00
Thiago Santos
42db7c7b08 decodebin2: still report chain as drained when not 'handled'
Even if the chain hasn't been 'handled' in this switching round,
report it as drained so upper chains/groups know abou it.

This makes switching happen on upper levels of the groups/chain
trees
2013-04-23 10:32:19 -03:00
Sreerenj Balachandran
8cf6049643 decodebin: use _plugin_feature_rank_compare API instead of duplicating the code. 2013-04-18 13:59:36 +02:00
Sreerenj Balachandran
f07eb23728 decodebin: use ascending order for name based sorting of pluginfeatures.
The _decode_bin_compare_factories_func() should return negative
value if the rank of both PluginFeatures are equal and the name of
first PluginFeature comes before the second one (== ascending order).
2013-04-15 12:05:16 +02:00
Wim Taymans
92b77c5aa4 decodebin2: forward all sticky events to decodepad
Forward all sticky events to the decodepad before exposing the pads. This makes
sure all sticky events are on the exposed pad.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=696915
2013-04-04 15:00:52 +02:00
Wim Taymans
c082c06b6c decodebin: debug sticky events on exposed pads 2013-04-04 14:53:32 +02:00
Wim Taymans
08dd2454cd decodebin2: small cleanup
Take the event from the probe just once.
2013-04-04 14:37:15 +02:00
Sebastian Dröge
3475d4f457 decodebin: Remove GstdecodePads that are not going to be exposed
This makes sure that they're unlnked and don't cause any errors or
block the pipeline.
2013-03-30 17:17:04 +01:00
Sebastian Dröge
0932391d3f decodebin: Add autoplug-query signal to handle queries for yet unconnected elements
This allows playbin to answer the CAPS query with the possible sink
caps for example, and allows decoders to chose more optimal caps.
2013-03-30 11:49:42 +01:00
Sebastian Dröge
9ce0818c7d decodebin: Don't add a children to a decode group twice
This can happen if a demuxer does not provide fixed caps from the
beginning but only sets them later.
2013-03-30 11:49:42 +01:00
Matej Knopp
1e5b50e94c decodebin: don't block on caps 2013-02-14 11:37:54 +01:00
Sebastian Dröge
cfd73a8cf7 decodebin: Remove left-over line from last commit 2013-02-14 11:25:37 +01:00
Matej Knopp
872cc295a6 decodebin: Check if value is set before unsetting it
https://bugzilla.gnome.org/show_bug.cgi?id=693401
2013-02-14 11:22:34 +01:00
Alexander Schrab
e7caef6b29 decodebin: Push caps event immediately to ghost pad to avoid exposing pads without caps 2013-02-12 10:12:14 +01:00
Marc Leeman
f704b3f975 decodebin: g_mutex_new -> g_mutex_init
Don't use deprecated GLib API.

https://bugzilla.gnome.org/show_bug.cgi?id=693302
2013-02-07 13:51:17 +00:00
Tim-Philipp Müller
500b864899 decodebin: try harder to always expose pads in the same order
Use stream-id as sort criterion in addition to the media type.

https://bugzilla.gnome.org/show_bug.cgi?id=634407
2013-01-19 13:03:03 +00:00
Wim Taymans
0feecef275 decodebin2: use NO_RESYNC flag
to avoid the state change function from messing with the state of the elements
that we add.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=690420
2012-12-21 16:38:36 +01:00
Sebastian Dröge
830b500d40 decodebin: Set element to NULL state before removing it from the bin 2012-11-22 13:09:46 +01:00
Sebastian Dröge
2faef82b9a decodebin: Check if the element really accepts the caps after setting it to READY
It might know the caps constraints for sure only after opening a decoder.
2012-11-22 13:07:11 +01:00
Tim-Philipp Müller
5f59b4f7ee Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 23:05:09 +00:00
David Corvoysier
87fd43aaaa decodebin2: Fix group switching algorithm
There were two issues with the previous decodebin2 group switching algorithm:

Issue 1: It operated with no memory of what has been drained or not, leading to
multiple checks for chains/groups that were already drained.

Issue 2: When receiving an EOS, it only detected that a higher-level chain
was drained if it contained the pad receiving the EOS.

The following modifications have been applied:
- a new drained property has been added to GstDecodeChain
- both drained properties of chain/group are set as soon as they are detected
- the algorithm now tests agains these values

See https://bugzilla.gnome.org/show_bug.cgi?id=685938
2012-10-14 10:58:18 +02:00
Tim-Philipp Müller
81097f485a playback: class_ref() some types so we can create multiple playback elements at the same time
Should fix "cannot register existing type `GstPlaybinSelectorPad'" warnings
and subsequent errors when creating multiple players at the same time.

Conflicts:
	gst/playback/gststreamselector.c
2012-10-03 11:48:25 +01:00
Mark Nauwelaerts
e491d24341 use gst_element_factory_get_metadata to replace obsolete API 2012-09-15 18:57:09 +02:00
Tim-Philipp Müller
2079a8c12b Remove glib-compat-private.h stuff we don't need any more
It's all been ported to the latest GLib API now.
2012-09-09 18:36:49 +01:00
Edward Hervey
2f37ba60a2 decodebin2: Mark streams as complete on CAPS event but don't block
This allows the following use-cases to expose the group and pads
before an ALLOCATION query comes through:
* Single stream use-cases
* Multi stream use-cases where all streams sent the CAPS event before
  the first ALLOCATION query

Some cases will still make the initial ALLOCATION query fail though,
which isn't optimal, but not fatal (it will recover when pads are
exposed, a RECONFIGURE event is sent upstream and elements can
re-send an ALLOCATION query which will reach downstream elements).

https://bugzilla.gnome.org/show_bug.cgi?id=680262
2012-07-24 10:53:19 +02:00
Edward Hervey
c5901cebca decodebin: Block on caps event
A caps event is also used to establish that a stream has prerolled.

Without this, we end up allowing negotiation queries to fail, ending
in decoders (and other elements) to not be configured right from the
start with the most optimal settings.
2012-07-18 18:17:57 +02:00
Edward Hervey
dad72182a0 decodebin2: Demote WARNING to DEBUG
Delaying auto-plugging is quite common
2012-07-12 09:51:36 +02:00
Wim Taymans
a476b6cbfb decodebin2: improve debug 2012-07-11 15:39:37 +02:00
Tim-Philipp Müller
1dea99ded3 decodebin: make GValueArray arguments in autoplug-* signals static scope to avoid copies 2012-07-09 08:35:22 +01:00
Wim Taymans
655fef3dbf update for message api change 2012-06-13 11:04:34 +02:00
Sebastian Dröge
e729ad1c9c playback: Always prefer parsers over decoders
...and in playbin2 additionally prefer sinks over parsers.

This makes sure that we a) always directly plug a sink if it supports
the (compressed) format and b) always plug parsers in front of decoders.
2012-06-12 11:59:39 +02:00
Wim Taymans
cd1d6f7d2d decodebin2: fix format strings 2012-05-11 15:33:31 +02:00
Wim Taymans
163720246e decodebin2: fix compilation 2012-05-11 09:26:47 +02:00
Thibault Saunier
445c41963b playback: Check type when setting "connection-speed" on unknown elements
Clamp the values if needed
2012-05-10 13:21:04 -04:00
Thibault Saunier
ee4ae0041c decodebin2: Add a connection-speed property to set it on demuxers when needed
Proxy it from uridecodebin
2012-05-10 13:11:47 -04:00
Matej Knopp
b6765417e1 decodebin: Do not block on sticky and oob events 2012-04-16 13:49:07 +02:00
Sebastian Dröge
fe9041bd05 decodebin2: Check that properties have the correct type before using them 2012-04-16 08:27:20 +02:00
Tim-Philipp Müller
3c6a3ad629 Use new gst_element_class_set_static_metadata() 2012-04-10 00:45:16 +01:00
Wim Taymans
25137962ad fix for caps API changes 2012-03-11 19:04:41 +01:00
Sebastian Dröge
006f8f8275 gst: Update for gstmarshal.[ch] removal 2012-03-02 11:15:02 +01:00
Tim-Philipp Müller
4738e02bbf playback: suppress GValueArray deprecation warnings for the time being
until this gets sorted out and we have a viable alternative.

https://bugzilla.gnome.org/show_bug.cgi?id=667228
2012-02-01 15:50:52 +00:00
Sebastian Dröge
130a8335a0 Merge branch 'master' into 0.11
Conflicts:
	gst/playback/gstdecodebin2.c
2012-01-25 12:29:11 +01:00
Sebastian Dröge
711e6a12ef Revert "decodebin2: Prune old groups before switching to the new one"
This reverts commit e2a038acee.

This wasn't entirely correct yet and needs some changes here
and there.
2012-01-25 12:25:05 +01:00
Sebastian Dröge
7e5aeba02f decodebin2: Fix merge error 2012-01-25 12:04:24 +01:00
Sebastian Dröge
68c0790817 Merge branch 'master' into 0.11
Conflicts:
	gst-libs/gst/interfaces/propertyprobe.c
	sys/xvimage/xvimagesink.c
2012-01-25 11:50:54 +01:00
Wim Taymans
3d42f0f6ed port to new glib thread API 2012-01-19 11:36:17 +01:00
Youness Alaoui
e2a038acee decodebin2: Prune old groups before switching to the new one
In order to allow for proper functionality when a decoder only supports
one instance at a time (dsp), we must block the demuxer pads when they
get created if they are not part of the active group, preventing buffers
from being sent to the decoder (and initializing it through setcaps),
then after we switch to a new group, we unblock the demuxer pads for
the active groups. In the callback for the unblock, we prune the old
groups, making sure the previous decoder instance is destroyed before
we push a buffer to the new instance.
2012-01-19 09:04:52 +01:00
Edward Hervey
f5f781e8fb Revert "decodebin2: Try harder to get initial topology caps"
This reverts commit 6b3e3544d4.

I really shouldn't put WIP commits in my main branch ...
2012-01-06 15:40:06 +01:00
Edward Hervey
6b3e3544d4 decodebin2: Try harder to get initial topology caps
Since caps are no longer 'shared' between two pads (but forwarded from
source pad to sink pad) we end up with the first chain pad not having
specified caps (i.e. typefind:src).

This solves the issues by getting the pad's peer caps.

It is not optimal since it will (for most demuxers) return the pad
template caps, which might contain non-fixed caps (ex : with
qtdemux "video/quicktime; video/mj2; audio/x-m4a; application/x-3gp")

https://bugzilla.gnome.org/show_bug.cgi?id=667337
2012-01-06 14:40:25 +01:00
Tim-Philipp Müller
26e612aeda playback, mixerutils: gst_registry_get_default() -> gst_registry_get() 2012-01-02 14:32:11 +00:00
Edward Hervey
f562a29284 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	ext/theora/gsttheoraenc.c
	gst-libs/gst/tag/gstexiftag.c
	gst/adder/gstadder.c
	gst/adder/gstadder.h
	gst/playback/gstdecodebin2.c
	gst/playback/gstsubtitleoverlay.c
	tests/check/libs/tag.c
2011-12-30 13:21:35 +01:00
Mark Nauwelaerts
60d5d08fbb decodebin2: tweak chain topology description
... to also properly indicate chain's endpad if no elements are in the
chain (due to the endpad being a raw demuxer pad, or one setup without
decoders since uridecodebin or higher up decided not to need those).
2011-12-14 17:53:38 +01:00
Tim-Philipp Müller
fb6d09055a Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	ext/alsa/gstalsadeviceprobe.c
	ext/alsa/gstalsamixer.c
	ext/pango/gsttextoverlay.c
	ext/pango/gsttextoverlay.h
	gst-libs/gst/audio/gstaudiobasesink.c
	gst-libs/gst/audio/gstaudioringbuffer.c
	gst-libs/gst/audio/gstaudiosrc.c
	gst-libs/gst/video/Makefile.am
	gst-libs/gst/video/video.c
	gst/encoding/gststreamcombiner.c
	gst/encoding/gststreamsplitter.c
	gst/playback/gstplaybasebin.c
	gst/playback/gststreamsynchronizer.c
	gst/playback/gstsubtitleoverlay.c
	gst/playback/gsturidecodebin.c
	sys/xvimage/xvimagesink.c
	tests/examples/Makefile.am
	win32/common/libgstvideo.def

Video overlay composition disabled for now, needs
porting to buffer meta.
2011-12-08 01:19:03 +00:00
Tim-Philipp Müller
5440ae3c18 Suppress deprecation warnings in selected files, for g_static_rec_mutex_* mostly
GStaticRecMutex is part of our API/ABI, not much we can do here
in 0.10 for most of these.
2011-12-04 20:50:25 +00:00
Tim-Philipp Müller
0d98aa25b8 Work around deprecated thread API in glib master
Add private replacements for deprecated functions such as
g_mutex_new(), g_mutex_free(), g_cond_new() etc., mostly
to avoid the deprecation warnings. We'll change these
over to the new API once we depend on glib >= 2.32.

Replace g_thread_create() with g_thread_try_new().
2011-12-04 17:16:30 +00:00
Tim-Philipp Müller
177525f89f Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	gst-libs/gst/netbuffer/gstnetbuffer.c
	gst/ffmpegcolorspace/avcodec.h
	gst/ffmpegcolorspace/gstffmpegcodecmap.c
	gst/ffmpegcolorspace/imgconvert.c
	gst/ffmpegcolorspace/imgconvert_template.h
	gst/ffmpegcolorspace/mem.c
	gst/playback/README
	gst/playback/gstplaybasebin.c
	gst/playback/gstplaybasebin.h
	gst/playback/gstplaybin.c
	sys/v4l/v4lmjpegsrc_calls.c
	sys/v4l/videodev_mjpeg.h
	tests/check/elements/gnomevfssink.c
2011-12-02 11:10:17 +00:00
Piotr Fusik
14644457b0 various: typo fixes
Fix typos in code and docs. Fixes. #658984
2011-12-02 12:03:27 +01:00
Vincent Penquerc'h
96374054ac various: fix pad template leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
2011-11-28 13:09:02 +00:00
Tim-Philipp Müller
32b14c6ed3 Merge remote-tracking branch 'origin/master' into 0.11
Conflicts:
	ext/vorbis/gstvorbisenc.c
	gst/playback/gstdecodebin2.c
	gst/playback/gstplaysinkconvertbin.c
	gst/videorate/gstvideorate.c
2011-11-26 12:12:59 +00:00
Sebastian Dröge
a5535e76e0 decodebin2: Set the multiqueue limits to the playing limits after overrun too
We don't expect any new pads anymore and prerolling is finished now.
2011-11-25 11:12:10 +01:00
Sebastian Dröge
494b2cb1a7 decodebin2: Cache the upstream seekability for demuxer decode chains and use it for the non-preroll multiqueue limits
After preroll the multiqueue limits are still set to the preroll
limits if use-buffering is set to TRUE. In that case we only want
time limits on the multiqueue if upstream is seekable.
2011-11-25 11:12:10 +01:00
Vincent Penquerc'h
59f5d980f6 decodebin2: fix prerolling for low bitrate streams from hlsdemux
Such streams were detected as seekable, as the query on the typefind
element was testing the m3u8 file listing the actual streams, and
not going through the demuxer(s).

We now check for seekability for each multiqueue following a demuxer,
so the query will flow through the elements which might prevent seeking.

https://bugzilla.gnome.org/show_bug.cgi?id=647769
2011-11-25 11:12:10 +01:00
Wim Taymans
28157e6f21 _query_peer_*() -> _peer_query_*() 2011-11-15 18:04:17 +01:00
Wim Taymans
7402d3a3d2 update for _get_caps() -> _query_caps() 2011-11-15 18:04:17 +01:00
Wim Taymans
308f6301a8 update for pad probe api changes 2011-11-08 11:08:21 +01:00
Wim Taymans
616e9b706e fix for new pad probe types
Restore the previous behaviour by only blocking downstream items and not
upstream events.
2011-11-07 17:10:48 +01:00
Wim Taymans
7ac25e9b26 Merge branch 'master' into 0.11
Conflicts:
	common
	configure.ac
	gst-libs/gst/audio/gstbaseaudiosink.c
	gst/playback/gstdecodebin2.c
	gst/playback/gstplaysinkaudioconvert.c
	gst/playback/gstplaysinkaudioconvert.h
	gst/playback/gstplaysinkvideoconvert.c
	gst/playback/gstplaysinkvideoconvert.h
2011-11-07 12:23:15 +01:00
Wim Taymans
cf8481b990 fix pad template names for request pads 2011-11-04 10:49:48 +01:00
Wim Taymans
57fe2addef update for request pads change. 2011-11-03 17:58:57 +01:00
Mart Raudsepp
5c58bcfd15 decodebin2: Post all source pads in stream-topology messages as "element-srcpad" values
This allows us to easily get ahold of all pads on a stream-topology message, including
pre-decoder ones, while "pad" only gives us access to the raw pads (as used by discoverer).
2011-11-03 14:41:08 +01:00
Mart Raudsepp
cee8710817 decodebin2: Use existing "caps" quark for one of the structure sets 2011-11-03 14:40:51 +01:00
Wim Taymans
5bdfd6d899 structure: fix for api update 2011-11-02 09:04:27 +01:00
Tim-Philipp Müller
b52c5819fb Update for pad API changes
GstProbeType, GstProbeReturn and GstActivateMode -> GstPad*
2011-11-01 00:34:28 +00:00
Wim Taymans
016d036137 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	gst-libs/gst/audio/gstbaseaudiosink.c
	gst/audioconvert/channelmixtest.c
	gst/playback/gstplaybasebin.c
	gst/playback/gstsubtitleoverlay.c
	tests/examples/Makefile.am
	tests/examples/audio/Makefile.am
2011-10-27 15:44:58 +02:00
Nicolas Dufresne
cf9da5c280 decodebin2: Link elements before testing if they can reach the READY state
This is made possible by filtering errors. This is required to let
harware accelerated element query the video context. The video context
is used to determine if the HW is capable, and thus if the element is
supported or not.

Fixes bug #662330.
2011-10-22 08:27:31 +02:00
Vincent Penquerc'h
5e9862b2ba decodebin2: fire drained signal where appropriate
This will allow playbin2 to send its about-to-finish signal.
Taken out (apparently by mistake) by the EOS rewrite in july.

https://bugzilla.gnome.org/show_bug.cgi?id=661202
2011-10-17 15:36:25 +02:00
Wim Taymans
a00927ad03 Merge branch 'master' into 0.11 2011-10-04 17:58:49 +02:00
Sebastian Dröge
9117681b35 decodebin2: Use a TIME limit for pre-rolling in live streams and not in non-live streams
Fixes bug #647769 for real.
2011-10-03 10:55:53 +02:00
Edward Hervey
17bfba09f1 Merge branch 'master' into 0.11
Conflicts:
	ext/ogg/gstoggdemux.c
	ext/pango/gsttextoverlay.c
	gst-libs/gst/audio/gstaudioencoder.c
	gst-libs/gst/audio/gstbaseaudiosrc.c
	gst/playback/gstsubtitleoverlay.c
	gst/videorate/gstvideorate.c
2011-09-23 18:27:11 +02:00
Sebastian Dröge
61c6fcb2cd decodebin2: Only check if this is a discarded type if we have fixed caps
For unfixed caps we will get here again later when the caps are fixed.
2011-09-20 14:06:51 +02:00
Sebastian Dröge
8e114c427a decodebin2: Only call autoplug-continue with fixed caps
With unfixed caps we can't reliably decide if the final caps
are going to be "raw" (e.g. supported by a sink) or not.

We will get here again later when the caps are fixed.
2011-09-20 14:06:42 +02:00
Youness Alaoui
27058c1bc6 decodebin2: Initialize variable correctly
If subdrained isn't initialized to FALSE then a chain might think
that its group is drained when in fact it's not and this can cause
a switch too early or even cause a deadlock.
2011-09-19 12:36:48 +02:00
Edward Hervey
9d2bcb08fe decodebin2: Rewrite EOS-handling code
This is now really threadsafe and improves switching
between different groups.
2011-09-19 12:34:51 +02:00
Sebastian Dröge
936e87cdcf decodebin2: Fix non-prerolling pipelines and not-linked errors if a parser is available but no decoder
Fixes bug #658846.
2011-09-19 11:54:27 +02:00
Sebastian Dröge
21bc8ddcb7 Revert "Revert "decodebin2: Do a subset check before actually using a factory""
This reverts commit 5f5d832a3b.
2011-09-08 14:42:13 +02:00
Sebastian Dröge
0f654f3feb Merge branch 'master' into 0.11
Conflicts:
	docs/libs/Makefile.am
	tests/check/elements/decodebin2.c
2011-09-08 14:42:00 +02:00
Sebastian Dröge
5f5d832a3b Revert "decodebin2: Do a subset check before actually using a factory"
This reverts commit 50a88396ae.

See bug #658541.
2011-09-08 13:25:27 +02:00
Sebastian Dröge
9e2ce5bbb5 decodebin2: Make sure to fixate Parser/Converter caps before continuing autoplugging 2011-09-07 16:44:59 +02:00
Sebastian Dröge
46e26824d4 decodebin2: Intersect the factory caps with the current caps for the capsfilter
Otherwise we'll include many incompatible caps in the capsfilter that
will only slow down negotiation.
2011-09-07 14:20:36 +02:00
Tim-Philipp Müller
f93748fbd4 decodebin2: fix element factory refcounting
g_value_get_object() does not give us our own ref.

Fixes "Trying to dispose object "flacparse", but it still has a parent "registry0".
You need to let the parent manage the object instead of unreffing the object directly."
and similar warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=658416
2011-09-07 12:34:06 +01:00
Wim Taymans
8ee3da5bba Merge branch 'master' into 0.11
Conflicts:
	gst/playback/gstsubtitleoverlay.c
	tests/check/elements/decodebin2.c
2011-09-06 15:31:53 +02:00
Wim Taymans
7012e88090 Merge branch 'master' into 0.11
Conflicts:
	gst-libs/gst/audio/audio.h
	gst-libs/gst/audio/gstaudiodecoder.c
	gst-libs/gst/audio/gstaudiodecoder.h
	gst-libs/gst/audio/gstaudioencoder.c
	gst-libs/gst/audio/gstbaseaudioencoder.h
	gst/playback/Makefile.am
	gst/playback/gstplaybin.c
	gst/playback/gstplaysink.c
	gst/playback/gstplaysinkvideoconvert.c
	gst/playback/gstsubtitleoverlay.c
	gst/videorate/gstvideorate.c
	gst/videoscale/gstvideoscale.c
	win32/common/libgstaudio.def
2011-09-06 15:24:32 +02:00
Sebastian Dröge
50a88396ae decodebin2: Do a subset check before actually using a factory
This prevents autoplugging if the caps have a non-empty intersection
but are not accepted by the next element's pad.
2011-09-06 14:16:10 +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
de4fc848fa decodebin2: Actually iterate over the factories instead of only taking the first one 2011-09-05 20:32:42 +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
Wim Taymans
33467d9629 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	ext/pango/gsttextoverlay.c
	ext/theora/gsttheoradec.c
	gst/adder/gstadder.c
	gst/adder/gstadder.h
	gst/audioresample/gstaudioresample.c
	gst/encoding/gstencodebin.c
	gst/playback/gstdecodebin.c
	gst/playback/gstdecodebin2.c
	tests/check/elements/decodebin2.c
	tests/check/elements/playbin-compressed.c
	win32/common/libgsttag.def
2011-08-16 18:01:14 +02:00
Wim Taymans
e904c529e3 fix for _negotiated_caps() change 2011-08-15 12:18:15 +02:00
Tim-Philipp Müller
bb65192151 ext,gst: update for query API changes 2011-07-27 01:16:53 +01: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
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
Wim Taymans
d06f599193 -base: port elements to new video caps 2011-06-16 12:52:13 +02:00
Tim-Philipp Müller
59581d464f uridecodebin, decodebin: remove new-decoded-pad and removed-decoded-pad signals
They were deprecated, use "pad-added" and "pad-removed" instead.
2011-06-15 00:32:23 +01:00
Tim-Philipp Müller
5fd073e070 playback: merge playbin and decodebin plugins into one single playback plugin again 2011-06-15 00:02:13 +01:00
Tim-Philipp Müller
b5ef8efa1a decodebin2: rename decodebin2 to decodebin
But don't rename source file for now, which hopefully
makes merging from master easier.
2011-06-14 23:53:38 +01:00
Wim Taymans
f565812e25 playback: changes for message API changes 2011-06-08 13:45:41 +02:00
Wim Taymans
f91c753959 probes: port to new API for blocking and probes 2011-06-01 19:34:54 +02:00
Wim Taymans
c7428aeaae playbin: fixed for new pad block API 2011-05-30 18:36:14 +02:00
Wim Taymans
8501753033 -base: change for changed set_blocked API 2011-05-26 16:18:16 +02:00
Sebastian Dröge
8549dd352d Revert "decodebin2: Update for GstQuery related API changes"
This reverts commit 549128c2a3.
2011-05-17 11:24:18 +02:00
Sebastian Dröge
549128c2a3 decodebin2: Update for GstQuery related API changes 2011-05-16 17:13:14 +02:00
Sebastian Dröge
d0362c2b87 Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	ext/alsa/gstalsasrc.c
	gst-libs/gst/audio/gstbaseaudiosink.c
	gst-libs/gst/tag/gstxmptag.c
	gst/playback/gstsubtitleoverlay.c
	gst/videorate/gstvideorate.c
	sys/xvimage/xvimagesink.c
2011-05-16 17:06:22 +02:00
Sebastian Dröge
616181901e playback: Update for negotiation related API changes 2011-05-16 15:35:40 +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
Wim Taymans
ec57868488 -base: don't use buffer caps
Port to newest 0.11 core API, remove GST_PAD_CAPS and GST_BUFFER_CAPS.
2011-05-09 13:05:12 +02:00
Sebastian Dröge
64851f12c0 gst: Update for new GstIterator API 2011-05-05 16:03:52 +02:00
Wim Taymans
95f7fd8edf Merge branch 'master' into 0.11-fdo 2011-03-15 11:11:56 +01: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
Wim Taymans
c6dd11981d Merge branch 'master' into 0.11
Conflicts:
	configure.ac
	gst-libs/gst/pbutils/Makefile.am
2011-02-28 11:47:44 +01: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
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
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
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
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
Stefan Kost
69436bb8a6 decodebin2: add comment and whitespace trimming 2011-01-25 18:03:58 +02: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
Wim Taymans
f22687bacc use _object_ref_sink() when we can 2010-12-07 11:31:30 +01: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
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
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
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
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
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
Mark Nauwelaerts
60cad9f007 decodebin2: prevent another race with shutdown state change 2010-09-13 10:06:13 +02:00
Edward Hervey
9e0358930d playback: Switch to gstfactorylist from core
https://bugzilla.gnome.org/show_bug.cgi?id=626181
2010-09-03 19:31:52 +02:00
Edward Hervey
8b4bea5f6a playback: Delay usage of GstFactoryList
By delaying it to when it's actually needed, we speed things up a bit
since some elements might have been added/removed in between.

https://bugzilla.gnome.org/show_bug.cgi?id=626718
2010-08-13 17:00:05 +02:00
Wim Taymans
908afd4b15 decodebin2: use more efficient way of getting caps
When inspecting the caps of a pad, try to get the pad _CAPS first before calling
the getcaps function.
2010-08-04 10:33:31 +02:00
Edward Hervey
ec637580a8 decodebin2: Properly clean DecodeChain after errors.
If an error happens, the PAUSED state will never be reached. If an
application re-uses decodebin2 (like totem) where one would normally
set to READY between each file, the cleanup that normally happens in
the PAUSED=>READY codepath will never be called, resulting in the
following file to re-use the previous demuxer/decoder/...

https://bugzilla.gnome.org/show_bug.cgi?id=622807
2010-06-26 17:57:24 +02:00
Wim Taymans
6d2621d02c decodebin2: improve autoplugging
Use the pad caps when they are available to continue the autoplugging. If the
pad caps are set, they are fixed and then we can directly continue autoplugging.
2010-06-16 19:17:05 +02:00
Prahal
2cb7cfab19 decodebin2: use accumulator for autoplug-sort
Use an accumulator for the autoplug-sort signal so that we can stop the emission
when a signal handler produced a valid result. This avoids the object handler
to overwrite the results from user signals.

Fixes #621161
2010-06-14 11:19:10 +02:00
Edward Hervey
cbff745b49 decodebin2: Handle raw streams we don't want.
If a file contains raw streams (not requiring a decoder) that we do
not want (expose-all-streams == FALSE), we would previously consider
those of unknown-type (missing a decoder) ... whereas in fact it was just
because they don't need decoders.

This only applies if expose-all-streams is FALSE.
2010-06-04 19:30:14 +02:00
Edward Hervey
ac4188bd54 decodebin2: Add a property to not expose/decode all streams
API : expose-all-streams

If disabled:
* only the streams that CAN be decoded and match the final caps will have a
  decoder plugged in and be exposed.
* the streams that COULD HAVE BEEN decoded but do not match the finals caps
  will not have a decoder plugged in and will not be exposed.

If no decoder is available to decode a certain stream, then the missing element
message will still be emitted regardless of the value of the property.

https://bugzilla.gnome.org/show_bug.cgi?id=617868
2010-05-07 17:38:38 +02:00
Edward Hervey
e84b203de2 decodebin2: rename are_raw_caps to are_final_caps, correct comment
https://bugzilla.gnome.org/show_bug.cgi?id=617868
2010-05-07 17:18:37 +02:00
Edward Hervey
a58183459f decodebin2: Removing dead assignment.
The value of group is overwritten a few lines below before being used.
2010-04-01 13:53:37 +02:00
Benjamin Otte
5e21fa5e0e gst_element_class_set_details => gst_element_class_set_details_simple
Also change my email from the old university one to the current one.
2010-03-16 17:41:50 +01:00
Benjamin Otte
43b1683421 Add -Wmissing-declarations -Wmissing-prototypes to warning flags
Includes all the fixes necessary to make stuff compile again.
2010-03-11 13:50:31 +01:00
Sebastian Dröge
cdf53e5e86 decodebin2: First post a missing-plugin message, then emit the unkown-type signal
This makes sure that there *always* is a missing plugin message in the bus
before any errors or warning messages.
2010-02-15 08:26:05 +01:00
Sebastian Dröge
b37de8a63b decodebin2: Set ghostpad targets to NULL when freeing a decode chain
Otherwise the ghostpad will still be linked to the peer and there
will still be a reference kept, leading to nothing being unlinked
and destroyed until decodebin2 is finalized.

This fixes reuse of decodebin2 if a raw stream is connected to
its sinkpad.
2010-02-15 01:21:14 +01:00
Edward Hervey
c60f94da58 decodebin2: Don't skip an element when getting the topology
Fixes #608167
2010-01-26 17:29:21 +01:00
Mark Nauwelaerts
2482a536ac decodebin2: sprinkle some more locking
... to avoid races and ensure some data structure consistency.

See also #574289.
2010-01-16 18:48:00 +01:00
Mark Nauwelaerts
45447337ad decodebin2: mind blocked pads when shutting down
Fix regression in shutdown deadlock handling now that the
target of a ghostpad is blocked instead of ghostpad itself.

See also #574293.
2010-01-14 18:26:03 +01:00
Wim Taymans
22939b074c Merge branch 'master' of ssh://git.freedesktop.org/git/gstreamer/gst-plugins-base 2010-01-05 10:38:41 +01:00
Wim Taymans
15216d23ac decodebin2: fix typo in debug message 2009-12-23 21:24:48 +01:00
Wim Taymans
99e836a340 decodebin2: avoid some type checks 2009-12-23 18:18:03 +01:00
Wim Taymans
8266d201a0 decodebin2: add some debugging 2009-12-16 11:44:11 +01:00
Thiago Santos
0d6195686b decodebin2: error when all streams have no buffers
In some cases (all buffers dropped by a parser) a decodebin2
chain might receive an EOS before it gets enough data to
expose a decoded pad. In the case that no streams can expose
a pad we should error out instead of hang.

Fixes #542758
2009-11-19 14:51:33 -03:00
Thiago Santos
e3e7ba0d1a decodebin2: set to buffer less on no-more-pads
When a decodebin2 receives no-more-pads of a group it
can set that group's multiqueue buffering thresholds to
'playing' buffering method, avoiding that it buffers
too long and cause problems when using with queue2.
See the associated bug for details.

Fixes #600787
2009-11-18 15:16:18 -03:00
Sebastian Dröge
1da5a3f7d3 playback: Update factories list on every access if the registry has changed
This makes application's simpler because the element doesn't need to
go to NULL first to make use of newly installed plugins.

Fixes bug #601480.
2009-11-11 14:00:26 +01:00
Sebastian Dröge
ab96265c57 playback: When going from NULL->READY check if the registry has new features
This makes it possible to use newly installed plugins after going back
to NULL instead of requiring a new instance.

Fixes bug #599266.
2009-11-10 18:30:46 +01:00
Sebastian Dröge
6c15d9e8d4 decodebin2: Add property to disable/enable posting of stream-topology messages
Most people don't need this messages and generating them is quite
expensive.
2009-11-06 17:01:04 +01:00
Sebastian Dröge
5798b543df decodebin2: Protect subtitle elements and subtitle encoding by a new mutex
Using the object lock here can and will lead to deadlocks because
of deep-notifies of property changes: the deep-notify handler will
get the parent of objects, which will take the object lock again.

Fixes bug #600479.
2009-11-06 15:15:06 +01:00
Stefan Kost
a78c8bf3ed pad: rename new api from _refed to _reffed.
Due to popular demand rename the new api as we still can.
2009-11-05 13:00:27 +02:00
Wim Taymans
89f02fb269 decodebin2: use new getcaps function to avoid copies
Use the gst_pad_get_caps_refed() to avoid some caps copy functions.
2009-11-04 18:31:09 +01:00
Sebastian Dröge
0285d77d96 decodebin2: Use static caps for the default raw caps and put them into a separate header
This way we can use the same default raw caps everywhere.
2009-11-03 13:03:23 +01:00
Tim-Philipp Müller
6f4c1ac583 Remove GST_DEBUG_FUNCPTR where they're pointless
There's not much point in using GST_DEBUG_FUNCPTR with GObject
virtual functions such as get_property, set_propery, finalize and
dispose, since they'll never be used by anyone anyway. Saves a
few bytes and possibly a sixteenth of a polar bear.
2009-10-28 00:59:35 +00:00
Wim Taymans
0b00e25b54 decodebin2: implement low/high watermark property 2009-10-27 15:22:22 +01:00
Wim Taymans
f998858192 decodebin2: buffering is implemented now 2009-10-24 16:09:59 -04:00
Wim Taymans
3d2b3dd268 decodebin2: configure use-buffering on multiqueue 2009-10-24 16:09:59 -04:00
Wim Taymans
baecd335b2 decodebin2: refactor queue size configuration.
Refactor the queue size configuration into a new method.
Use the same queue values for buffering as for preroll.
2009-10-24 16:07:36 -04:00
Wim Taymans
cffe4d7bd3 decodebin2: move error path down 2009-10-24 16:07:36 -04:00
Wim Taymans
1c982d0dbe decodebin2: implement max queue size properties 2009-10-24 16:07:36 -04:00
Wim Taymans
3fffb0e2dd decodebin2: add properties for buffering
Add properties that can be used to configure the multiqueue buffers and
buffering methods
2009-10-24 16:07:36 -04:00
Edward Hervey
891c54f6f8 gst/decodebin2: Ensure we get fixed caps for topology message
There are some corner cases (like with dvdemux amongst others) where
the caps won't be negotiated, but the pad has fixed caps.
2009-10-20 10:15:57 +02:00
Edward Hervey
64c8b1d5d9 gst/decodebin2: Don't expose chains if we're shutting down.
This avoids adding flushing pads to ourself
2009-10-20 10:15:48 +02:00
Sebastian Dröge
efcca84bac decodebin2: Post a element message on the bus with the stream topology
Fixes bug #598533.
2009-10-15 13:35:29 +02:00
Sebastian Dröge
50fdbcd9ea decodebin2: Store the "endcaps" of a chain
This are the caps that either resulted in a deadend if
no plugin for them could be found or raw caps.
2009-10-15 13:35:29 +02:00
Sebastian Dröge
366aaae825 decodebin2: Store for every chain, which pad resulted in its creation 2009-10-15 13:35:28 +02:00
Sebastian Dröge
d40246ff7d decodebin2: Ignore no-more-pads from non-demuxer elements
instead of printing an error that no corresponding group could
be found. no-more-pads from non-demuxer elements doesn't give
any additional information because there can only be a single srcpad.

Fixes bug #598288.
2009-10-13 16:52:43 +02:00
Jan Schmidt
592b8ecb09 decodebin2: Fix type-punning warning 2009-10-08 00:17:21 +01:00
Sebastian Dröge
9bd6fe41cb decodebin2: Chains with an exposed endpad are complete too
This allows partial group changes, i.e. demuxer2 in the example below
goes EOS but has a next group and audio2 stays the same.

          /-- >demuxer2---->video
demuxer---             \--->audio1
          \--->audio2
2009-10-07 17:46:30 +02:00
Sebastian Dröge
bf7cd0ed81 decodebin2: Use the iterate internal links function instead of string magic to get multiqueue srcpads 2009-10-07 17:46:29 +02:00
Sebastian Dröge
cf9c6a2271 decodebin2: Rewrite autoplugging and how groups of pads are exposed
This now keeps track of everything that is going on, creates
a tree of chains and groups to allow "demuxer after demuxer" scenarios
and allows chained Oggs with multiple streams (needs oggdemux or playbin2 fixes).

Also document everything in detail and give a general overview of what
decodebin2 is doing at the top of the sources.

Fixes bug #596183, #563828 and #591677.
2009-10-07 17:46:28 +02:00