annotate libmpcodecs/vf_noformat.c @ 12221:dd687237dd0c

10l for me - stray option draft left behind.
author diego
date Sat, 17 Apr 2004 16:06:43 +0000
parents 7d603ceb4ac1
children bc8cda64ad7f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11928
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
1 #include <stdio.h>
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
2 #include <stdlib.h>
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
3 #include <string.h>
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
4 #include <inttypes.h>
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
5
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
6 #include "../config.h"
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
7 #include "../mp_msg.h"
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
8
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
9 #include "img_format.h"
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
10 #include "mp_image.h"
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
11 #include "vf.h"
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
12
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
13 #include "m_option.h"
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
14 #include "m_struct.h"
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
15
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
16 static struct vf_priv_s {
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
17 unsigned int fmt;
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
18 } vf_priv_dflt = {
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
19 IMGFMT_YV12
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
20 };
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
21
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
22 //===========================================================================//
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
23
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
24 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
25 if(fmt!=vf->priv->fmt)
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
26 return vf_next_query_format(vf,fmt);
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
27 return 0;
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
28 }
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
29
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
30 static int open(vf_instance_t *vf, char* args){
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
31 vf->query_format=query_format;
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
32 vf->default_caps=0;
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
33 if(!vf->priv) {
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
34 vf->priv=malloc(sizeof(struct vf_priv_s));
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
35 vf->priv->fmt=IMGFMT_YV12;
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
36 }
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
37 if(args){
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
38 if(!strcasecmp(args,"444p")) vf->priv->fmt=IMGFMT_444P; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
39 if(!strcasecmp(args,"422p")) vf->priv->fmt=IMGFMT_422P; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
40 if(!strcasecmp(args,"411p")) vf->priv->fmt=IMGFMT_411P; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
41 if(!strcasecmp(args,"yuy2")) vf->priv->fmt=IMGFMT_YUY2; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
42 if(!strcasecmp(args,"yv12")) vf->priv->fmt=IMGFMT_YV12; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
43 if(!strcasecmp(args,"i420")) vf->priv->fmt=IMGFMT_I420; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
44 if(!strcasecmp(args,"yvu9")) vf->priv->fmt=IMGFMT_YVU9; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
45 if(!strcasecmp(args,"if09")) vf->priv->fmt=IMGFMT_IF09; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
46 if(!strcasecmp(args,"iyuv")) vf->priv->fmt=IMGFMT_IYUV; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
47 if(!strcasecmp(args,"uyvy")) vf->priv->fmt=IMGFMT_UYVY; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
48 if(!strcasecmp(args,"bgr24")) vf->priv->fmt=IMGFMT_BGR24; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
49 if(!strcasecmp(args,"bgr32")) vf->priv->fmt=IMGFMT_BGR32; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
50 if(!strcasecmp(args,"bgr16")) vf->priv->fmt=IMGFMT_BGR16; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
51 if(!strcasecmp(args,"bgr15")) vf->priv->fmt=IMGFMT_BGR15; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
52 if(!strcasecmp(args,"bgr8")) vf->priv->fmt=IMGFMT_BGR8; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
53 if(!strcasecmp(args,"bgr4")) vf->priv->fmt=IMGFMT_BGR4; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
54 if(!strcasecmp(args,"bg4b")) vf->priv->fmt=IMGFMT_BG4B; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
55 if(!strcasecmp(args,"bgr1")) vf->priv->fmt=IMGFMT_BGR1; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
56 if(!strcasecmp(args,"rgb24")) vf->priv->fmt=IMGFMT_RGB24; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
57 if(!strcasecmp(args,"rgb32")) vf->priv->fmt=IMGFMT_RGB32; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
58 if(!strcasecmp(args,"rgb16")) vf->priv->fmt=IMGFMT_RGB16; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
59 if(!strcasecmp(args,"rgb15")) vf->priv->fmt=IMGFMT_RGB15; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
60 if(!strcasecmp(args,"rgb8")) vf->priv->fmt=IMGFMT_RGB8; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
61 if(!strcasecmp(args,"rgb4")) vf->priv->fmt=IMGFMT_RGB4; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
62 if(!strcasecmp(args,"rg4b")) vf->priv->fmt=IMGFMT_RG4B; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
63 if(!strcasecmp(args,"rgb1")) vf->priv->fmt=IMGFMT_RGB1; else
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
64 { printf("Unknown format name: '%s'\n",args);return 0;}
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
65 }
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
66
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
67
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
68 return 1;
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
69 }
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
70
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
71 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
72 static m_option_t vf_opts_fields[] = {
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
73 {"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
74 { NULL, NULL, 0, 0, 0, 0, NULL }
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
75 };
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
76
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
77 static m_struct_t vf_opts = {
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
78 "noformat",
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
79 sizeof(struct vf_priv_s),
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
80 &vf_priv_dflt,
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
81 vf_opts_fields
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
82 };
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
83
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
84 vf_info_t vf_info_noformat = {
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
85 "disallow one output format",
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
86 "noformat",
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
87 "Joey",
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
88 "",
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
89 open,
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
90 &vf_opts
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
91 };
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
92
7d603ceb4ac1 new filter: vf_noformat.
joey
parents:
diff changeset
93 //===========================================================================//