The port agnostic allocator helpers in mmal leak memory (see
https://github.com/raspberrypi/firmware/issues/310). As there is no benefit
using them instead of the default allocator in our case anyway, switch to the
default allocator, which avoids memory leakage on pool destruction.
mmal/deinterlace: Use default allocator for mmal pool
The port agnostic allocator helpers in mmal leak memory (see
https://github.com/raspberrypi/firmware/issues/310). As there is no benefit
using them instead of the default allocator in our case anyway, switch to the
default allocator, which avoids memory leakage on pool destruction.
Refactor teardown code a little, merging the picture_pool destruction into the
core Close method as well as adding a missing free and tweak teardown order to
be a bit more sane.
mmal/mmal_picture: Don't wait inifinitely for picture
Use mmal_queue_timedwait instead of mmal_queue_wait to avoid deadlocks if due
to some unexpected reason no mmal buffer is available for a picture to be
locked. This makes the mmal plugins more robust against mmal internal
failures.
mmal/codec: Check picture buffer size before usage
We need to make sure that a buffer is big enough to store the amount of data
we expect to receive from the decoder. Without doing this memory could be
corrupted due to the decoder writing outside the allocate memory.
The pictures plane specifications were always filled with the size information
obtained from the vlc picture format combined with the assumption of having 3
planes. As this is not correct for the opaque case were only one plane with a
fixed size, which matches the mmal video_render input size, is used, change
the code to take care of this.
This change is required to provide other plugins reliable information about
the allocated data buffer size.
Switch the layout activity to true before actually displaying the layout. This
gives controls a chance to reinitialize before any real drawing occurs, and
thus a clean animation gets displayed without any unwanted stray image.
skins2: fix buttons and checkbox artefacts with animated images
If down or over images are missing, they default to the up image. Yet, in case
of animated images, the animation gets played leading to undesirable artefacts.
This patch adds a comparison operator for animated images and do not restart the
animation if they are alike.
Add a video_filter module which uses the Broadcom Multi Media Abstraction
Layer (mmal) to deinterlace video in hardware on supported platforms like the
Raspberry Pi.
As of now it is only working in opaque mode, due to a broadcom firmware
limitation. Thus it can only be used along with mmal/codec and mmal/vout.
Uwe L. Korn [Mon, 18 Aug 2014 21:05:06 +0000 (21:05 +0000)]
qt4: Replace redundant virtual with Q_DECL_OVERRIDE
Declaring a virtual function in a subclass as virtual may be a good
documentation that we are overriding a method from the superclass but
has no effect during compilation. With C++11, we can use the override
keyword for this (which will even trigger a compiler error if we try to
override a non-virtual function).
To stay backwards-compatible, we use Qt5's Q_DECL_OVERRIDE macro to
support C++ <11.
Outsource some of the picture handling code from the mmal video_output into a
dedicated file. This is required as it will be used by the mmal filter plugin
later on as well.
Felix Abecassis [Tue, 2 Sep 2014 09:00:23 +0000 (11:00 +0200)]
input: waiting and flushing states should be mutually exclusive
A crash could occur in the following situation:
1) A video decoder is created and starts waiting for the first picture:
b_waiting = true, b_first = true
2) The first picture is received but the decoder is still in waiting mode:
b_waiting = true, b_first = false
3) A second picture is received, the decoder is now waiting in
DecoderWaitUnblock().
4) From the input thread, an EOF event is received, EsOutChangePosition is
called and sets the decoder in flushing mode.
5) The decoder thread wakes up and exits DecoderWaitUnblock because
b_flushing is true. However this triggers the assertion in
DecoderDecodeVideo since we have b_waiting && !b_first.
Julian Scheel [Fri, 29 Aug 2014 07:09:37 +0000 (09:09 +0200)]
mmal/vout: Remove bad locking
This removes some bad locking. In fact this lock could cause a deadlock on
shutdown as the lock is held by the main thread when shutting down and this
function might be called as a result of shutting the ports down.
Julian Scheel [Fri, 29 Aug 2014 07:09:36 +0000 (09:09 +0200)]
mmal/vout: Rework buffer handling
This patch reflects the buffer handling improvements done in the mmal codec
module into the the mmal video output module.
A nice side effect of the restructuring is that less magic values need to be
defined as the required values can be computed dynamically now.
Julian Scheel [Fri, 29 Aug 2014 07:09:35 +0000 (09:09 +0200)]
mmal/codec: Rework buffer handling
This patch reduces the number of required pictures in the picture pool as well
as the number of required buffer headers on the mmal component. If
MMAL_ENCODING_OPAQUE is used as data format the number of buffers which have
to be provided to the components ports are very critical and there is a
relation between the configured number of buffers at the port and the actual
number of buffers which are available at a port at any time.
The previous approach was rather conservative and allocated a lot of extra
buffers to ensure that things are smooth all the time. This has the drawback
of wasting memory though. Especially when adding another mmal element
(deinterlace filter) it caused a situation where we run out of resources. This
new approach reduces the required resources so that another mmal component can
be added to the chain.
Julian Scheel [Fri, 29 Aug 2014 07:09:34 +0000 (09:09 +0200)]
mmal: Move codec plugin into hw/mmal module
The mmal codec plugin is built as a part of the mmal module now. This drops
the ability to en-/disable codec support independently from the vout, but in
fact currently there is no mmal implementation which wouldn't support both
modules, so it seems sane to build them together as this unclutters the
configure scripts a little.
Julian Scheel [Fri, 29 Aug 2014 07:09:33 +0000 (09:09 +0200)]
mmal: Move video_output plugin into hw/mmal module
As the mmal modules will require some shared code in the future move them out
of the split directory structure into a hw/mmal subdirectory, like it
is handled with vdpau plugins already.
David Fuhrmann [Sun, 31 Aug 2014 18:51:36 +0000 (20:51 +0200)]
macosx: Use floating window level for effects and other panels
All black-syle panels should get the floating window level.
This is normal behaviour of panels and has the positive side effect
that the panel also stays in front while vout window reconfigurations.
This level is also used for the preferences window, as this is sort
of a modal window which needs to be closed (in order to get settings
saved).
David Fuhrmann [Sun, 31 Aug 2014 13:16:57 +0000 (15:16 +0200)]
macosx: video effects: only set video splitters when needed
Avoids setting this variable multiple times, as each time vout
restart is requested. Also avoids unnecessary vout restarts at
start and when changing profiles.
David Fuhrmann [Sat, 30 Aug 2014 14:32:23 +0000 (16:32 +0200)]
mac codesign: improve signing script
- add signing of sparkles autoupdate tool
- directly fail on error
- fix bug preventing signing of VLC binary
- rework validation steps so that it validates frameworks and autoupdate
tool separately, but then the complete bundle like gatekeeper (using
--deep option)
Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>