mirror of
https://github.com/mpv-player/mpv
synced 2024-12-17 04:15:13 +00:00
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.
This commit is contained in:
parent
fea1e09a9c
commit
1e53308d65
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user