Commit graph

514 commits

Author SHA1 Message Date
Wim Taymans
779d6f886d uridecodebin: reset counter
reset the number of pending dynamic operations back to 0 when we reuse
uridecodebin.
Fixes #576190
2009-03-23 12:28:18 +01:00
Wim Taymans
554b3aafe4 decodebin2: a pad starts out being not drained.
Mark a new pad as not drained until we get EOS on it.
2009-03-20 15:47:47 +01:00
LRN
23e603f054 win32: fix seeking in large files
Fix Seeking in large files by using the 64-bit seek functions.
Fixes #576019
2009-03-20 14:17:19 +01:00
Wim Taymans
600a810236 decodebin2: recover from failing to add a pad
When we cannot add a pad to the decodebin2 for some reason, print a warning but
continue adding the remaining pads.
2009-03-19 20:31:01 +01:00
Wim Taymans
20468a22c9 decodebin2: more cleanups and docs.
Add some more comments and use g_list_prepend().
2009-03-19 19:35:15 +01:00
Wim Taymans
17e7948325 decodebin2: refactoring and race fixes
Refactor some code so that we can take the right locks and in the right order.
Fixes quite a bit of races already.
2009-03-19 19:19:38 +01:00
Wim Taymans
2f39597919 playbin2: remove the group cond + cleanups
Remove the group GCond that we used for waiting for groups to finish because we
use pad blocking on the selectors and counters instead for waiting for the
groups to complete.

remove the obsolete about_to_finish variable set while emiting the
about-to-finish signal and fix some old comments.

We don't need to take the playbin lock when querying the uridecodebin.
2009-03-19 19:03:25 +01:00
Wim Taymans
563db0fdca decodebin2: add extra dynamic ref for demuxers
When we make a group connected to a demuxer, keep an extra dynamic refcount for
the group which is only decremented when no_more_pads or a multiqueue overrun is
detected. This way we avoid a race between exposing the group while more dynamic
refs are added from new pads.

