diff options
author | wm4 <wm4@nowhere> | 2015-02-02 22:43:05 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-02 22:43:13 +0100 |
commit | 2a9534871d51965b4b6b6fb688397096df963c89 (patch) | |
tree | a5a95ffd0c1903d57b2966d1ce046b2dfd640f64 /video | |
parent | c07e046bfa5a736ddf6c185b48cd1c6929840186 (diff) | |
download | mpv-2a9534871d51965b4b6b6fb688397096df963c89.tar.bz2 mpv-2a9534871d51965b4b6b6fb688397096df963c89.tar.xz |
command: add property returning detected hwdec API
This is somewhat imperfect, because detection of hw decoding APIs is
mostly done on demand, and often avoided if not necessary. (For example,
we know very well that there are no hw decoders for certain codecs.)
This also requires every hwdec backend to identify itself (see hwdec.h
changes).
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/lavc.h | 12 | ||||
-rw-r--r-- | video/hwdec.h | 13 | ||||
-rw-r--r-- | video/out/gl_hwdec_vda.c | 1 | ||||
-rw-r--r-- | video/out/vo_opengl_cb.c | 2 | ||||
-rw-r--r-- | video/vaapi.c | 1 | ||||
-rw-r--r-- | video/vdpau.c | 1 |
6 files changed, 16 insertions, 14 deletions
diff --git a/video/decode/lavc.h b/video/decode/lavc.h index c14fc47abe..85cf49abab 100644 --- a/video/decode/lavc.h +++ b/video/decode/lavc.h @@ -9,18 +9,6 @@ #include "video/mp_image.h" #include "video/hwdec.h" -// keep in sync with --hwdec option -enum hwdec_type { - HWDEC_AUTO = -1, - HWDEC_NONE = 0, - HWDEC_VDPAU = 1, - HWDEC_VDA = 2, - HWDEC_CRYSTALHD = 3, - HWDEC_VAAPI = 4, - HWDEC_VAAPI_COPY = 5, - HWDEC_DXVA2_COPY = 6, -}; - typedef struct lavc_ctx { struct mp_log *log; struct MPOpts *opts; diff --git a/video/hwdec.h b/video/hwdec.h index a7d2cf8c4b..0574e5c562 100644 --- a/video/hwdec.h +++ b/video/hwdec.h @@ -3,7 +3,20 @@ struct mp_image_pool; +// keep in sync with --hwdec option +enum hwdec_type { + HWDEC_AUTO = -1, + HWDEC_NONE = 0, + HWDEC_VDPAU = 1, + HWDEC_VDA = 2, + HWDEC_VAAPI = 4, + HWDEC_VAAPI_COPY = 5, + HWDEC_DXVA2_COPY = 6, +}; + struct mp_hwdec_ctx { + enum hwdec_type type; + void *priv; // for free use by hwdec implementation // API-specific, not needed by all backends. diff --git a/video/out/gl_hwdec_vda.c b/video/out/gl_hwdec_vda.c index bc18983d3d..181674f641 100644 --- a/video/out/gl_hwdec_vda.c +++ b/video/out/gl_hwdec_vda.c @@ -89,6 +89,7 @@ static int create(struct gl_hwdec *hw) return -1; hw->hwctx = &p->hwctx; + hw->hwctx->type = HWDEC_VDA; hw->hwctx->download_image = download_image; GL *gl = hw->gl; diff --git a/video/out/vo_opengl_cb.c b/video/out/vo_opengl_cb.c index cee0bc1d46..7334d31add 100644 --- a/video/out/vo_opengl_cb.c +++ b/video/out/vo_opengl_cb.c @@ -27,8 +27,6 @@ #include "gl_video.h" #include "gl_hwdec.h" -#include "video/decode/lavc.h" // HWDEC_* values - #include "libmpv/opengl_cb.h" /* diff --git a/video/vaapi.c b/video/vaapi.c index 54d75e775a..8b95dde85d 100644 --- a/video/vaapi.c +++ b/video/vaapi.c @@ -130,6 +130,7 @@ struct mp_vaapi_ctx *va_initialize(VADisplay *display, struct mp_log *plog) .log = talloc_steal(res, log), .display = display, .hwctx = { + .type = HWDEC_VAAPI, .priv = res, .vaapi_ctx = res, .download_image = ctx_download_image, diff --git a/video/vdpau.c b/video/vdpau.c index e1daf327af..b55152b146 100644 --- a/video/vdpau.c +++ b/video/vdpau.c @@ -371,6 +371,7 @@ struct mp_vdpau_ctx *mp_vdpau_create_device_x11(struct mp_log *log, Display *x11 .x11 = x11, .preemption_counter = 1, .hwctx = { + .type = HWDEC_VDPAU, .priv = ctx, .vdpau_ctx = ctx, .download_image = download_image, |