summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2016-10-09 09:18:14 -0700
committerwm4 <wm4@nowhere>2016-10-15 17:44:23 +0200
commit0a81fe1cf9e62c26ebda1c209b3b69467991b252 (patch)
tree01eb15fdfe5500b0c384f62fffb5966b2e8c1e2d
parent8956229ee46c187a5a1eb63c834219d0e9b84b83 (diff)
downloadmpv-0a81fe1cf9e62c26ebda1c209b3b69467991b252.tar.bz2
mpv-0a81fe1cf9e62c26ebda1c209b3b69467991b252.tar.xz
vd_lavc: Add hwdec wrapper for crystalhd
This hardware decodes to system memory so it only requires a wrapper.
-rw-r--r--DOCS/man/options.rst6
-rw-r--r--options/options.c1
-rw-r--r--video/decode/vd_lavc.c7
-rw-r--r--video/hwdec.h1
4 files changed, 15 insertions, 0 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index d17aefe347..374cdaf1a5 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -625,6 +625,7 @@ Video
: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)
+ :crystalhd: copies video back to system RAM (Any platform supported by hardware)
``auto`` tries to automatically enable hardware decoding using the first
available method. This still depends what VO you are using. For example,
@@ -711,6 +712,11 @@ Video
``rpi`` always uses the hardware overlay renderer, even with
``--vo=opengl``.
+ ``crystalhd`` is not safe. It always converts to 4:2:2 YUV, which
+ may be lossy, depending on how chroma sub-sampling is done during
+ conversion. It also discards the top left pixel of each frame for
+ some reason.
+
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 38f5d16721..3b071e3b47 100644
--- a/options/options.c
+++ b/options/options.c
@@ -106,6 +106,7 @@ const struct m_opt_choice_alternatives mp_hwdec_names[] = {
{"mediacodec", HWDEC_MEDIACODEC},
{"cuda", HWDEC_CUDA},
{"cuda-copy", HWDEC_CUDA_COPY},
+ {"crystalhd", HWDEC_CRYSTALHD},
{0}
};
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index ed1ba6b6dc..86cf815320 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -164,6 +164,12 @@ static const struct vd_lavc_hwdec mp_vd_lavc_cuda_copy = {
};
#endif
+static const struct vd_lavc_hwdec mp_vd_lavc_crystalhd = {
+ .type = HWDEC_CRYSTALHD,
+ .lavc_suffix = "_crystalhd",
+ .copying = true,
+};
+
static const struct vd_lavc_hwdec *const hwdec_list[] = {
#if HAVE_RPI
&mp_vd_lavc_rpi,
@@ -193,6 +199,7 @@ static const struct vd_lavc_hwdec *const hwdec_list[] = {
&mp_vd_lavc_cuda,
&mp_vd_lavc_cuda_copy,
#endif
+ &mp_vd_lavc_crystalhd,
NULL
};
diff --git a/video/hwdec.h b/video/hwdec.h
index fd99043c10..34b65fe15c 100644
--- a/video/hwdec.h
+++ b/video/hwdec.h
@@ -24,6 +24,7 @@ enum hwdec_type {
HWDEC_MEDIACODEC,
HWDEC_CUDA,
HWDEC_CUDA_COPY,
+ HWDEC_CRYSTALHD,
};
#define HWDEC_IS_AUTO(x) ((x) == HWDEC_AUTO || (x) == HWDEC_AUTO_COPY)