Commit graph

182 commits

Author SHA1 Message Date
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
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
fe856a3f7c playsink: gen_video_deinterlace_chain() always returns a bin, no need to check that 2010-12-02 19:04:28 +01: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
168aceb3da playback: Switch to using gst_video_convert_frame
https://bugzilla.gnome.org/show_bug.cgi?id=629157
2010-09-14 08:42:43 +02:00
Edward Hervey
e75e7dfa80 playback: Set queues silent property to TRUE
We don't use the queue signals within playsink.
2010-08-31 10:12:54 +02:00
Mark Nauwelaerts
2379e96bbc playsink: remove some heuristic in chain configuration code
.. since queues are now inserted unconditionally.
2010-08-12 10:52:59 +02:00
Mark Nauwelaerts
6c5b437118 playbin2/playsink: update subtitle handling for streamsynchronizer
Streamsynchronizer excepts to see stream-changed msg for all streams, but to
arrange for this, video and subtitle streams need to be decoupled by means
of queues (due to pad blocks that may occur).

Fixes #626463.
2010-08-12 10:52:59 +02:00
Mark Nauwelaerts
ff8bdcfe94 playsink: always have a queue in chain head to aid streamsynchronizer
Specifically, as the latter may have one thread pushing EOS to several streams,
that needs to be decoupled into various thread to prevent preroll hanging
problems.
2010-08-12 10:52:58 +02:00
Mark Nauwelaerts
1a40681f53 playsink: set READY sinks to NULL before freeing chain upon failure 2010-08-12 10:52:58 +02:00
Edward Hervey
b93edac480 playsink: Switch to faster pad linking methods
Logic for choice of GST_PAD_LINK_CHECK_* is as follows:
* Where return of pad_link wasn't checked before : NOTHING
* Where linking is between known compatible elements : NOTHING
* All other cases : TEMPLATE_CAPS

Slashes down playsink reconfigure by up to 50% cpu time.
2010-07-20 21:05:45 +02:00
Sebastian Dröge
c199a560a9 playsink: Set add-borders=true on the videoscale instances
This makes sure that we always keep the display aspect ratio and
add black borders if necessary, which is usually something you want
for viewing a video.
2010-07-19 15:59:17 +02:00
Sebastian Dröge
a16024d9fb playsink/streamsynchronizer: Remove and deactivate pads after calling the change_state function of the parent class
Fixes some deadlocks.
2010-07-16 18:51:35 +02:00
Sebastian Dröge
405b47a79a playsink: Fix gapless playback in many non-simple scenarios
Before gapless playback failed when switching between audio-only,
video-only and audio-video files, when choosing different clocks
and when the different streams had different durations.

This is now handled by a helper element, which keeps track of the
running times of all streams and synchronizes them.

Fixes bug #602437.
2010-07-16 17:40:46 +02:00
Mark Nauwelaerts
5e7ff51d19 playsink: use proper error message code for failing state change 2010-07-16 13:26:26 +02:00
Wim Taymans
7379202cca playsink: clear ts-offset pointer
We need to clear the pointer to our ts-offset element when we destroy the video
chain elements to make sure nobody derefs it to invalid memory afterwards.
2010-06-23 12:10:32 +02:00
Edward Hervey
97e14fda28 playsink: Reset ts_offset field when freeing chain
Otherwise we would end up with a bogus ->audiochain->ts_offset field
which would cause segfaults/assertions when trying to modify the
'ts-offset' property in update_av_offset().

Was easy to trigger when using a list of audio+video files mixed with
video-only files in totem.
2010-06-23 10:16:07 +02:00
Wim Taymans
ecc9a28152 playbin2: add av-offset property
Add av-offset property to control the audio and video sync offset. This can be
used to to manually correct badly synced streams.

See #620529
2010-06-07 14:38:42 +02:00
Wim Taymans
31ef191f01 playsink: add convert-frame action signal
Add a convert-frame action signal.

Fixes #620279
2010-06-05 11:09:41 +02:00
Wim Taymans
afcf3a3517 playbin2: move convert_frame to playsink
Move the convert_frame function to playsink and make it part of the API. This is
in preparation to add the convert_frame signal to playsink.

