David Fuhrmann [Sat, 12 Jan 2013 15:29:26 +0000 (16:29 +0100)]
macosx: fix and improve window level handling
- fix behavior of video-on-top by adapting to vout windows handling changes
- set all windows to status level if one vout window has this level:
This avoids that video effects panel, audio efffects panel etc. pp. are opened behind
a vout window. Now they can be used as usual.
Please note, that due to the type of these panels they do not remain visible
when VLC gets inactive.
Don't call the legacy Freetype background renderer if the EIA-608 bg render feature is used.
If we're using the new background renderer which just renders the
background under the text (instead of the entire subpicture block),
then don't call the legacy render as well. This prevents a alpha-
transparent box from being shown when rendering EIA-608 captions
if the user has the Freetype background opacity set to a nonzero
value.
Add support for rendering EIA-608 captions with a black background
Place a black background behind caption text. We cannot use the
existing "background" feature for subdecoders because it fills the
entire subpicture block, and in the case of the EIA-608 decoder
would result in a large square (since we send all lines to
the subpicture decoder even if they are blank). This approach
allows for rendering of the background even in such cases, while
preserving proper layout of the captions.
Josh Watzman [Sun, 6 Jan 2013 20:28:57 +0000 (12:28 -0800)]
macosx: call input_changed in extensions
This is obnoxiously complicated. If anyone cares about playing_changed or
meta_changed, something similar will probably have to be done.
This is a pretty bizarre two-step system to inform the extension manager
that the input has changed, but it's necessary to avoid a series of
possible deadlocks and other issues. Here are other possible approaches
that don't work:
- Just call into the extension manager in -PlaylistItemChanged on the
main thread. This can pretty easily cause a deadlock if we call
-PlaylistItemChanged twice in quick succession. The first call will poke
the condvar the extension is waiting on, causing the extension thread to
wake up and run extension code; many parts of it -- including the dialog
code -- must be run on the main thread. The extension thread goes back to
sleep while blocking on the main thread to become available, while
holding the extension lock. Meanwhile the main thread goes into the
second call of -PlaylistItemChanged, attempts to lock the extension, and
that's a deadlock.
- Restructure the dialog manager to never block on the main thread while
holding the extension lock. This should work, but as it turns out doesn't
because the main thread will attempt to lock the same lock twice. What
happens is that -performSelectorOnMainThread works by injecting an event
into the main event loop of the main thread. For some unknown reason, as
part of its processing, when creating an NSAttributedString with HTML, it
runs the main event loop, which means we can end up executing one
-performSelectoOnMainThread as part of another. Since the dialog manager
uses attributed strings with HTML (since dialogs are HTML), we deadlock
here too. This seems strictly like a flaw in NSAttributedString and/or
in -performSelectorOnMainThread and is documented elsewhere:
http://mrrsoftware.com/blog/tag/nsattributedstring/
https://www.bluestatic.org/blog/2010/05/31/nsattributedstring-spins-a-nested-run-loop/
- Change around this bit of code to not force it to run on the main
thread. This would probably work, but, as a newcomer to VLC, I don't
quite know the implications of doing this, particularly since a lot of
code here seems to serailize on the main thread as a way of thread
safety; it would likely require some somewhat intricate restructuring
and adding of locks.
- Let the extension manager deal with listening for events the same way
that we do here. That would work, but would require duplicating a
nontrivial amount of code from here to deal with tracking the current
input.
- So, instead, we just serialized all calls to -PlaylistItemChanged (so
we make sure to process them in order, with no one trampling
p_input_changed), do most of the work on the main thread as before, and
then actually inform the extension manager out here where we don't block
the main thread. It seems likely that there are other pre-existing
deadlock possibilities here -- the main thread can't lock an extension!
-- but it at least tends to work in my testing.
Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
Josh Watzman [Sun, 6 Jan 2013 07:27:18 +0000 (23:27 -0800)]
macosx: Don't re-center extensions on every dialog update
If the user has moved the extension dialog, we don't want to re-center it on every single update -- many extensions update their dialogs on every input change, and this behavior can cause the extension dialog to keep re-overlapping with the video, which is very frustrating.
Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
David Fuhrmann [Wed, 2 Jan 2013 23:24:50 +0000 (00:24 +0100)]
macosx: video effects panel: autosave profiles and other refinements for profile management
- fix some bugs
- avoid unnecessary reload of all settings when the user clicks Cancel in dialogs
- add error message when user enters a duplicate profile name (this is not supported by
the combo box
Rui Zhang [Wed, 2 Jan 2013 17:42:51 +0000 (12:42 -0500)]
androidsurface: setup format depending on surface format
Modified-by: Edward Wang <edward.c.wang@compdigitec.com> Signed-off-by: Edward Wang <edward.c.wang@compdigitec.com> Modified-by: Rafaël Carré <funman@videolan.org> Signed-off-by: Rafaël Carré <funman@videolan.org>
The EIA-608 decoder expects fonts to be rendered with a monospace font,
so add the ability for decoders to make use of the "tt" tag, and tweak
the EIA-608 decoder to use that tag.
This patch supercedes folds in patch 9 from the previous series as well
as incorporates the changes Rafaël Carré solicited from the ML regarding
the fonts to use for non-Linux platforms.
David Fuhrmann [Tue, 1 Jan 2013 23:49:01 +0000 (00:49 +0100)]
macosx: do not send left and right arrow key to controls
The left and right arrow keys have not any real advantage / functionality for
the playlist view or sidebar but are used by default for several hotkeys.
So lets allow these as VLC hotkeys (also for audio files).