diff options
author | Martin Herkt <lachs0r@srsfckn.biz> | 2016-06-25 02:25:44 +0200 |
---|---|---|
committer | Martin Herkt <lachs0r@srsfckn.biz> | 2016-06-25 02:25:44 +0200 |
commit | ad56f2c46ac6deec86870ec10f2a11a644df07d4 (patch) | |
tree | 89f2d90c5586560911e67c872b530c77f151168d /video/filter/vf_vdpaurb.c | |
parent | 0536841647ef7931bffb4386d8ffbb5b2b568e8a (diff) | |
parent | 393bb2a565dc1e27812e1dd20747814892f80da2 (diff) | |
download | mpv-ad56f2c46ac6deec86870ec10f2a11a644df07d4.tar.bz2 mpv-ad56f2c46ac6deec86870ec10f2a11a644df07d4.tar.xz |
Merge branch 'master' into release/current
Diffstat (limited to 'video/filter/vf_vdpaurb.c')
-rw-r--r-- | video/filter/vf_vdpaurb.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/video/filter/vf_vdpaurb.c b/video/filter/vf_vdpaurb.c index 62f7f34af1..2e6da79766 100644 --- a/video/filter/vf_vdpaurb.c +++ b/video/filter/vf_vdpaurb.c @@ -35,10 +35,7 @@ struct vf_priv_s { static int filter_ext(struct vf_instance *vf, struct mp_image *mpi) { - VdpStatus vdp_st; struct vf_priv_s *p = vf->priv; - struct mp_vdpau_ctx *ctx = p->ctx; - struct vdp_functions *vdp = &ctx->vdp; if (!mpi) { return 0; @@ -56,21 +53,14 @@ static int filter_ext(struct vf_instance *vf, struct mp_image *mpi) return -1; } - struct mp_image *out = vf_alloc_out_image(vf); - if (!out) { + struct mp_hwdec_ctx *hwctx = &p->ctx->hwctx; + + struct mp_image *out = hwctx->download_image(hwctx, mpi, vf->out_pool); + if (!out || out->imgfmt != IMGFMT_NV12) { mp_image_unrefp(&mpi); + mp_image_unrefp(&out); return -1; } - mp_image_copy_attributes(out, mpi); - - VdpVideoSurface surface = (uintptr_t)mpi->planes[3]; - assert(surface > 0); - - vdp_st = vdp->video_surface_get_bits_y_cb_cr(surface, - VDP_YCBCR_FORMAT_NV12, - (void * const *)out->planes, - out->stride); - CHECK_VDP_WARNING(vf, "Error when calling vdp_output_surface_get_bits_y_cb_cr"); vf_add_output_frame(vf, out); mp_image_unrefp(&mpi); @@ -83,6 +73,7 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in, *out = *in; if (in->imgfmt == IMGFMT_VDPAU) { out->imgfmt = IMGFMT_NV12; + out->hw_subfmt = 0; } return 0; } @@ -101,14 +92,9 @@ static int vf_open(vf_instance_t *vf) vf->reconfig = reconfig; vf->query_format = query_format; - if (!vf->hwdec) { + p->ctx = hwdec_devices_load(vf->hwdec_devs, HWDEC_VDPAU); + if (!p->ctx) return 0; - } - hwdec_request_api(vf->hwdec, "vdpau"); - p->ctx = vf->hwdec->hwctx ? vf->hwdec->hwctx->vdpau_ctx : NULL; - if (!p->ctx) { - return 0; - } return 1; } |