summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-08-20 19:07:18 +0200
committerwm4 <wm4@nowhere>2015-08-20 19:07:18 +0200
commit96648169e342b9843246075a36fae2ad0bd06f88 (patch)
tree879dba11195778cdfddb2a5aad213336579c1ea8
parent147f4956d3ecc38dab4932bbdc8ed532664f0dfd (diff)
downloadmpv-96648169e342b9843246075a36fae2ad0bd06f88.tar.bz2
mpv-96648169e342b9843246075a36fae2ad0bd06f88.tar.xz
vo_rpi: disable background by default
And add an option to enable it.
-rw-r--r--DOCS/man/vo.rst5
-rw-r--r--video/out/vo_rpi.c19
2 files changed, 18 insertions, 6 deletions
diff --git a/DOCS/man/vo.rst b/DOCS/man/vo.rst
index d6d1db60e8..da9bebe115 100644
--- a/DOCS/man/vo.rst
+++ b/DOCS/man/vo.rst
@@ -1000,6 +1000,11 @@ Available video output drivers are:
selected layer, to handle the window background and OSD. Actual video
rendering will happen on the layer above the selected layer.
+ ``background=<yes|no>``
+ Whether to render a black background behind the video (default: no).
+ Normally it's better to kill the console framebuffer instead, which
+ gives better performance.
+
``drm`` (Direct Rendering Manager)
Video output driver using Kernel Mode Setting / Direct Rendering Manager.
Does not support hardware acceleration. Should be used when one doesn't
diff --git a/video/out/vo_rpi.c b/video/out/vo_rpi.c
index 331e2a6917..d637eeca46 100644
--- a/video/out/vo_rpi.c
+++ b/video/out/vo_rpi.c
@@ -79,6 +79,7 @@ struct priv {
int display_nr;
int layer;
+ int background;
};
// Magic alignments (in pixels) expected by the MMAL internals.
@@ -226,12 +227,17 @@ static int update_display_size(struct vo *vo)
.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS,
.opacity = 0xFF,
};
- p->window = vc_dispmanx_element_add(p->update, p->display, p->background_layer,
- &dst, 0, &src,
- DISPMANX_PROTECTION_NONE, &alpha, 0, 0);
- if (!p->window) {
- MP_FATAL(vo, "Could not add DISPMANX element.\n");
- return -1;
+
+ if (p->background) {
+ p->window = vc_dispmanx_element_add(p->update, p->display,
+ p->background_layer,
+ &dst, 0, &src,
+ DISPMANX_PROTECTION_NONE,
+ &alpha, 0, 0);
+ if (!p->window) {
+ MP_FATAL(vo, "Could not add DISPMANX element.\n");
+ return -1;
+ }
}
alpha = (VC_DISPMANX_ALPHA_T){
@@ -653,6 +659,7 @@ fail:
static const struct m_option options[] = {
OPT_INT("display", display_nr, 0),
OPT_INT("layer", layer, 0, OPTDEF_INT(-10)),
+ OPT_FLAG("background", background, 0),
{0},
};