summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-22 15:32:23 +0100
committerwm4 <wm4@nowhere>2015-01-22 15:32:23 +0100
commitaae9af348e62d5feba6547855003df0d954cb3ae (patch)
treedd0d28655c65e1f814bec3ef537ea377a941b9b7 /video/filter
parent29cf62d20133b32e1514a315b4f7e013ed9cb768 (diff)
downloadmpv-aae9af348e62d5feba6547855003df0d954cb3ae.tar.bz2
mpv-aae9af348e62d5feba6547855003df0d954cb3ae.tar.xz
video: have a generic context struct for hwdec backends
Before this commit, each hw backend had their own specific struct types for context, and some, like VDA, had none at all. Add a context struct (mp_hwdec_ctx) that provides a somewhat generic way to pass the hwdec context around. Some things get slightly better, some slightly more verbose. mp_hwdec_info is still around; it's still needed, but is reduced to its role of handling delayed loading of the hwdec backend.
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf_vavpp.c4
-rw-r--r--video/filter/vf_vdpaupp.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/video/filter/vf_vavpp.c b/video/filter/vf_vavpp.c
index ec39772865..4e39affd41 100644
--- a/video/filter/vf_vavpp.c
+++ b/video/filter/vf_vavpp.c
@@ -391,8 +391,10 @@ static int vf_open(vf_instance_t *vf)
vf->control = control;
struct vf_priv_s *p = vf->priv;
+ if (!vf->hwdec)
+ return false;
hwdec_request_api(vf->hwdec, "vaapi");
- p->va = vf->hwdec ? vf->hwdec->vaapi_ctx : NULL;
+ p->va = vf->hwdec->hwctx ? vf->hwdec->hwctx->vaapi_ctx : NULL;
if (!p->va || !p->va->display)
return false;
p->display = p->va->display;
diff --git a/video/filter/vf_vdpaupp.c b/video/filter/vf_vdpaupp.c
index 05cabf7998..4db6ab9186 100644
--- a/video/filter/vf_vdpaupp.c
+++ b/video/filter/vf_vdpaupp.c
@@ -222,8 +222,10 @@ static int vf_open(vf_instance_t *vf)
vf->control = control;
vf->uninit = uninit;
+ if (!vf->hwdec)
+ return 0;
hwdec_request_api(vf->hwdec, "vdpau");
- p->ctx = vf->hwdec ? vf->hwdec->vdpau_ctx : NULL;
+ p->ctx = vf->hwdec->hwctx ? vf->hwdec->hwctx->vdpau_ctx : NULL;
if (!p->ctx)
return 0;