annotate libmpcodecs/vf_format.c @ 6155:ce81fb6e3309

update to english version
author jonas
date Wed, 22 May 2002 20:47:30 +0000
parents 0263a3eabcd7
children 0a7be46617d8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
1 #include <stdio.h>
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
2 #include <stdlib.h>
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
3 #include <string.h>
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
4 #include <inttypes.h>
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
5
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
6 #include "../config.h"
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
7 #include "../mp_msg.h"
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
8
5607
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
9 #include "img_format.h"
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
10 #include "mp_image.h"
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
11 #include "vf.h"
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
12
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
13 struct vf_priv_s {
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
14 unsigned int fmt;
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
15 };
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
16
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
17 //===========================================================================//
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
18
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
19 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
20 if(fmt==vf->priv->fmt)
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
21 return vf_next_query_format(vf,fmt);
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
22 return 0;
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
23 }
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
24
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
25 static int open(vf_instance_t *vf, char* args){
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
26 vf->query_format=query_format;
6001
0263a3eabcd7 reset default caps
arpi
parents: 5607
diff changeset
27 vf->default_caps=0;
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
28 vf->priv=malloc(sizeof(struct vf_priv_s));
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
29
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
30 if(args){
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
31 if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
32 if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
33 if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
34 if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
35 if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
36 if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
37 if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
38 if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5539
diff changeset
39 if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
40 { printf("Unknown format name: '%s'\n",args);return 0;}
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
41 } else
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
42 vf->priv->fmt=IMGFMT_YUY2;
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
43
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
44 return 1;
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
45 }
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
46
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
47 vf_info_t vf_info_format = {
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
48 "force output format",
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
49 "format",
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
50 "A'rpi",
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5539
diff changeset
51 "FIXME! get_image()/put_image()",
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
52 open
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
53 };
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
54
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
55 //===========================================================================//