From 7e6456f43ad87df538efa979007c4125a8a33cf0 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 30 Sep 2016 11:35:25 +0200 Subject: rpi: add --hwdec=rpi-copy This means it can be used with normal video filters. Might help out with #3604. --- DOCS/man/options.rst | 4 ++++ options/options.c | 1 + video/decode/vd_lavc.c | 6 ++++++ video/hwdec.h | 1 + 4 files changed, 12 insertions(+) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index eecf48a636..9103d3d641 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -622,6 +622,7 @@ Video :d3d11va-copy: copies video back to system RAM (Windows only) :mediacodec: copies video back to system RAM (Android only) :rpi: requires ``--vo=opengl`` (Raspberry Pi only - default if available) + :rpi-copy: copies video back to system RAM (Raspberry Pi only) :cuda: requires ``--vo=opengl`` (Any platform CUDA is available) :cuda-copy: copies video back to system RAM (Any platform CUDA is available) @@ -707,6 +708,9 @@ Video to deinterlace inside the decoder. However, traditional deinterlacing filters can be used in this case. + ``rpi`` always uses the hardware overlay renderer, even with + ``--vo=opengl``. + All other methods, in particular the copy-back methods (like ``dxva2-copy`` etc.) are either fully safe, or not worse than software decoding. diff --git a/options/options.c b/options/options.c index b7cc7443d2..f8f5f707a5 100644 --- a/options/options.c +++ b/options/options.c @@ -98,6 +98,7 @@ const struct m_opt_choice_alternatives mp_hwdec_names[] = { {"d3d11va", HWDEC_D3D11VA}, {"d3d11va-copy",HWDEC_D3D11VA_COPY}, {"rpi", HWDEC_RPI}, + {"rpi-copy", HWDEC_RPI_COPY}, {"mediacodec", HWDEC_MEDIACODEC}, {"cuda", HWDEC_CUDA}, {"cuda-copy", HWDEC_CUDA_COPY}, diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 6328f5fe49..147b1d664d 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -141,6 +141,11 @@ static const struct vd_lavc_hwdec mp_vd_lavc_rpi = { .lavc_suffix = "_mmal", .image_format = IMGFMT_MMAL, }; +static const struct vd_lavc_hwdec mp_vd_lavc_rpi_copy = { + .type = HWDEC_RPI_COPY, + .lavc_suffix = "_mmal", + .copying = true, +}; #endif #if HAVE_ANDROID @@ -162,6 +167,7 @@ static const struct vd_lavc_hwdec mp_vd_lavc_cuda_copy = { static const struct vd_lavc_hwdec *const hwdec_list[] = { #if HAVE_RPI &mp_vd_lavc_rpi, + &mp_vd_lavc_rpi_copy, #endif #if HAVE_VDPAU_HWACCEL &mp_vd_lavc_vdpau, diff --git a/video/hwdec.h b/video/hwdec.h index b69e3fc309..fd99043c10 100644 --- a/video/hwdec.h +++ b/video/hwdec.h @@ -20,6 +20,7 @@ enum hwdec_type { HWDEC_D3D11VA, HWDEC_D3D11VA_COPY, HWDEC_RPI, + HWDEC_RPI_COPY, HWDEC_MEDIACODEC, HWDEC_CUDA, HWDEC_CUDA_COPY, -- cgit v1.2.3