From d08e407c9eb9b3fb020efa8f1516a68497389416 Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Thu, 6 Jul 2017 10:40:40 -0700 Subject: hwdec: rename mediacodec to mediacodec-copy --- DOCS/interface-changes.rst | 2 ++ DOCS/man/options.rst | 2 +- options/options.c | 2 +- video/decode/hw_mediacodec.c | 24 ++++++++++++++++++++++++ video/decode/vd_lavc.c | 11 ++--------- video/hwdec.h | 2 +- wscript_build.py | 1 + 7 files changed, 32 insertions(+), 12 deletions(-) create mode 100644 video/decode/hw_mediacodec.c diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index f81132542b..af9a4a184c 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -20,6 +20,8 @@ Interface changes :: --- mpv 0.28.0 --- + - rename --hwdec=mediacodec option to mediacodec-copy, to reflect + conventions followed by other hardware video decoding APIs - drop previously deprecated --heartbeat-cmd and --heartbeat--interval options - rename --vo=opengl to --vo=gpu diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 8b1bc8c3d8..f5f668368e 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -681,7 +681,7 @@ Video :d3d11va: requires ``--vo=gpu`` with ``--gpu-context=angle`` (Windows 8+ only) :d3d11va-copy: copies video back to system RAM (Windows 8+ only) - :mediacodec: copies video back to system RAM (Android only) + :mediacodec-copy: copies video back to system RAM (Android only) :rpi: requires ``--vo=gpu`` (Raspberry Pi only - default if available) :rpi-copy: copies video back to system RAM (Raspberry Pi only) :cuda: requires ``--vo=gpu`` (Any platform CUDA is available) diff --git a/options/options.c b/options/options.c index b96ed5ef02..857bb85271 100644 --- a/options/options.c +++ b/options/options.c @@ -111,7 +111,7 @@ const struct m_opt_choice_alternatives mp_hwdec_names[] = { {"d3d11va-copy",HWDEC_D3D11VA_COPY}, {"rpi", HWDEC_RPI}, {"rpi-copy", HWDEC_RPI_COPY}, - {"mediacodec", HWDEC_MEDIACODEC}, + {"mediacodec-copy",HWDEC_MEDIACODEC_COPY}, {"cuda", HWDEC_CUDA}, {"cuda-copy", HWDEC_CUDA_COPY}, {"crystalhd", HWDEC_CRYSTALHD}, diff --git a/video/decode/hw_mediacodec.c b/video/decode/hw_mediacodec.c new file mode 100644 index 0000000000..9d3ef44f8b --- /dev/null +++ b/video/decode/hw_mediacodec.c @@ -0,0 +1,24 @@ +/* + * This file is part of mpv. + * + * mpv is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * mpv is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with mpv. If not, see . + */ + +#include "video/decode/lavc.h" + +const struct vd_lavc_hwdec mp_vd_lavc_mediacodec_copy = { + .type = HWDEC_MEDIACODEC_COPY, + .lavc_suffix = "_mediacodec", + .copying = true, +}; diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c index 67b9cd4e17..ec22b42571 100644 --- a/video/decode/vd_lavc.c +++ b/video/decode/vd_lavc.c @@ -129,6 +129,7 @@ const struct m_sub_options vd_lavc_conf = { }, }; +extern const struct vd_lavc_hwdec mp_vd_lavc_mediacodec_copy; extern const struct vd_lavc_hwdec mp_vd_lavc_videotoolbox; extern const struct vd_lavc_hwdec mp_vd_lavc_videotoolbox_copy; extern const struct vd_lavc_hwdec mp_vd_lavc_dxva2; @@ -149,14 +150,6 @@ static const struct vd_lavc_hwdec mp_vd_lavc_rpi_copy = { }; #endif -#if HAVE_ANDROID -static const struct vd_lavc_hwdec mp_vd_lavc_mediacodec = { - .type = HWDEC_MEDIACODEC, - .lavc_suffix = "_mediacodec", - .copying = true, -}; -#endif - #if HAVE_CUDA_HWACCEL static const struct vd_lavc_hwdec mp_vd_lavc_cuda = { .type = HWDEC_CUDA, @@ -268,7 +261,7 @@ static const struct vd_lavc_hwdec *const hwdec_list[] = { &mp_vd_lavc_d3d11va_copy, #endif #if HAVE_ANDROID - &mp_vd_lavc_mediacodec, + &mp_vd_lavc_mediacodec_copy, #endif #if HAVE_CUDA_HWACCEL &mp_vd_lavc_cuda, diff --git a/video/hwdec.h b/video/hwdec.h index 637014d049..379e754ffe 100644 --- a/video/hwdec.h +++ b/video/hwdec.h @@ -22,7 +22,7 @@ enum hwdec_type { HWDEC_D3D11VA_COPY, HWDEC_RPI, HWDEC_RPI_COPY, - HWDEC_MEDIACODEC, + HWDEC_MEDIACODEC_COPY, HWDEC_CUDA, HWDEC_CUDA_COPY, HWDEC_CRYSTALHD, diff --git a/wscript_build.py b/wscript_build.py index 25875dcfcd..1959959fe8 100644 --- a/wscript_build.py +++ b/wscript_build.py @@ -369,6 +369,7 @@ def build(ctx): ( "video/decode/dec_video.c"), ( "video/decode/hw_dxva2.c", "d3d9-hwaccel" ), ( "video/decode/hw_d3d11va.c", "d3d-hwaccel" ), + ( "video/decode/hw_mediacodec.c", "android" ), ( "video/decode/hw_videotoolbox.c", "videotoolbox-hwaccel" ), ( "video/decode/vd_lavc.c" ), ( "video/filter/refqueue.c" ), -- cgit v1.2.3