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=`` + 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}, };