annotate libmpcodecs/vf_format.c @ 29949:fc8f901ee516

100l, fix check for V4L2 capture capability flag.
author reimar
date Fri, 11 Dec 2009 21:33:57 +0000
parents 391e683541a7
children bbb6ebec87a0
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
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 12999
diff changeset
6 #include "config.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 12999
diff changeset
7 #include "mp_msg.h"
18004
bcd805923554 Part2 of several printf2mp_msg changes in patch from Otvos Attila oattila AT chello DOT hu with LOTS of modifications by me
reynaldo
parents: 17012
diff changeset
8 #include "help_mp.h"
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
9
5607
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
10 #include "img_format.h"
1972c3475d93 mp_image.h and img_format.h moved to libmpcodecs
arpi
parents: 5565
diff changeset
11 #include "mp_image.h"
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
12 #include "vf.h"
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
13
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
14 #include "m_option.h"
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
15 #include "m_struct.h"
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
16
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
17 static struct vf_priv_s {
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
18 unsigned int fmt;
22027
0b262e00bc99 Mark m_struct_t defaults as const
reimar
parents: 18004
diff changeset
19 } const vf_priv_dflt = {
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
20 IMGFMT_YUY2
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
21 };
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
22
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 query_format(struct vf_instance_s* vf, unsigned int fmt){
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
26 if(fmt==vf->priv->fmt)
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
27 return vf_next_query_format(vf,fmt);
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
28 return 0;
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
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
31 static int open(vf_instance_t *vf, char* args){
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
32 vf->query_format=query_format;
6001
0263a3eabcd7 reset default caps
arpi
parents: 5607
diff changeset
33 vf->default_caps=0;
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
34 return 1;
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
35 }
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
36
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
37 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
38 static m_option_t vf_opts_fields[] = {
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
39 {"fmt", ST_OFF(fmt), CONF_TYPE_IMGFMT, 0,0 ,0, NULL},
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
40 { NULL, NULL, 0, 0, 0, 0, NULL }
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
41 };
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
42
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
43 static m_struct_t vf_opts = {
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
44 "format",
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
45 sizeof(struct vf_priv_s),
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
46 &vf_priv_dflt,
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
47 vf_opts_fields
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
48 };
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
49
25221
00fff9a3b735 Make all vf_info_t structs const
reimar
parents: 22027
diff changeset
50 const vf_info_t vf_info_format = {
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
51 "force output format",
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
52 "format",
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
53 "A'rpi",
5565
0b301fec999a capabilities support -> automatic insertion of scale, expand, pp
arpi
parents: 5539
diff changeset
54 "FIXME! get_image()/put_image()",
9593
e9a2af584986 Add the new -vf option wich is the same as vop in reverse order.
albeu
parents: 9171
diff changeset
55 open,
9601
0e265e2f3ac9 New options stuff
albeu
parents: 9593
diff changeset
56 &vf_opts
5539
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
57 };
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
58
eefc339440bc 2 new simple filters: yuy2 and format
arpi
parents:
diff changeset
59 //===========================================================================//