mirror of https://github.com/mpv-player/mpv
vo_rpi: disable background by default
And add an option to enable it.
This commit is contained in:
parent
147f4956d3
commit
96648169e3
|
@ -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
|
||||
|
|
|
@ -79,6 +79,7 @@ struct priv {
|
|||
|
||||
int display_nr;
|
||||
int layer;
|
||||
int background;
|
||||
};
|
||||
|
||||
// Magic alignments (in pixels) expected by the MMAL internals.
|
||||
|
@ -226,13 +227,18 @@ 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,
|
||||
|
||||
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);
|
||||
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){
|
||||
.flags = DISPMANX_FLAGS_ALPHA_FROM_SOURCE,
|
||||
|
@ -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},
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue