diff options
author | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-09 14:01:53 +0000 |
---|---|---|
committer | arpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-09 14:01:53 +0000 |
commit | 8ba3f802161096f763e96b329475201c57e85bae (patch) | |
tree | b5352d95d543f101a2607396b7835001b45848c5 /libmpcodecs/vf_format.c | |
parent | cae41b33a9ac3b845d50c9c092e85d81a144ea4b (diff) | |
download | mpv-8ba3f802161096f763e96b329475201c57e85bae.tar.bz2 mpv-8ba3f802161096f763e96b329475201c57e85bae.tar.xz |
2 new simple filters: yuy2 and format
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5540 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_format.c')
-rw-r--r-- | libmpcodecs/vf_format.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/libmpcodecs/vf_format.c b/libmpcodecs/vf_format.c new file mode 100644 index 0000000000..3aed8db3b3 --- /dev/null +++ b/libmpcodecs/vf_format.c @@ -0,0 +1,53 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <inttypes.h> + +#include "../config.h" +#include "../mp_msg.h" + +#include "../libvo/img_format.h" +#include "../mp_image.h" +#include "vf.h" + +struct vf_priv_s { + unsigned int fmt; +}; + +//===========================================================================// + +static int query_format(struct vf_instance_s* vf, unsigned int fmt){ + if(fmt==vf->priv->fmt) + return vf_next_query_format(vf,fmt); + return 0; +} + +static int open(vf_instance_t *vf, char* args){ + vf->query_format=query_format; + vf->priv=malloc(sizeof(struct vf_priv_s)); + + if(args){ + if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else + if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else + if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else + if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else + if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else + if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else + if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else + if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else + { printf("Unknown format name: '%s'\n",args);return 0;} + } else + vf->priv->fmt=IMGFMT_YUY2; + + return 1; +} + +vf_info_t vf_info_format = { + "force output format", + "format", + "A'rpi", + "", + open +}; + +//===========================================================================// |