See #620279
2010-06-05 11:09:40 +02:00
Wim Taymans
823089cf68 playsink: add property to get the last frame
Add a property to get the last video frame.

See #620279
2010-06-05 11:09:40 +02:00
Sebastian Dröge
0c85f2c890 playsink: Don't fail if subtitles are used but only audio is available and no visualizations
Instead simply disable displaying of the subtitles for now, as was
intended by that part of code...

Fixes bug #610866.
2010-05-14 17:17:33 +02:00
Sebastian Dröge
e5304c3040 playsink: Fix deadlock caused from an additional lock instead of unlock
Also improve debug output for the playsink lock.
2010-05-14 17:13:17 +02:00
Mark Nauwelaerts
85a8a09ce7 playsink: disconnect signals in some more cleanup cases 2010-05-06 15:41:52 +02:00
Sebastian Dröge
eec0f7c876 playsink: Add support for deinterlacing
This is disabled by default and can be enabled with the
deinterlace flag.

Fixes bug #547603.
2010-04-29 18:21:21 +02:00
Sebastian Dröge
6c9ead7030 playsink: Correctly reconfigure the video chain when switching from a subtitle to a non-subtitle file
Fixes bug #616422.
2010-04-29 18:21:21 +02:00
Edward Hervey
8db7eb4037 gstplaysink: Remove unused variable.
The value of klass is never used
2010-04-01 13:55:15 +02:00
Robert Swain
6515b43e40 playsink: Fix aduio_raw_sink typo 2010-03-30 15:10:42 +02:00
Sebastian Dröge
bd2277d214 playsink: Avoid g_object_set() on NULL if a text sink is used
Fixes bug #611702.
2010-03-15 14:26:28 +01:00
Benjamin Otte
3a7d632a59 Add -Wredundant-decls to warning flags
... and fix all the warnings that flag throws.
2010-03-11 15:38:18 +01:00
Mark Nauwelaerts
0f6cf41947 playsink: provide correct error message if configured audio/video sink fails 2010-03-10 14:37:05 +01:00
Sebastian Dröge
71ca26fc7f playsink: Don't fail if there are subtitles and audio but no video
Change playbin2 to not error out if there are subtitles and audio
but no video. If visualizations are enabled the subtitles are rendered on top
of the visualization stream, otherwise the subtitles are not linked at all and
only the audio is played (and a warning message is posted).

If there are only subtitles but neither audio nor video an error message is
still posted.

Fixes bug #610866.
2010-03-09 21:01:38 +00:00
Josep Torra Valles
25fc69e6aa playsink: avoid g_object_set() on NULL pointers
There may not be an overlay element if a text-sink is set.

Fixes #611702.
2010-03-03 20:15:44 +00:00
Sebastian Dröge
ff21fe1d25 playbin2, playsink, subtitleoverlay: Set subtitle encoding properly
For this add subtitle encoding properties to playsink and subtitleoverlay
and update the values in the containing elements.

Also update the font description in textoverlay or the used renderer
element if it is changed during playback.

Fixes bug #610310.
2010-02-22 20:47:34 +01:00
Sebastian Dröge
9fa9834535 playsink: Ghost the video sinkpad if a text sinkpad is available
Only don't ghost it if no visualizations are need and if
no text is needed and no textchain was created yet.

Fixes bug #610379.
2010-02-19 17:44:18 +01:00
Sebastian Dröge
dbf632f3fb playsink: Post missing element messages if a core plugin is missing
And post a warning in cases where we can still continue to work
or an error when the missing element is fatal.
2010-02-15 08:46:26 +01:00
Josep Torra Valles
d58f4fcf48 playsink: Reset the sink's state to NULL before unreffing it unless it's the same instance again
This makes sure that we don't destroy the last reference before the
element gets back to NULL state. Fixes assertion failures if a playbin2
instance is reused but different sinks are automatically chosen because
of different caps.
2010-02-12 19:43:13 +01:00
Tim-Philipp Müller
b0fe1867d4 playsink: re-use iterator callback to avoid code duplication 2010-01-18 10:10:27 +00:00
Tim-Philipp Müller
7216605ffa playsink: when looking for sink properties, make sure they have the right type
We don't want to end up setting values on elements where the property is of
a different type than we expect. Can't transform the value either, since we
can't really make assumptions about the scale and transform function.

