summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2017-07-06 10:40:40 -0700
committerwm4 <wm4@nowhere>2017-10-09 18:36:54 +0200
commitd08e407c9eb9b3fb020efa8f1516a68497389416 (patch)
tree631c158bf09a050770dd6e0c4bb5b5a7b78bafde
parentcabb1ca54931d882c6063606c84925071b5ee59d (diff)
downloadmpv-d08e407c9eb9b3fb020efa8f1516a68497389416.tar.bz2
mpv-d08e407c9eb9b3fb020efa8f1516a68497389416.tar.xz
hwdec: rename mediacodec to mediacodec-copy
-rw-r--r--DOCS/interface-changes.rst2
-rw-r--r--DOCS/man/options.rst2
-rw-r--r--options/options.c2
-rw-r--r--video/decode/hw_mediacodec.c24
-rw-r--r--video/decode/vd_lavc.c11
-rw-r--r--video/hwdec.h2
-rw-r--r--wscript_build.py1
7 files changed, 32 insertions, 12 deletions
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 <http://www.gnu.org/licenses/>.
+ */
+
+#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" ),