diff options
author | Philip Langdale <philipl@overt.org> | 2015-09-15 21:50:47 -0700 |
---|---|---|
committer | Philip Langdale <philipl@overt.org> | 2015-09-15 21:53:53 -0700 |
commit | 1e53308d65464599c0de60fa497cb3c05435a68f (patch) | |
tree | 1b831ba49c4711d638dcb04d63e9d3806c939a7d /video | |
parent | fea1e09a9c48f51a4d489027ed996c0314a13232 (diff) | |
download | mpv-1e53308d65464599c0de60fa497cb3c05435a68f.tar.bz2 mpv-1e53308d65464599c0de60fa497cb3c05435a68f.tar.xz |
vf_vdpaurb: Pass through non-hardware-decoded content
Today, vdpaurb will fail if it's used with non-hardware-decoded
content. This created work for the user as they have to explicitly
add or not add it, depending on the content.
As an improvement, we can make vdpaurb pass through any frames
that aren't hardware decoded, so that it can always be present in the
filter chain, if desired.
Diffstat (limited to 'video')
-rw-r--r-- | video/filter/vf_vdpaurb.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/video/filter/vf_vdpaurb.c b/video/filter/vf_vdpaurb.c index 8eaeb86e21..8f88838dda 100644 --- a/video/filter/vf_vdpaurb.c +++ b/video/filter/vf_vdpaurb.c @@ -44,6 +44,12 @@ static int filter_ext(struct vf_instance *vf, struct mp_image *mpi) return 0; } + // Pass-through anything that's not been decoded by VDPAU + if (mpi->imgfmt != IMGFMT_VDPAU) { + vf_add_output_frame(vf, mpi); + return 0; + } + if (mp_vdpau_mixed_frame_get(mpi)) { MP_ERR(vf, "Can't apply vdpaurb filter after vdpaupp filter.\n"); mp_image_unrefp(&mpi); @@ -75,14 +81,8 @@ static int reconfig(struct vf_instance *vf, struct mp_image_params *in, struct mp_image_params *out) { *out = *in; - out->imgfmt = IMGFMT_NV12; - return 0; -} - -static int query_format(struct vf_instance *vf, unsigned int fmt) -{ - if (fmt == IMGFMT_VDPAU) { - return vf_next_query_format(vf, IMGFMT_NV12); + if (in->imgfmt == IMGFMT_VDPAU) { + out->imgfmt = IMGFMT_NV12; } return 0; } @@ -94,7 +94,6 @@ static int vf_open(vf_instance_t *vf) vf->filter_ext = filter_ext; vf->filter = NULL; vf->reconfig = reconfig; - vf->query_format = query_format; if (!vf->hwdec) { return 0; |