Fixes crashes when using playbin2 with apexsink (#606949).
2010-01-18 10:10:27 +00:00
Sebastian Dröge
3b842bc98b playsink: Fix disabling of subtitles if subtitles were used before
In this case the video still goes through the text chain and
subtitles are still going in there, in case subtitles are
enabled again. This makes sure that re-enabling subtitles
happens instantly.

Fixes hanging video when disabling subtitles, caused by an
unliked video pad.
2010-01-14 13:36:23 +01:00
Brijesh Singh
0fe6b6e8ab playsink: Fix handling of the native audio/video flags
Fixes bug #606687.
2010-01-13 09:39:54 +01:00
Wim Taymans
26071d748f playsink: fix video when subtitles disabled
When we have a source with subtitles but they were disabled with the flags,
still ghostpad the video pad instead of leaving it unlinked.
2009-12-09 12:11:55 +01:00
Sebastian Dröge
49fd39c3fd playsink: Some minor cleanup 2009-12-07 09:13:40 +01:00
Wim Taymans
c4d7dbce1a playsink: make sure we always go to PAUSED async
Set the need_async_start flag before going to PAUSED so that we always post the
ASYNC_START message, even after reusing playsink.
2009-11-17 16:39:09 +01:00
Wim Taymans
65773b58dd playsink: make sure we remain a sink
When we remove our elements, we could lose our sink flag. Make sure we remain a
sink by setting the flag again after removing elements.
2009-11-17 16:37:57 +01:00
Sebastian Dröge
b02d9837f7 playbin2/playsink: Use new "silent" property instead of unlinking
This makes sure that subtitleoverlay still gets segment updates and
everything to pass on downstream. Without this segment problems happen.
2009-11-12 13:20:41 +01:00
Sebastian Dröge
ced1b8f897 playbin2/playsink: Remove everything related to subpicture streams
These will soon be handled the same way as subtitle streams.
2009-11-12 13:20:40 +01:00
Sebastian Dröge
dcc109bd9a playsink: Add a queue before subtitleoverlay
This will improve playback, and the same thing is done
for subpicture streams too.
2009-11-12 13:20:40 +01:00
Sebastian Dröge
c0828e55b6 playsink: Use subtitleoverlay for subtitles 2009-11-12 13:20:40 +01:00
Tim-Philipp Müller
23f92ed8cd playsink: assign chain->mute before using it
Fixes GObject warnings when starting totem.
2009-11-10 01:06:17 +00:00
Sebastian Dröge
e72c3029c0 playsink: Reset {mute,volume}-changed flags after setting the volume
These flags are there to make sure that the volume is set, if there
is no volume element yet.
2009-10-30 09:24:30 +01:00
Sebastian Dröge
598c937634 playsink: If notify::{volume,mute} is triggered by the volume element, update our internal state 2009-10-30 09:24:03 +01:00
Sebastian Dröge
d85dadc122 playsink: Proxy notify::volume and notify::mute from the volume/mute elements (or sinks)
Fixes bug #600027.
2009-10-29 14:30:31 +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
Sebastian Dröge
a4f454dc24 playbin2/playsink: Use gst_object_ref_sink() instead of calling both separately 2009-10-07 07:21:37 +02:00
Wim Taymans
a8d7e6a490 playsink: make the lock recursive for now
Fixes #583255
2009-10-01 09:35:54 +02:00
Wim Taymans
f18ed7abf9 playsink: fix the vis property getter 2009-10-01 09:35:54 +02:00
Edward Hervey
b565a3088c playsink: Expose mute,volume,vis-plugin and font-desc properties
https://bugzilla.gnome.org/show_bug.cgi?id=594623
2009-09-14 12:26:05 +02:00
Edward Hervey
377e781ad5 GstPlaySink: Expose 'reconfigure' as an action signal. 2009-09-14 10:40:00 +02:00
Edward Hervey
bafe9082fd GstPlaySink: Expose flags as a gobject property. 2009-09-14 10:40:00 +02:00
Edward Hervey
02c50388c4 playback: Register playsink as an element.
This allows using playsink from outside the playback plugin.

Add code to be able to request the sink pads using standard GStreamer API.

TODO : expose GObject properties/signals.
2009-09-14 10:39:59 +02:00
Wim Taymans
2a5cd16eb1 fix whitespace 2009-09-08 13:02:46 +02:00
Sebastian Dröge
b7fa34a279 playsink: Also send SEEK events directly to a subpicture sink 2009-08-18 11:15:41 +02:00
Sebastian Dröge
b5f84c0637 playsink: If a custom text sink is used, send events to it too
Before, SEEK events would be sent to the video sink, which wouldn't
be linked in any way to the subtitle part of the pipeline and
subparse would never see the SEEK event. This would then seek
the audio/video but the subtitles would continue from the old
position instead.

Fixes bug #591664.
2009-08-18 08:39:02 +02:00
Tim-Philipp Müller
4871cd9254 playbin2: fix error message string
Fixes #591577.
2009-08-13 10:59:35 +01:00
Edward Hervey
8cd1b5209b gst: Remove dead assignments and resulting unused variables 2009-08-08 15:54:02 +02:00
Stefan Kost
007da06645 playbin2: smarter sink selection. Fixes #588523
Don't do fallbacks if application specified a sink element. When doing the
fallback use configured default elements instead of hardcoded linux only
elements. Improve error messages accordingly.
2009-08-06 15:07:02 +03:00
Stefan Kost
aab2e110a1 playsink: remove unused property defs 2009-06-30 14:45:51 +03:00
Jan Schmidt
ee7fd4c28d playsink: Avoid a segfault when the video sink fails to start
Don't attempt to display the subpictures and segfault when the
video sink failed to start (and hence the videochain is NULL).
2009-06-29 14:35:03 +01:00
René Stadler
61441ff183 playbin2: fix initial volume handling also when reusing the element
This is a follow-up to commit 452988, making it work correctly when the audio
chain is reused.
2009-06-27 16:36:11 +03:00
Wim Taymans
a31c3bfc60 playsink: set the sink flag on the element 2009-06-16 18:20:05 +02:00
Wim Taymans
6a7d0ebf2a playsink: update for new step API 2009-06-12 13:52:02 +02:00
Wim Taymans
ea97973efe add framestepping to playbin2 and seek 2009-06-01 11:31:49 +02:00
Tim-Philipp Müller
effa5e69d9 playbin2: fix volume handling for audio sinks without "volume" property
When using an audio sink without a "volume" property, volume control
would only work for the first song. For the next song, we'd try to
re-use the existing audio chain, but inadvertently set chain->volume
to NULL instead of to the existing volume element.
2009-05-28 20:49:22 +01:00
Tim-Philipp Müller
18fc3e6e18 playbin2: cosmetic change to avoid unnecessary line breaks
Looks nicer and works around gst-indent silliness.
2009-05-28 17:05:55 +01:00
Wim Taymans
3f20b0522a playbin2: don't lose the ref to the volume element
Only release the ref to the volume element when it is controled by a sink. For
software volume we never have to fear that it will change.
2009-05-28 17:21:35 +02:00
Tim-Philipp Müller
7620d8800d playbin2: actually use configured audio/video sinks
playbin2 inadvertently used autoaudiosink and autovideosink up to now,
since it would overwrite the sinks configured via the "audio-sink"
and "video-sink" properties with the stream-specific group sinks when
configuring the outputs. Those are usually NULL however, so that would
overwrite the configured sinks with NULL which makes playbin2 then
default to the auto sinks. Fix this by keeping a reference to each
configured sink in playbin2 and setting up the right sinks depending
on whether there is a stream-specific sink or not.

Fixes #584020.
2009-05-28 15:30:27 +01:00
Wim Taymans
de06a6adb5 playbin2; release refs to volume/mute properties
Release the refs to the volume and mute property elemens before setting the
child elements to READY or NULL.
Fixes #583318
2009-05-27 15:45:25 +02:00
Stefan Kost
45298860fc playbin2: fix initial volume and mute handling
Use two flags to remember volume/mute changes at times when we don't have the
audiochain yet (e.g. construction). Only set values when they were actualy
changed. This makes pulseaudio's stream restore functional.
2009-05-22 15:49:14 +03:00
Jan Schmidt
768cadf093 playbin2: Fix cdda:// playback
Don't send async-start when the playsink has already been configured
before changing state.
2009-05-14 22:50:53 +01:00
Wim Taymans
e1aa348246 playbin2: make fallback identity silent
Set the signal-handoffs to FALSE and silent to TRUE for the fallback identity
element so that it consumes less CPU.
2009-05-12 10:38:15 +02:00
Wim Taymans
c6f6282fde playbin2: handle custom audiosinks differently
Keep track of the autoplugged custom sinks and configure them in the playsink
element when we have collected all streams.
Also make sure that we only select one custom sink.
When unreffing the internal sink, we don't need to change the state to NULL.
2009-05-12 10:37:45 +02:00
Wim Taymans
0b372dd371 playbin2: unify custom sink get/set functions
Use one function to set/get all of the different sink types.
cleanup up the subpicture chain too.
Allow setting a custom subpicture sink.
2009-05-12 10:36:25 +02:00
Wim Taymans
691a52975e playbin2: fix resume after pause
Don't ignore the state change of the children, they might be doing an ASYNC
state change.
2009-05-08 13:11:01 +02:00
Wim Taymans
52da312fa5 playsink: initialize variable too 2009-05-07 15:19:05 +02:00
Wim Taymans
c05541c195 playbin2: make playsink go ASYNC to PAUSED
Make playsink go async to the PAUSED state instead of relying on uridecodebin
for async behaviour in playbin. This solves some problems (mainly with DVD)
where the pipeline would go to PLAYING before preroll completed, failing to
select the audiosink clock.
Fixes #581727
2009-05-07 14:28:30 +02:00
Wim Taymans
5eed96dc06 playbin2: clear the target
Clear the target of our ghostpads before we remove the pad from the element.
This to make sure that the internal pad is not left linked to whatever pad we
were ghosted to. This should only be a problem when we leak the ghostpads.

Also release our subpicture pads.

Fixes #577288.
2009-04-14 13:55:52 +02:00
Wim Taymans
1a557e60ea playbin2: fix refcounting of visualisations
See #577794.
2009-04-10 13:42:56 +02:00
Wim Taymans
33ef15fad6 playsink: fix refcounting of custom elements
Sink the custom sinks, let other elements we create be sunken by the bin we add
them to.
Fixes #577794.
2009-04-10 13:27:41 +02:00
Stefan Kost
509256dce5 playbin2: better error message on sink failure
If we could create the sinks, but the don't work, don't send the missing plugin
message and report that the state-changed failed.
2009-04-08 16:43:27 +03:00
Wim Taymans
9bf8277d13 playbin2: add more support for subpictures 2009-03-24 18:29:28 +01:00
Wim Taymans
e7b382c6a9 playbin2: first support for subpictures
Add beginnings of subpicture support.
2009-03-24 17:12:53 +01:00
Wim Taymans
7cf4e3eb15 playbin2: rescan audio sinks for volume/mute
Rescan the audio sinks for the mute and volume properties.
fixes #576180.
2009-03-24 10:42:04 +01:00
Wim Taymans
14be3f41e2 playbin2: fix reuse of the video chains
When reusing playbin with visualisations, reset the async property on the video
sink because some sinks might dynamically recreate their sinks.
Fixes #576188
2009-03-23 19:40:18 +01:00
Wim Taymans
7628319688 playbin2: allow dynamic swtiching of subtitles
When we have the textpad configured, enable and disable the subtitles by setting
the silent flag on the overlay element instead of trying to remove elements.
See #576187
2009-03-23 17:38:46 +01:00
Wim Taymans
d8003bea06 playbin2: fix dynamic switching of visualisations
Fix the switching of visualisations by requesting and releasing the tee request
pads on demand.
See #576187.
2009-03-23 16:06:43 +01:00
Wim Taymans
7cc84f9205 playbin2: fix linking order
Link after doing the state change and unlink before shutting down. Makes the
window for causing races in toggling the visualisations smaller.
See #576187.
2009-03-23 15:27:27 +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