Fixes #575588.
2009-03-17 19:09:02 +01:00
Wim Taymans
da6a544bdf playbin2: sync state of the sink correctly
Sync the state of the newly added chains to the state of the parent sink element
to avoid lost async-start messages. Fixes cdda:// async-done message storm.
2009-03-17 15:39:23 +01:00
Wim Taymans
a8579ffea0 playbin2: return NOT_LINKED for unselected streams
When streams are not selected in the selector, return NOT_LINKED so that
upstream elements can skip decoding. Only do this for audio and video pads
because for text streams the overhead is smaller and they could come from
external files.
2009-03-17 11:54:40 +01:00
Wim Taymans
5021c930ba playbin: set custom text sink properties
Set the custom sink async=FALSE to not make it participate in preroll because we
are dealing with sparse streams.
Try to set sync=TRUE on the custom text sink.
2009-03-17 11:51:58 +01:00
Wim Taymans
48f7f6b7c2 playbin2: don't try to set invalid stream numbers
Fix a problem with setting the stream numbers because we check for the wrong
range.
See #575239.
2009-03-16 16:42:18 +01:00
Wim Taymans
ba6d3b5aca playbin2: release the shutdown lock
Release the shutdown lock when we wait for other groups to complete or else we
have a deadlock when the other group completes and tries to grab the shutdown
lock.
Fixes #575550.
2009-03-16 16:16:30 +01:00
Wim Taymans
777f8ab1bf playbin2: fix raw elements like cdda://
Fix a fixme with a one liner and make cd playback work again.
2009-03-12 18:27:25 +01:00
Wim Taymans
7849db42b8 playbin2: improve subtitle handling
Add property to playbin2 to configure a custom sink that receives the raw
subtitle buffers instead of using a textoverlay.
Improve the property finding code to make it more usable.
Use property find code to find async properties in custom sinks that are bins.
Improve text overlay code to gracefully handle missing elements.
2009-03-12 17:51:39 +01:00
Wim Taymans
72533ecccc decodebin2: only remove pads that were added
Flag pads that were added so that we can see if we need to remove them later or
not.
2009-03-09 15:46:21 +01:00
Mark Nauwelaerts
b7ea2a9105 Unblock blocked ghostpads when shutting down. Fixes #574293. 2009-03-09 13:32:21 +01:00
Michael Smith
e9e9d82fbe decodebin2: don't stay connected to notify::caps after negotiation
Disconnect the notify::caps signal in our callback (it'll be re-added
if we're not, in fact, finished getting complete caps). Ensures that
caps changes mid-stream (e.g. from an mp3 that changes from
stereo->mono mid-file) don't cause us to try to add a new pad.
2009-03-05 15:44:17 -08:00
Stefan Kost
5e6447c0ac docs: fix random text after since: tag. Also fix class name to make the docs actual appear. 2009-02-26 10:10:00 +02:00
Stefan Kost
a6ea8280a2 docs: playbin2 has no stream-info 2009-02-26 10:09:59 +02:00
Wim Taymans
f5a3387bdb playbin: use flushing pads instead of fakesink
Use the flushing pads on playsink to terminate on shutdown instead of plugging
fakesinks. this should be a little cheaper.
2009-02-25 12:48:53 +01:00
Wim Taymans
747841e97c playsink: Add FLUSHING pad type
Make it possible to request a flushing pad from the playsink. We can eventually
use these flushing pads to quickly terminate the dataflow when we are shutting
down.
2009-02-25 12:48:53 +01:00
Wim Taymans
dbfc80cd6c Release the group lock when setting states
Release the group lock while we perform the state changes on the uridecodebins
because that might trigger callbacks that we need to handle with the group lock
taken. Avoids a possible deadly embrace in some id3/flac files.
Fixes #567396.
2009-02-25 10:08:29 +01:00
Wim Taymans
0b2238b70b Combine finding and creating groups
Combine the search for the current group and optionally creating one into one
function so that we can avoid taking the lock multiple times.
2009-02-25 10:05:38 +01:00
Edward Hervey
2968cc8710 Playbin2: Don't leave unused parameters in debug statements.
Fixes build on macosx
2009-02-25 08:22:00 +01:00
Wim Taymans
b725e1d2c6 Add some G_UNLIKELY because we can
Add a G_UNLIKELY when checking the shutdown variable.
2009-02-24 18:44:54 +01:00
Mark Nauwelaerts
d24e75f9fa playbin2: fix deadlock when shutting down. Fixes #572577. 2009-02-24 13:30:07 +01:00
Mark Nauwelaerts
bbd66c6baf playbin2/playsink: Set audiotee to PAUSED state in all cases. Fixes #565105. 2009-02-24 10:46:35 +01:00
Michael Smith
4713bb3abc Revert "Remove pad-removed handlers after setting the decodebins to NULL."
This reverts commit b36d8f3e11.

This brought back some deadlocks. A small leak is better, for now. Need to
figure out a way to fix the leak properly.
2009-02-10 20:38:58 -08:00
Michael Smith
41314315c7 playbin2: Fix segfault on notify after group change.
If our group has been switched, then we get a selector active-pad
notification, we don't need to notify.
2009-02-10 17:20:12 -08:00
Michael Smith
a264efc627 playbin2: Look for volume/mute properties recursively in audio element.
Rather than only checking for volume property on the audio sink
directly, recursively look for it on sinks within it (if it's a bin).
Allows use of sink-as-volume-control where the application has supplied
an audio-sink bin that includes a real audio sink internally.
2009-02-10 17:20:12 -08:00
Stefan Kost
f010a38b0d playbin2: implement GST_PLAY_FLAG_NATIVE_{AUDIO,VIDEO}
The flags where present but actually not been taken into account.
2009-02-04 13:56:14 +02:00
Wim Taymans
9996aab207 Fix documentation for autoplug-select
fix the documentation strings for the autoplug-select signal.
Fixes #570142.
2009-02-02 12:54:31 +01:00
Michael Smith
b36d8f3e11 Remove pad-removed handlers after setting the decodebins to NULL.
They do needed cleanup; without this we leak selector requestpads.
2009-01-30 18:30:10 -08:00
Michael Smith
61e81ada2c Unref selector request pad even if we no longer have a selector.
During destruction, we won't have a selector any more, but we still need
to unref the pad to avoid leaking it.
2009-01-30 18:30:10 -08:00
Michael Smith
c799f3f77f Unref source in playbin2's finalize method 2009-01-30 18:30:10 -08:00
Michael Smith
b6cbe7e331 Fix more leaks of pads and elements in gstplaysink.
Don't keep extra references to volume and mute elements; we don't need
to do so.
Ensure we unref pads that we have references to, and release request
pads.
2009-01-30 18:30:10 -08:00
Michael Smith
c34f444174 Avoid leaking all playsinks. Fix some internal leaks.
Playsink was holding references to itself. Don't do that, it's not cool.
Also, free all chains in dispose.
2009-01-30 18:30:10 -08:00
Michael Smith
906502b9bb Unref peer request pad after releasing it, since we hold a reference. 2009-01-30 18:30:10 -08:00
Michael Smith
af8d3c51f0 Fix caps leak in playbin2. 2009-01-30 18:30:10 -08:00
Michael Smith
ef1fa84575 Unref active pad from selector when finding active stream. 2009-01-30 18:30:10 -08:00
Michael Smith
f7abf8ed94 Free uris when finalizing playbin2 instance. 2009-01-30 18:30:10 -08:00
Michael Smith
a2b0229058 Unref pads when iterating over them in analyse_source.
Fixes leak of source's srcpad when using uridecodebin.
2009-01-30 18:30:09 -08:00
Jan Schmidt
5337bc03be Fix compilation warning on Forte 2009-01-30 17:58:15 +00:00
Wim Taymans
8dd3c2d543 Use more performant link function
We can use gst_element_link_pads() instead of the more generic
gst_element_link() function because we know the pads. This saves some cycles
because the more generic function needs to search for possible compatible caps
etc.
2009-01-23 11:37:45 +01:00
Jan Schmidt
c42c6d6da0 Fix use-after-unref problem noticed by Josep Torra Valles, and run
gst-indent
2009-01-22 22:09:47 +00:00
Wim Taymans
397c00ac33 gst/playback/gstplaybin2.c: Provide the right arguments to a debug line.
Original commit message from CVS:
* gst/playback/gstplaybin2.c: (groups_set_locked_state):
Provide the right arguments to a debug line.
2009-01-13 14:47:19 +00:00
Wim Taymans
1e5f963882 gst/playback/gstplaybin2.c: Fix some comments and docs.
Original commit message from CVS:
* gst/playback/gstplaybin2.c: (gst_play_bin_class_init),
(gst_play_bin_set_uri), (gst_play_bin_set_suburi),
(no_more_pads_cb), (drained_cb), (group_set_locked_state_unlocked),
(activate_group), (deactivate_group), (groups_set_locked_state),
(gst_play_bin_change_state):
Fix some comments and docs.
Post an error message when we fail to link the selector to the sink.
Remove pushing of EOS, this seems unneeded.
Lock the state of deactivated groups so that they don't accidentally
reactivate when the playbin2 state changes.
Reuse uridecodebins.
Unlock and relock state of groups when playbin goes to NULL.
Fixes #566654.
Fixes #566341.
* gst/playback/gsturidecodebin.c: (pad_removed_cb), (type_found):
Only do something in the pad removed callback when we are dealing with
our sourcepads because the sinkpads don't have a ghostpad.
2009-01-07 13:52:14 +00:00
Wim Taymans
8632fc5545 gst/playback/gstplaybin2.c: Disconnect signal handlers before destroying a previous decodebin so that we don't end up...
Original commit message from CVS:
* gst/playback/gstplaybin2.c: (notify_source_cb), (activate_group):
Disconnect signal handlers before destroying a previous decodebin so
that we don't end up causing deadlocks. Fixes #566586.
2009-01-05 12:18:52 +00:00
Wim Taymans
dba6f1f28c gst/playback/gstplaybin2.c: Add some debug info.
Original commit message from CVS:
* gst/playback/gstplaybin2.c: (no_more_pads_cb):
Add some debug info.
* gst/playback/gstplaysink.c: (gen_video_chain), (gen_audio_chain),
(gst_play_sink_reconfigure), (gst_play_sink_request_pad),
(gst_play_sink_release_pad):
Add some more debug info.
Reconfigure the audio chain when we switch between raw and encoded audio
in gapless playback.
2008-12-20 12:48:43 +00:00