1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-27 17:42:17 +00:00

vf_swapuv: support more image formats

This commit is contained in:
wm4 2012-12-26 21:30:33 +01:00
parent d88baf0754
commit 8d6a66892e

View File

@ -39,18 +39,14 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
return mpi;
}
static int query_format(struct vf_instance *vf, unsigned int fmt){
switch(fmt)
{
case IMGFMT_444P:
case IMGFMT_422P:
case IMGFMT_440P:
case IMGFMT_420P:
case IMGFMT_411P:
case IMGFMT_410P:
return vf_next_query_format(vf, fmt);
}
return 0;
static int query_format(struct vf_instance *vf, unsigned int fmt)
{
struct mp_imgfmt_desc desc = mp_imgfmt_get_desc(fmt);
if (!(desc.flags & MP_IMGFLAG_BYTE_ALIGNED))
return 0;
if (!(desc.num_planes >= 3 && desc.bytes[1] == desc.bytes[2]))
return 0;
return vf_next_query_format(vf, fmt);
}
static int vf_open(vf_instance_t *vf, char *args){