~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/staging/easycap/easycap_settings.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno
  • Date: 2011-06-07 12:14:05 UTC
  • mfrom: (43.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110607121405-i3h1rd7nrnd2b73h
Tags: 2.6.39-2
[ Ben Hutchings ]
* [x86] Enable BACKLIGHT_APPLE, replacing BACKLIGHT_MBP_NVIDIA
  (Closes: #627492)
* cgroups: Disable memory resource controller by default. Allow it
  to be enabled using kernel parameter 'cgroup_enable=memory'.
* rt2800usb: Enable support for more USB devices including
  Linksys WUSB600N (Closes: #596626) (this change was accidentally
  omitted from 2.6.39-1)
* [x86] Remove Celeron from list of processors supporting PAE. Most
  'Celeron M' models do not.
* Update debconf template translations:
  - Swedish (Martin Bagge) (Closes: #628932)
  - French (David Prévot) (Closes: #628191)
* aufs: Update for 2.6.39 (Closes: #627837)
* Add stable 2.6.39.1, including:
  - ext4: dont set PageUptodate in ext4_end_bio()
  - pata_cmd64x: fix boot crash on parisc (Closes: #622997, #622745)
  - ext3: Fix fs corruption when make_indexed_dir() fails
  - netfilter: nf_ct_sip: validate Content-Length in TCP SIP messages
  - sctp: fix race between sctp_bind_addr_free() and
    sctp_bind_addr_conflict()
  - sctp: fix memory leak of the ASCONF queue when free asoc
  - md/bitmap: fix saving of events_cleared and other state
  - cdc_acm: Fix oops when Droids MuIn LCD is connected
  - cx88: Fix conversion from BKL to fine-grained locks (Closes: #619827)
  - keys: Set cred->user_ns in key_replace_session_keyring (CVE-2011-2184)
  - tmpfs: fix race between truncate and writepage
  - nfs41: Correct offset for LAYOUTCOMMIT
  - xen/mmu: fix a race window causing leave_mm BUG()
  - ext4: fix possible use-after-free in ext4_remove_li_request()
  For the complete list of changes, see:
   http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.39.1
* Bump ABI to 2
* netfilter: Enable IP_SET, IP_SET_BITMAP_IP, IP_SET_BITMAP_IPMAC,
  IP_SET_BITMAP_PORT, IP_SET_HASH_IP, IP_SET_HASH_IPPORT,
  IP_SET_HASH_IPPORTIP, IP_SET_HASH_IPPORTNET, IP_SET_HASH_NET,
  IP_SET_HASH_NETPORT, IP_SET_LIST_SET, NETFILTER_XT_SET as modules
  (Closes: #629401)

[ Aurelien Jarno ]
* [mipsel/loongson-2f] Disable_SCSI_LPFC to workaround GCC ICE.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
/*****************************************************************************/
27
27
 
28
28
#include "easycap.h"
29
 
#include "easycap_debug.h"
30
29
 
31
30
/*---------------------------------------------------------------------------*/
32
31
/*
40
39
 */
41
40
/*---------------------------------------------------------------------------*/
42
41
const struct easycap_standard easycap_standard[] = {
43
 
{
44
 
.mask = 0x00FF & PAL_BGHIN ,
45
 
.v4l2_standard = {
46
 
        .index = PAL_BGHIN,
47
 
        .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H | \
48
 
                                        V4L2_STD_PAL_I | V4L2_STD_PAL_N),
49
 
        .name = "PAL_BGHIN",
50
 
        .frameperiod = {1, 25},
51
 
        .framelines = 625,
52
 
        .reserved = {0, 0, 0, 0}
 
42
        {
 
43
                .mask = 0x00FF & PAL_BGHIN ,
 
44
                .v4l2_standard = {
 
45
                        .index = PAL_BGHIN,
 
46
                        .id = (V4L2_STD_PAL_B |
 
47
                                V4L2_STD_PAL_G | V4L2_STD_PAL_H |
 
48
                                V4L2_STD_PAL_I | V4L2_STD_PAL_N),
 
49
                        .name = "PAL_BGHIN",
 
50
                        .frameperiod = {1, 25},
 
51
                        .framelines = 625,
 
52
                        .reserved = {0, 0, 0, 0}
 
53
                }
 
54
        },
 
55
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
56
        {
 
57
                .mask = 0x00FF & NTSC_N_443 ,
 
58
                .v4l2_standard = {
 
59
                        .index = NTSC_N_443,
 
60
                        .id = V4L2_STD_UNKNOWN,
 
61
                        .name = "NTSC_N_443",
 
62
                        .frameperiod = {1, 25},
 
63
                        .framelines = 480,
 
64
                        .reserved = {0, 0, 0, 0}
 
65
                }
 
66
        },
 
67
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
68
        {
 
69
                .mask = 0x00FF & PAL_Nc ,
 
70
                .v4l2_standard = {
 
71
                        .index = PAL_Nc,
 
72
                        .id = V4L2_STD_PAL_Nc,
 
73
                        .name = "PAL_Nc",
 
74
                        .frameperiod = {1, 25},
 
75
                        .framelines = 625,
 
76
                        .reserved = {0, 0, 0, 0}
 
77
                }
 
78
        },
 
79
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
80
        {
 
81
                .mask = 0x00FF & NTSC_N ,
 
82
                .v4l2_standard = {
 
83
                        .index = NTSC_N,
 
84
                        .id = V4L2_STD_UNKNOWN,
 
85
                        .name = "NTSC_N",
 
86
                        .frameperiod = {1, 25},
 
87
                        .framelines = 525,
 
88
                        .reserved = {0, 0, 0, 0}
 
89
                }
 
90
        },
 
91
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
92
        {
 
93
                .mask = 0x00FF & SECAM ,
 
94
                .v4l2_standard = {
 
95
                        .index = SECAM,
 
96
                        .id = V4L2_STD_SECAM,
 
97
                        .name = "SECAM",
 
98
                        .frameperiod = {1, 25},
 
99
                        .framelines = 625,
 
100
                        .reserved = {0, 0, 0, 0}
 
101
                }
 
102
        },
 
103
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
104
        {
 
105
                .mask = 0x00FF & NTSC_M ,
 
106
                .v4l2_standard = {
 
107
                        .index = NTSC_M,
 
108
                        .id = V4L2_STD_NTSC_M,
 
109
                        .name = "NTSC_M",
 
110
                        .frameperiod = {1, 30},
 
111
                        .framelines = 525,
 
112
                        .reserved = {0, 0, 0, 0}
 
113
                }
 
114
        },
 
115
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
116
        {
 
117
                .mask = 0x00FF & NTSC_M_JP ,
 
118
                .v4l2_standard = {
 
119
                        .index = NTSC_M_JP,
 
120
                        .id = V4L2_STD_NTSC_M_JP,
 
121
                        .name = "NTSC_M_JP",
 
122
                        .frameperiod = {1, 30},
 
123
                        .framelines = 525,
 
124
                        .reserved = {0, 0, 0, 0}
 
125
                }
 
126
        },
 
127
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
128
        {
 
129
                .mask = 0x00FF & PAL_60 ,
 
130
                .v4l2_standard = {
 
131
                        .index = PAL_60,
 
132
                        .id = V4L2_STD_PAL_60,
 
133
                        .name = "PAL_60",
 
134
                        .frameperiod = {1, 30},
 
135
                        .framelines = 525,
 
136
                        .reserved = {0, 0, 0, 0}
 
137
                }
 
138
        },
 
139
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
140
        {
 
141
                .mask = 0x00FF & NTSC_443 ,
 
142
                .v4l2_standard = {
 
143
                        .index = NTSC_443,
 
144
                        .id = V4L2_STD_NTSC_443,
 
145
                        .name = "NTSC_443",
 
146
                        .frameperiod = {1, 30},
 
147
                        .framelines = 525,
 
148
                        .reserved = {0, 0, 0, 0}
 
149
                }
 
150
        },
 
151
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
152
        {
 
153
                .mask = 0x00FF & PAL_M ,
 
154
                .v4l2_standard = {
 
155
                        .index = PAL_M,
 
156
                        .id = V4L2_STD_PAL_M,
 
157
                        .name = "PAL_M",
 
158
                        .frameperiod = {1, 30},
 
159
                        .framelines = 525,
 
160
                        .reserved = {0, 0, 0, 0}
 
161
                }
 
162
        },
 
163
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
164
        {
 
165
                .mask = 0x8000 | (0x00FF & PAL_BGHIN_SLOW),
 
166
                .v4l2_standard = {
 
167
                        .index = PAL_BGHIN_SLOW,
 
168
                        .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G |
 
169
                                V4L2_STD_PAL_H |
 
170
                                V4L2_STD_PAL_I | V4L2_STD_PAL_N |
 
171
                                (((v4l2_std_id)0x01) << 32)),
 
172
                        .name = "PAL_BGHIN_SLOW",
 
173
                        .frameperiod = {1, 5},
 
174
                        .framelines = 625,
 
175
                        .reserved = {0, 0, 0, 0}
 
176
                }
 
177
        },
 
178
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
179
        {
 
180
                .mask = 0x8000 | (0x00FF & NTSC_N_443_SLOW),
 
181
                .v4l2_standard = {
 
182
                        .index = NTSC_N_443_SLOW,
 
183
                        .id = (V4L2_STD_UNKNOWN | (((v4l2_std_id)0x11) << 32)),
 
184
                        .name = "NTSC_N_443_SLOW",
 
185
                        .frameperiod = {1, 5},
 
186
                        .framelines = 480,
 
187
                        .reserved = {0, 0, 0, 0}
 
188
                }
 
189
        },
 
190
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
191
        {
 
192
                .mask = 0x8000 | (0x00FF & PAL_Nc_SLOW),
 
193
                .v4l2_standard = {
 
194
                        .index = PAL_Nc_SLOW,
 
195
                        .id = (V4L2_STD_PAL_Nc | (((v4l2_std_id)0x01) << 32)),
 
196
                        .name = "PAL_Nc_SLOW",
 
197
                        .frameperiod = {1, 5},
 
198
                        .framelines = 625,
 
199
                        .reserved = {0, 0, 0, 0}
 
200
                }
 
201
        },
 
202
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
203
        {
 
204
                .mask = 0x8000 | (0x00FF & NTSC_N_SLOW),
 
205
                .v4l2_standard = {
 
206
                        .index = NTSC_N_SLOW,
 
207
                        .id = (V4L2_STD_UNKNOWN | (((v4l2_std_id)0x21) << 32)),
 
208
                        .name = "NTSC_N_SLOW",
 
209
                        .frameperiod = {1, 5},
 
210
                        .framelines = 525,
 
211
                        .reserved = {0, 0, 0, 0}
 
212
                }
 
213
        },
 
214
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
215
        {
 
216
                .mask = 0x8000 | (0x00FF & SECAM_SLOW),
 
217
                .v4l2_standard = {
 
218
                        .index = SECAM_SLOW,
 
219
                        .id = (V4L2_STD_SECAM | (((v4l2_std_id)0x01) << 32)),
 
220
                        .name = "SECAM_SLOW",
 
221
                        .frameperiod = {1, 5},
 
222
                        .framelines = 625,
 
223
                        .reserved = {0, 0, 0, 0}
 
224
                }
 
225
        },
 
226
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
227
        {
 
228
                .mask = 0x8000 | (0x00FF & NTSC_M_SLOW),
 
229
                .v4l2_standard = {
 
230
                        .index = NTSC_M_SLOW,
 
231
                        .id = (V4L2_STD_NTSC_M | (((v4l2_std_id)0x01) << 32)),
 
232
                        .name = "NTSC_M_SLOW",
 
233
                        .frameperiod = {1, 6},
 
234
                        .framelines = 525,
 
235
                        .reserved = {0, 0, 0, 0}
 
236
                }
 
237
        },
 
238
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
239
        {
 
240
                .mask = 0x8000 | (0x00FF & NTSC_M_JP_SLOW),
 
241
                .v4l2_standard = {
 
242
                        .index = NTSC_M_JP_SLOW,
 
243
                        .id = (V4L2_STD_NTSC_M_JP |
 
244
                                (((v4l2_std_id)0x01) << 32)),
 
245
                        .name = "NTSC_M_JP_SLOW",
 
246
                        .frameperiod = {1, 6},
 
247
                        .framelines = 525,
 
248
                        .reserved = {0, 0, 0, 0}
 
249
                }
 
250
        },
 
251
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
252
        {
 
253
                .mask = 0x8000 | (0x00FF & PAL_60_SLOW),
 
254
                .v4l2_standard = {
 
255
                        .index = PAL_60_SLOW,
 
256
                        .id = (V4L2_STD_PAL_60 | (((v4l2_std_id)0x01) << 32)),
 
257
                        .name = "PAL_60_SLOW",
 
258
                        .frameperiod = {1, 6},
 
259
                        .framelines = 525,
 
260
                        .reserved = {0, 0, 0, 0}
 
261
                }
 
262
        },
 
263
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
264
        {
 
265
                .mask = 0x8000 | (0x00FF & NTSC_443_SLOW),
 
266
                .v4l2_standard = {
 
267
                        .index = NTSC_443_SLOW,
 
268
                        .id = (V4L2_STD_NTSC_443 | (((v4l2_std_id)0x01) << 32)),
 
269
                        .name = "NTSC_443_SLOW",
 
270
                        .frameperiod = {1, 6},
 
271
                        .framelines = 525,
 
272
                        .reserved = {0, 0, 0, 0}
 
273
                }
 
274
        },
 
275
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
276
        {
 
277
                .mask = 0x8000 | (0x00FF & PAL_M_SLOW),
 
278
                .v4l2_standard = {
 
279
                        .index = PAL_M_SLOW,
 
280
                        .id = (V4L2_STD_PAL_M | (((v4l2_std_id)0x01) << 32)),
 
281
                        .name = "PAL_M_SLOW",
 
282
                        .frameperiod = {1, 6},
 
283
                        .framelines = 525,
 
284
                        .reserved = {0, 0, 0, 0}
 
285
                }
 
286
        },
 
287
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
288
        {
 
289
                .mask = 0xFFFF
53
290
        }
54
 
},
55
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
56
 
{
57
 
.mask = 0x00FF & NTSC_N_443 ,
58
 
.v4l2_standard = {
59
 
        .index = NTSC_N_443,
60
 
        .id = V4L2_STD_UNKNOWN,
61
 
        .name = "NTSC_N_443",
62
 
        .frameperiod = {1, 25},
63
 
        .framelines = 480,
64
 
        .reserved = {0, 0, 0, 0}
65
 
}
66
 
},
67
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
68
 
{
69
 
.mask = 0x00FF & PAL_Nc ,
70
 
.v4l2_standard = {
71
 
        .index = PAL_Nc,
72
 
        .id = V4L2_STD_PAL_Nc,
73
 
        .name = "PAL_Nc",
74
 
        .frameperiod = {1, 25},
75
 
        .framelines = 625,
76
 
        .reserved = {0, 0, 0, 0}
77
 
}
78
 
},
79
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
80
 
{
81
 
.mask = 0x00FF & NTSC_N ,
82
 
.v4l2_standard = {
83
 
        .index = NTSC_N,
84
 
        .id = V4L2_STD_UNKNOWN,
85
 
        .name = "NTSC_N",
86
 
        .frameperiod = {1, 25},
87
 
        .framelines = 525,
88
 
        .reserved = {0, 0, 0, 0}
89
 
}
90
 
},
91
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
92
 
{
93
 
.mask = 0x00FF & SECAM ,
94
 
.v4l2_standard = {
95
 
        .index = SECAM,
96
 
        .id = V4L2_STD_SECAM,
97
 
        .name = "SECAM",
98
 
        .frameperiod = {1, 25},
99
 
        .framelines = 625,
100
 
        .reserved = {0, 0, 0, 0}
101
 
}
102
 
},
103
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
104
 
{
105
 
.mask = 0x00FF & NTSC_M ,
106
 
.v4l2_standard = {
107
 
        .index = NTSC_M,
108
 
        .id = V4L2_STD_NTSC_M,
109
 
        .name = "NTSC_M",
110
 
        .frameperiod = {1, 30},
111
 
        .framelines = 525,
112
 
        .reserved = {0, 0, 0, 0}
113
 
}
114
 
},
115
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
116
 
{
117
 
.mask = 0x00FF & NTSC_M_JP ,
118
 
.v4l2_standard = {
119
 
        .index = NTSC_M_JP,
120
 
        .id = V4L2_STD_NTSC_M_JP,
121
 
        .name = "NTSC_M_JP",
122
 
        .frameperiod = {1, 30},
123
 
        .framelines = 525,
124
 
        .reserved = {0, 0, 0, 0}
125
 
}
126
 
},
127
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
128
 
{
129
 
.mask = 0x00FF & PAL_60 ,
130
 
.v4l2_standard = {
131
 
        .index = PAL_60,
132
 
        .id = V4L2_STD_PAL_60,
133
 
        .name = "PAL_60",
134
 
        .frameperiod = {1, 30},
135
 
        .framelines = 525,
136
 
        .reserved = {0, 0, 0, 0}
137
 
}
138
 
},
139
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
140
 
{
141
 
.mask = 0x00FF & NTSC_443 ,
142
 
.v4l2_standard = {
143
 
        .index = NTSC_443,
144
 
        .id = V4L2_STD_NTSC_443,
145
 
        .name = "NTSC_443",
146
 
        .frameperiod = {1, 30},
147
 
        .framelines = 525,
148
 
        .reserved = {0, 0, 0, 0}
149
 
}
150
 
},
151
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
152
 
{
153
 
.mask = 0x00FF & PAL_M ,
154
 
.v4l2_standard = {
155
 
        .index = PAL_M,
156
 
        .id = V4L2_STD_PAL_M,
157
 
        .name = "PAL_M",
158
 
        .frameperiod = {1, 30},
159
 
        .framelines = 525,
160
 
        .reserved = {0, 0, 0, 0}
161
 
}
162
 
},
163
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
164
 
{
165
 
.mask = 0x8000 | (0x00FF & PAL_BGHIN_SLOW),
166
 
.v4l2_standard = {
167
 
        .index = PAL_BGHIN_SLOW,
168
 
        .id = (V4L2_STD_PAL_B | V4L2_STD_PAL_G | V4L2_STD_PAL_H | \
169
 
                                V4L2_STD_PAL_I | V4L2_STD_PAL_N | \
170
 
                                        (((v4l2_std_id)0x01) << 32)),
171
 
        .name = "PAL_BGHIN_SLOW",
172
 
        .frameperiod = {1, 5},
173
 
        .framelines = 625,
174
 
        .reserved = {0, 0, 0, 0}
175
 
}
176
 
},
177
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
178
 
{
179
 
.mask = 0x8000 | (0x00FF & NTSC_N_443_SLOW),
180
 
.v4l2_standard = {
181
 
        .index = NTSC_N_443_SLOW,
182
 
        .id = (V4L2_STD_UNKNOWN | (((v4l2_std_id)0x11) << 32)),
183
 
        .name = "NTSC_N_443_SLOW",
184
 
        .frameperiod = {1, 5},
185
 
        .framelines = 480,
186
 
        .reserved = {0, 0, 0, 0}
187
 
}
188
 
},
189
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
190
 
{
191
 
.mask = 0x8000 | (0x00FF & PAL_Nc_SLOW),
192
 
.v4l2_standard = {
193
 
        .index = PAL_Nc_SLOW,
194
 
        .id = (V4L2_STD_PAL_Nc | (((v4l2_std_id)0x01) << 32)),
195
 
        .name = "PAL_Nc_SLOW",
196
 
        .frameperiod = {1, 5},
197
 
        .framelines = 625,
198
 
        .reserved = {0, 0, 0, 0}
199
 
}
200
 
},
201
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
202
 
{
203
 
.mask = 0x8000 | (0x00FF & NTSC_N_SLOW),
204
 
.v4l2_standard = {
205
 
        .index = NTSC_N_SLOW,
206
 
        .id = (V4L2_STD_UNKNOWN | (((v4l2_std_id)0x21) << 32)),
207
 
        .name = "NTSC_N_SLOW",
208
 
        .frameperiod = {1, 5},
209
 
        .framelines = 525,
210
 
        .reserved = {0, 0, 0, 0}
211
 
}
212
 
},
213
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
214
 
{
215
 
.mask = 0x8000 | (0x00FF & SECAM_SLOW),
216
 
.v4l2_standard = {
217
 
        .index = SECAM_SLOW,
218
 
        .id = (V4L2_STD_SECAM | (((v4l2_std_id)0x01) << 32)),
219
 
        .name = "SECAM_SLOW",
220
 
        .frameperiod = {1, 5},
221
 
        .framelines = 625,
222
 
        .reserved = {0, 0, 0, 0}
223
 
}
224
 
},
225
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
226
 
{
227
 
.mask = 0x8000 | (0x00FF & NTSC_M_SLOW),
228
 
.v4l2_standard = {
229
 
        .index = NTSC_M_SLOW,
230
 
        .id = (V4L2_STD_NTSC_M | (((v4l2_std_id)0x01) << 32)),
231
 
        .name = "NTSC_M_SLOW",
232
 
        .frameperiod = {1, 6},
233
 
        .framelines = 525,
234
 
        .reserved = {0, 0, 0, 0}
235
 
}
236
 
},
237
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
238
 
{
239
 
.mask = 0x8000 | (0x00FF & NTSC_M_JP_SLOW),
240
 
.v4l2_standard = {
241
 
        .index = NTSC_M_JP_SLOW,
242
 
        .id = (V4L2_STD_NTSC_M_JP | (((v4l2_std_id)0x01) << 32)),
243
 
        .name = "NTSC_M_JP_SLOW",
244
 
        .frameperiod = {1, 6},
245
 
        .framelines = 525,
246
 
        .reserved = {0, 0, 0, 0}
247
 
}
248
 
},
249
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
250
 
{
251
 
.mask = 0x8000 | (0x00FF & PAL_60_SLOW),
252
 
.v4l2_standard = {
253
 
        .index = PAL_60_SLOW,
254
 
        .id = (V4L2_STD_PAL_60 | (((v4l2_std_id)0x01) << 32)),
255
 
        .name = "PAL_60_SLOW",
256
 
        .frameperiod = {1, 6},
257
 
        .framelines = 525,
258
 
        .reserved = {0, 0, 0, 0}
259
 
}
260
 
},
261
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
262
 
{
263
 
.mask = 0x8000 | (0x00FF & NTSC_443_SLOW),
264
 
.v4l2_standard = {
265
 
        .index = NTSC_443_SLOW,
266
 
        .id = (V4L2_STD_NTSC_443 | (((v4l2_std_id)0x01) << 32)),
267
 
        .name = "NTSC_443_SLOW",
268
 
        .frameperiod = {1, 6},
269
 
        .framelines = 525,
270
 
        .reserved = {0, 0, 0, 0}
271
 
}
272
 
},
273
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
274
 
{
275
 
.mask = 0x8000 | (0x00FF & PAL_M_SLOW),
276
 
.v4l2_standard = {
277
 
        .index = PAL_M_SLOW,
278
 
        .id = (V4L2_STD_PAL_M | (((v4l2_std_id)0x01) << 32)),
279
 
        .name = "PAL_M_SLOW",
280
 
        .frameperiod = {1, 6},
281
 
        .framelines = 525,
282
 
        .reserved = {0, 0, 0, 0}
283
 
}
284
 
},
285
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
286
 
{
287
 
.mask = 0xFFFF
288
 
}
289
291
};
290
292
/*---------------------------------------------------------------------------*/
291
293
/*
311
313
 
312
314
struct easycap_format easycap_format[1 + SETTINGS_MANY];
313
315
 
314
 
int
315
 
fillin_formats(void)
 
316
int fillin_formats(void)
316
317
{
317
 
int i, j, k, m, n;
318
 
__u32 width, height, pixelformat, bytesperline, sizeimage;
319
 
__u32 field, colorspace;
320
 
__u16 mask1, mask2, mask3, mask4;
321
 
char name1[32], name2[32], name3[32], name4[32];
322
 
 
323
 
for (i = 0, n = 0; i < STANDARD_MANY; i++) {
324
 
        mask1 = 0x0000;
325
 
        switch (i) {
326
 
        case PAL_BGHIN: {
327
 
                mask1 = 0x1F & PAL_BGHIN;
328
 
                strcpy(&name1[0], "PAL_BGHIN");
329
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
330
 
                break;
331
 
        }
332
 
        case SECAM: {
333
 
                mask1 = 0x1F & SECAM;
334
 
                strcpy(&name1[0], "SECAM");
335
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
336
 
                break;
337
 
        }
338
 
        case PAL_Nc: {
339
 
                mask1 = 0x1F & PAL_Nc;
340
 
                strcpy(&name1[0], "PAL_Nc");
341
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
342
 
                break;
343
 
        }
344
 
        case PAL_60: {
345
 
                mask1 = 0x1F & PAL_60;
346
 
                strcpy(&name1[0], "PAL_60");
347
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
348
 
                break;
349
 
        }
350
 
        case PAL_M: {
351
 
                mask1 = 0x1F & PAL_M;
352
 
                strcpy(&name1[0], "PAL_M");
353
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
354
 
                break;
355
 
        }
356
 
        case NTSC_M: {
357
 
                mask1 = 0x1F & NTSC_M;
358
 
                strcpy(&name1[0], "NTSC_M");
359
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
360
 
                break;
361
 
        }
362
 
        case NTSC_443: {
363
 
                mask1 = 0x1F & NTSC_443;
364
 
                strcpy(&name1[0], "NTSC_443");
365
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
366
 
                break;
367
 
        }
368
 
        case NTSC_M_JP: {
369
 
                mask1 = 0x1F & NTSC_M_JP;
370
 
                strcpy(&name1[0], "NTSC_M_JP");
371
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
372
 
                break;
373
 
        }
374
 
        case NTSC_N: {
375
 
                mask1 = 0x1F & NTSC_M;
376
 
                strcpy(&name1[0], "NTSC_N");
377
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
378
 
                break;
379
 
        }
380
 
        case NTSC_N_443: {
381
 
                mask1 = 0x1F & NTSC_N_443;
382
 
                strcpy(&name1[0], "NTSC_N_443");
383
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
384
 
                break;
385
 
        }
386
 
        case PAL_BGHIN_SLOW: {
387
 
                mask1 = 0x001F & PAL_BGHIN_SLOW;
388
 
                mask1 |= 0x0200;
389
 
                strcpy(&name1[0], "PAL_BGHIN_SLOW");
390
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
391
 
                break;
392
 
        }
393
 
        case SECAM_SLOW: {
394
 
                mask1 = 0x001F & SECAM_SLOW;
395
 
                mask1 |= 0x0200;
396
 
                strcpy(&name1[0], "SECAM_SLOW");
397
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
398
 
                break;
399
 
        }
400
 
        case PAL_Nc_SLOW: {
401
 
                mask1 = 0x001F & PAL_Nc_SLOW;
402
 
                mask1 |= 0x0200;
403
 
                strcpy(&name1[0], "PAL_Nc_SLOW");
404
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
405
 
                break;
406
 
        }
407
 
        case PAL_60_SLOW: {
408
 
                mask1 = 0x001F & PAL_60_SLOW;
409
 
                mask1 |= 0x0200;
410
 
                strcpy(&name1[0], "PAL_60_SLOW");
411
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
412
 
                break;
413
 
        }
414
 
        case PAL_M_SLOW: {
415
 
                mask1 = 0x001F & PAL_M_SLOW;
416
 
                mask1 |= 0x0200;
417
 
                strcpy(&name1[0], "PAL_M_SLOW");
418
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
419
 
                break;
420
 
        }
421
 
        case NTSC_M_SLOW: {
422
 
                mask1 = 0x001F & NTSC_M_SLOW;
423
 
                mask1 |= 0x0200;
424
 
                strcpy(&name1[0], "NTSC_M_SLOW");
425
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
426
 
                break;
427
 
        }
428
 
        case NTSC_443_SLOW: {
429
 
                mask1 = 0x001F & NTSC_443_SLOW;
430
 
                mask1 |= 0x0200;
431
 
                strcpy(&name1[0], "NTSC_443_SLOW");
432
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
433
 
                break;
434
 
        }
435
 
        case NTSC_M_JP_SLOW: {
436
 
                mask1 = 0x001F & NTSC_M_JP_SLOW;
437
 
                mask1 |= 0x0200;
438
 
                strcpy(&name1[0], "NTSC_M_JP_SLOW");
439
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
440
 
                break;
441
 
        }
442
 
        case NTSC_N_SLOW: {
443
 
                mask1 = 0x001F & NTSC_N_SLOW;
444
 
                mask1 |= 0x0200;
445
 
                strcpy(&name1[0], "NTSC_N_SLOW");
446
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
447
 
                break;
448
 
        }
449
 
        case NTSC_N_443_SLOW: {
450
 
                mask1 = 0x001F & NTSC_N_443_SLOW;
451
 
                mask1 |= 0x0200;
452
 
                strcpy(&name1[0], "NTSC_N_443_SLOW");
453
 
                colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
454
 
                break;
455
 
        }
456
 
        default:
457
 
                return -1;
458
 
        }
459
 
 
460
 
        for (j = 0; j < RESOLUTION_MANY; j++) {
461
 
                mask2 = 0x0000;
462
 
                switch (j) {
463
 
                case AT_720x576: {
464
 
                        if (0x1 & mask1)
465
 
                                continue;
466
 
                        strcpy(&name2[0], "_AT_720x576");
467
 
                        width = 720; height = 576; break;
468
 
                }
469
 
                case AT_704x576: {
470
 
                        if (0x1 & mask1)
471
 
                                continue;
472
 
                        strcpy(&name2[0], "_AT_704x576");
473
 
                        width = 704; height = 576; break;
474
 
                }
475
 
                case AT_640x480: {
476
 
                        strcpy(&name2[0], "_AT_640x480");
477
 
                        width = 640; height = 480; break;
478
 
                }
479
 
                case AT_720x480: {
480
 
                        if (!(0x1 & mask1))
481
 
                                continue;
482
 
                        strcpy(&name2[0], "_AT_720x480");
483
 
                        width = 720; height = 480; break;
484
 
                }
485
 
                case AT_360x288: {
486
 
                        if (0x1 & mask1)
487
 
                                continue;
488
 
                        strcpy(&name2[0], "_AT_360x288");
489
 
                        width = 360; height = 288; mask2 = 0x0800; break;
490
 
                }
491
 
                case AT_320x240: {
492
 
                        strcpy(&name2[0], "_AT_320x240");
493
 
                        width = 320; height = 240; mask2 = 0x0800; break;
494
 
                }
495
 
                case AT_360x240: {
496
 
                        if (!(0x1 & mask1))
497
 
                                continue;
498
 
                        strcpy(&name2[0], "_AT_360x240");
499
 
                        width = 360; height = 240; mask2 = 0x0800; break;
 
318
        const char *name1, *name2, *name3, *name4;
 
319
        struct v4l2_format *fmt;
 
320
        int i, j, k, m, n;
 
321
        u32 width, height, pixelformat, bytesperline, sizeimage;
 
322
        u16 mask1, mask2, mask3, mask4;
 
323
        enum v4l2_field field;
 
324
        enum v4l2_colorspace colorspace;
 
325
 
 
326
        for (i = 0, n = 0; i < STANDARD_MANY; i++) {
 
327
                mask1 = 0x0000;
 
328
                switch (i) {
 
329
                case PAL_BGHIN: {
 
330
                        mask1 = 0x1F & PAL_BGHIN;
 
331
                        name1 = "PAL_BGHIN";
 
332
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
333
                        break;
 
334
                }
 
335
                case SECAM: {
 
336
                        mask1 = 0x1F & SECAM;
 
337
                        name1 = "SECAM";
 
338
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
339
                        break;
 
340
                }
 
341
                case PAL_Nc: {
 
342
                        mask1 = 0x1F & PAL_Nc;
 
343
                        name1 = "PAL_Nc";
 
344
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
345
                        break;
 
346
                }
 
347
                case PAL_60: {
 
348
                        mask1 = 0x1F & PAL_60;
 
349
                        name1 = "PAL_60";
 
350
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
351
                        break;
 
352
                }
 
353
                case PAL_M: {
 
354
                        mask1 = 0x1F & PAL_M;
 
355
                        name1 = "PAL_M";
 
356
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
357
                        break;
 
358
                }
 
359
                case NTSC_M: {
 
360
                        mask1 = 0x1F & NTSC_M;
 
361
                        name1 = "NTSC_M";
 
362
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
363
                        break;
 
364
                }
 
365
                case NTSC_443: {
 
366
                        mask1 = 0x1F & NTSC_443;
 
367
                        name1 = "NTSC_443";
 
368
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
369
                        break;
 
370
                }
 
371
                case NTSC_M_JP: {
 
372
                        mask1 = 0x1F & NTSC_M_JP;
 
373
                        name1 = "NTSC_M_JP";
 
374
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
375
                        break;
 
376
                }
 
377
                case NTSC_N: {
 
378
                        mask1 = 0x1F & NTSC_M;
 
379
                        name1 = "NTSC_N";
 
380
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
381
                        break;
 
382
                }
 
383
                case NTSC_N_443: {
 
384
                        mask1 = 0x1F & NTSC_N_443;
 
385
                        name1 = "NTSC_N_443";
 
386
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
387
                        break;
 
388
                }
 
389
                case PAL_BGHIN_SLOW: {
 
390
                        mask1 = 0x001F & PAL_BGHIN_SLOW;
 
391
                        mask1 |= 0x0200;
 
392
                        name1 = "PAL_BGHIN_SLOW";
 
393
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
394
                        break;
 
395
                }
 
396
                case SECAM_SLOW: {
 
397
                        mask1 = 0x001F & SECAM_SLOW;
 
398
                        mask1 |= 0x0200;
 
399
                        name1 = "SECAM_SLOW";
 
400
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
401
                        break;
 
402
                }
 
403
                case PAL_Nc_SLOW: {
 
404
                        mask1 = 0x001F & PAL_Nc_SLOW;
 
405
                        mask1 |= 0x0200;
 
406
                        name1 = "PAL_Nc_SLOW";
 
407
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
408
                        break;
 
409
                }
 
410
                case PAL_60_SLOW: {
 
411
                        mask1 = 0x001F & PAL_60_SLOW;
 
412
                        mask1 |= 0x0200;
 
413
                        name1 = "PAL_60_SLOW";
 
414
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
415
                        break;
 
416
                }
 
417
                case PAL_M_SLOW: {
 
418
                        mask1 = 0x001F & PAL_M_SLOW;
 
419
                        mask1 |= 0x0200;
 
420
                        name1 = "PAL_M_SLOW";
 
421
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_BG;
 
422
                        break;
 
423
                }
 
424
                case NTSC_M_SLOW: {
 
425
                        mask1 = 0x001F & NTSC_M_SLOW;
 
426
                        mask1 |= 0x0200;
 
427
                        name1 = "NTSC_M_SLOW";
 
428
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
429
                        break;
 
430
                }
 
431
                case NTSC_443_SLOW: {
 
432
                        mask1 = 0x001F & NTSC_443_SLOW;
 
433
                        mask1 |= 0x0200;
 
434
                        name1 = "NTSC_443_SLOW";
 
435
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
436
                        break;
 
437
                }
 
438
                case NTSC_M_JP_SLOW: {
 
439
                        mask1 = 0x001F & NTSC_M_JP_SLOW;
 
440
                        mask1 |= 0x0200;
 
441
                        name1 = "NTSC_M_JP_SLOW";
 
442
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
443
                        break;
 
444
                }
 
445
                case NTSC_N_SLOW: {
 
446
                        mask1 = 0x001F & NTSC_N_SLOW;
 
447
                        mask1 |= 0x0200;
 
448
                        name1 = "NTSC_N_SLOW";
 
449
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
450
                        break;
 
451
                }
 
452
                case NTSC_N_443_SLOW: {
 
453
                        mask1 = 0x001F & NTSC_N_443_SLOW;
 
454
                        mask1 |= 0x0200;
 
455
                        name1 = "NTSC_N_443_SLOW";
 
456
                        colorspace = V4L2_COLORSPACE_470_SYSTEM_M;
 
457
                        break;
500
458
                }
501
459
                default:
502
 
                        return -2;
 
460
                        return -1;
503
461
                }
504
462
 
505
 
                for (k = 0; k < PIXELFORMAT_MANY; k++) {
506
 
                        mask3 = 0x0000;
507
 
                        switch (k) {
508
 
                        case FMT_UYVY: {
509
 
                                strcpy(&name3[0], "_" STRINGIZE(FMT_UYVY));
510
 
                                pixelformat = V4L2_PIX_FMT_UYVY;
511
 
                                mask3 |= (0x02 << 5);
512
 
                                break;
513
 
                        }
514
 
                        case FMT_YUY2: {
515
 
                                strcpy(&name3[0], "_" STRINGIZE(FMT_YUY2));
516
 
                                pixelformat = V4L2_PIX_FMT_YUYV;
517
 
                                mask3 |= (0x02 << 5);
518
 
                                mask3 |= 0x0100;
519
 
                                break;
520
 
                        }
521
 
                        case FMT_RGB24: {
522
 
                                strcpy(&name3[0], "_" STRINGIZE(FMT_RGB24));
523
 
                                pixelformat = V4L2_PIX_FMT_RGB24;
524
 
                                mask3 |= (0x03 << 5);
525
 
                                break;
526
 
                        }
527
 
                        case FMT_RGB32: {
528
 
                                strcpy(&name3[0], "_" STRINGIZE(FMT_RGB32));
529
 
                                pixelformat = V4L2_PIX_FMT_RGB32;
530
 
                                mask3 |= (0x04 << 5);
531
 
                                break;
532
 
                        }
533
 
                        case FMT_BGR24: {
534
 
                                strcpy(&name3[0], "_" STRINGIZE(FMT_BGR24));
535
 
                                pixelformat = V4L2_PIX_FMT_BGR24;
536
 
                                mask3 |= (0x03 << 5);
537
 
                                mask3 |= 0x0100;
538
 
                                break;
539
 
                        }
540
 
                        case FMT_BGR32: {
541
 
                                strcpy(&name3[0], "_" STRINGIZE(FMT_BGR32));
542
 
                                pixelformat = V4L2_PIX_FMT_BGR32;
543
 
                                mask3 |= (0x04 << 5);
544
 
                                mask3 |= 0x0100;
 
463
                for (j = 0; j < RESOLUTION_MANY; j++) {
 
464
                        mask2 = 0x0000;
 
465
                        switch (j) {
 
466
                        case AT_720x576: {
 
467
                                if (0x1 & mask1)
 
468
                                        continue;
 
469
                                name2 = "_AT_720x576";
 
470
                                width = 720;
 
471
                                height = 576;
 
472
                                break;
 
473
                        }
 
474
                        case AT_704x576: {
 
475
                                if (0x1 & mask1)
 
476
                                        continue;
 
477
                                name2 = "_AT_704x576";
 
478
                                width = 704;
 
479
                                height = 576;
 
480
                                break;
 
481
                        }
 
482
                        case AT_640x480: {
 
483
                                name2 = "_AT_640x480";
 
484
                                width = 640;
 
485
                                height = 480;
 
486
                                break;
 
487
                        }
 
488
                        case AT_720x480: {
 
489
                                if (!(0x1 & mask1))
 
490
                                        continue;
 
491
                                name2 = "_AT_720x480";
 
492
                                width = 720;
 
493
                                height = 480;
 
494
                                break;
 
495
                        }
 
496
                        case AT_360x288: {
 
497
                                if (0x1 & mask1)
 
498
                                        continue;
 
499
                                name2 = "_AT_360x288";
 
500
                                width = 360;
 
501
                                height = 288;
 
502
                                mask2 = 0x0800;
 
503
                                break;
 
504
                        }
 
505
                        case AT_320x240: {
 
506
                                name2 = "_AT_320x240";
 
507
                                width = 320;
 
508
                                height = 240;
 
509
                                mask2 = 0x0800;
 
510
                                break;
 
511
                        }
 
512
                        case AT_360x240: {
 
513
                                if (!(0x1 & mask1))
 
514
                                        continue;
 
515
                                name2 = "_AT_360x240";
 
516
                                width = 360;
 
517
                                height = 240;
 
518
                                mask2 = 0x0800;
545
519
                                break;
546
520
                        }
547
521
                        default:
548
 
                                return -3;
 
522
                                return -2;
549
523
                        }
550
 
                        bytesperline = width * ((mask3 & 0x00F0) >> 4);
551
 
                        sizeimage =  bytesperline * height;
552
524
 
553
 
                        for (m = 0; m < INTERLACE_MANY; m++) {
554
 
                                mask4 = 0x0000;
555
 
                                switch (m) {
556
 
                                case FIELD_NONE: {
557
 
                                        strcpy(&name4[0], "-n");
558
 
                                        field = V4L2_FIELD_NONE;
559
 
                                        break;
560
 
                                }
561
 
                                case FIELD_INTERLACED: {
562
 
                                        strcpy(&name4[0], "-i");
563
 
                                        mask4 |= 0x1000;
564
 
                                        field = V4L2_FIELD_INTERLACED;
 
525
                        for (k = 0; k < PIXELFORMAT_MANY; k++) {
 
526
                                mask3 = 0x0000;
 
527
                                switch (k) {
 
528
                                case FMT_UYVY: {
 
529
                                        name3 = __stringify(FMT_UYVY);
 
530
                                        pixelformat = V4L2_PIX_FMT_UYVY;
 
531
                                        mask3 |= (0x02 << 5);
 
532
                                        break;
 
533
                                }
 
534
                                case FMT_YUY2: {
 
535
                                        name3 = __stringify(FMT_YUY2);
 
536
                                        pixelformat = V4L2_PIX_FMT_YUYV;
 
537
                                        mask3 |= (0x02 << 5);
 
538
                                        mask3 |= 0x0100;
 
539
                                        break;
 
540
                                }
 
541
                                case FMT_RGB24: {
 
542
                                        name3 = __stringify(FMT_RGB24);
 
543
                                        pixelformat = V4L2_PIX_FMT_RGB24;
 
544
                                        mask3 |= (0x03 << 5);
 
545
                                        break;
 
546
                                }
 
547
                                case FMT_RGB32: {
 
548
                                        name3 = __stringify(FMT_RGB32);
 
549
                                        pixelformat = V4L2_PIX_FMT_RGB32;
 
550
                                        mask3 |= (0x04 << 5);
 
551
                                        break;
 
552
                                }
 
553
                                case FMT_BGR24: {
 
554
                                        name3 = __stringify(FMT_BGR24);
 
555
                                        pixelformat = V4L2_PIX_FMT_BGR24;
 
556
                                        mask3 |= (0x03 << 5);
 
557
                                        mask3 |= 0x0100;
 
558
                                        break;
 
559
                                }
 
560
                                case FMT_BGR32: {
 
561
                                        name3 = __stringify(FMT_BGR32);
 
562
                                        pixelformat = V4L2_PIX_FMT_BGR32;
 
563
                                        mask3 |= (0x04 << 5);
 
564
                                        mask3 |= 0x0100;
565
565
                                        break;
566
566
                                }
567
567
                                default:
568
 
                                        return -4;
 
568
                                        return -3;
569
569
                                }
570
 
                                if (SETTINGS_MANY <= n)
571
 
                                        return -5;
572
 
                                strcpy(&easycap_format[n].name[0], &name1[0]);
573
 
                                strcat(&easycap_format[n].name[0], &name2[0]);
574
 
                                strcat(&easycap_format[n].name[0], &name3[0]);
575
 
                                strcat(&easycap_format[n].name[0], &name4[0]);
576
 
                                easycap_format[n].mask = \
 
570
                                bytesperline = width * ((mask3 & 0x00F0) >> 4);
 
571
                                sizeimage =  bytesperline * height;
 
572
 
 
573
                                for (m = 0; m < INTERLACE_MANY; m++) {
 
574
                                        mask4 = 0x0000;
 
575
                                        switch (m) {
 
576
                                        case FIELD_NONE: {
 
577
                                                name4 = "-n";
 
578
                                                field = V4L2_FIELD_NONE;
 
579
                                                break;
 
580
                                        }
 
581
                                        case FIELD_INTERLACED: {
 
582
                                                name4 = "-i";
 
583
                                                mask4 |= 0x1000;
 
584
                                                field = V4L2_FIELD_INTERLACED;
 
585
                                                break;
 
586
                                        }
 
587
                                        default:
 
588
                                                return -4;
 
589
                                        }
 
590
                                        if (SETTINGS_MANY <= n)
 
591
                                                return -5;
 
592
 
 
593
                                        strcpy(easycap_format[n].name, name1);
 
594
                                        strcat(easycap_format[n].name, name2);
 
595
                                        strcat(easycap_format[n].name, "_");
 
596
                                        strcat(easycap_format[n].name, name3);
 
597
                                        strcat(easycap_format[n].name, name4);
 
598
                                        easycap_format[n].mask =
577
599
                                                mask1 | mask2 | mask3 | mask4;
578
 
                                easycap_format[n].v4l2_format\
579
 
                                        .type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
580
 
                                easycap_format[n].v4l2_format\
581
 
                                        .fmt.pix.width = width;
582
 
                                easycap_format[n].v4l2_format\
583
 
                                        .fmt.pix.height = height;
584
 
                                easycap_format[n].v4l2_format\
585
 
                                        .fmt.pix.pixelformat = pixelformat;
586
 
                                easycap_format[n].v4l2_format\
587
 
                                        .fmt.pix.field = field;
588
 
                                easycap_format[n].v4l2_format\
589
 
                                        .fmt.pix.bytesperline = bytesperline;
590
 
                                easycap_format[n].v4l2_format\
591
 
                                        .fmt.pix.sizeimage = sizeimage;
592
 
                                easycap_format[n].v4l2_format\
593
 
                                        .fmt.pix.colorspace = colorspace;
594
 
                                easycap_format[n].v4l2_format\
595
 
                                        .fmt.pix.priv = 0;
596
 
                                n++;
 
600
                                        fmt = &easycap_format[n].v4l2_format;
 
601
 
 
602
                                        fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 
603
                                        fmt->fmt.pix.width = width;
 
604
                                        fmt->fmt.pix.height = height;
 
605
                                        fmt->fmt.pix.pixelformat = pixelformat;
 
606
                                        fmt->fmt.pix.field = field;
 
607
                                        fmt->fmt.pix.bytesperline = bytesperline;
 
608
                                        fmt->fmt.pix.sizeimage = sizeimage;
 
609
                                        fmt->fmt.pix.colorspace = colorspace;
 
610
                                        fmt->fmt.pix.priv = 0;
 
611
                                        n++;
 
612
                                }
597
613
                        }
598
614
                }
599
615
        }
600
 
}
601
 
if ((1 + SETTINGS_MANY) <= n)
602
 
        return -6;
603
 
easycap_format[n].mask = 0xFFFF;
604
 
return n;
 
616
        if ((1 + SETTINGS_MANY) <= n)
 
617
                return -6;
 
618
        easycap_format[n].mask = 0xFFFF;
 
619
        return n;
605
620
}
606
621
/*---------------------------------------------------------------------------*/
607
 
struct v4l2_queryctrl easycap_control[] = \
608
 
{{
609
 
.id       = V4L2_CID_BRIGHTNESS,
610
 
.type     = V4L2_CTRL_TYPE_INTEGER,
611
 
.name     = "Brightness",
612
 
.minimum  = 0,
613
 
.maximum  = 255,
614
 
.step     =  1,
615
 
.default_value = SAA_0A_DEFAULT,
616
 
.flags    = 0,
617
 
.reserved = {0, 0}
618
 
},
619
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
620
 
{
621
 
.id       = V4L2_CID_CONTRAST,
622
 
.type     = V4L2_CTRL_TYPE_INTEGER,
623
 
.name     = "Contrast",
624
 
.minimum  = 0,
625
 
.maximum  = 255,
626
 
.step     =   1,
627
 
.default_value = SAA_0B_DEFAULT + 128,
628
 
.flags    = 0,
629
 
.reserved = {0, 0}
630
 
},
631
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
632
 
{
633
 
.id       = V4L2_CID_SATURATION,
634
 
.type     = V4L2_CTRL_TYPE_INTEGER,
635
 
.name     = "Saturation",
636
 
.minimum  = 0,
637
 
.maximum  = 255,
638
 
.step     =   1,
639
 
.default_value = SAA_0C_DEFAULT + 128,
640
 
.flags    = 0,
641
 
.reserved = {0, 0}
642
 
},
643
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
644
 
{
645
 
.id       = V4L2_CID_HUE,
646
 
.type     = V4L2_CTRL_TYPE_INTEGER,
647
 
.name     = "Hue",
648
 
.minimum  = 0,
649
 
.maximum  = 255,
650
 
.step     =   1,
651
 
.default_value = SAA_0D_DEFAULT + 128,
652
 
.flags    = 0,
653
 
.reserved = {0, 0}
654
 
},
655
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
656
 
{
657
 
.id       = V4L2_CID_AUDIO_VOLUME,
658
 
.type     = V4L2_CTRL_TYPE_INTEGER,
659
 
.name     = "Volume",
660
 
.minimum  = 0,
661
 
.maximum  = 31,
662
 
.step     =   1,
663
 
.default_value = 16,
664
 
.flags    = 0,
665
 
.reserved = {0, 0}
666
 
},
667
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
668
 
{
669
 
.id       = V4L2_CID_AUDIO_MUTE,
670
 
.type     = V4L2_CTRL_TYPE_BOOLEAN,
671
 
.name     = "Mute",
672
 
.default_value = true,
673
 
.flags    = 0,
674
 
.reserved = {0, 0}
675
 
},
676
 
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
677
 
{
678
 
.id = 0xFFFFFFFF
679
 
}
 
622
struct v4l2_queryctrl easycap_control[] = {
 
623
        {
 
624
                .id       = V4L2_CID_BRIGHTNESS,
 
625
                .type     = V4L2_CTRL_TYPE_INTEGER,
 
626
                .name     = "Brightness",
 
627
                .minimum  = 0,
 
628
                .maximum  = 255,
 
629
                .step     =  1,
 
630
                .default_value = SAA_0A_DEFAULT,
 
631
                .flags    = 0,
 
632
                .reserved = {0, 0}
 
633
        },
 
634
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
635
        {
 
636
                .id       = V4L2_CID_CONTRAST,
 
637
                .type     = V4L2_CTRL_TYPE_INTEGER,
 
638
                .name     = "Contrast",
 
639
                .minimum  = 0,
 
640
                .maximum  = 255,
 
641
                .step     =   1,
 
642
                .default_value = SAA_0B_DEFAULT + 128,
 
643
                .flags    = 0,
 
644
                .reserved = {0, 0}
 
645
        },
 
646
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
647
        {
 
648
                .id       = V4L2_CID_SATURATION,
 
649
                .type     = V4L2_CTRL_TYPE_INTEGER,
 
650
                .name     = "Saturation",
 
651
                .minimum  = 0,
 
652
                .maximum  = 255,
 
653
                .step     =   1,
 
654
                .default_value = SAA_0C_DEFAULT + 128,
 
655
                .flags    = 0,
 
656
                .reserved = {0, 0}
 
657
        },
 
658
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
659
        {
 
660
                .id       = V4L2_CID_HUE,
 
661
                .type     = V4L2_CTRL_TYPE_INTEGER,
 
662
                .name     = "Hue",
 
663
                .minimum  = 0,
 
664
                .maximum  = 255,
 
665
                .step     =   1,
 
666
                .default_value = SAA_0D_DEFAULT + 128,
 
667
                .flags    = 0,
 
668
                .reserved = {0, 0}
 
669
        },
 
670
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
671
        {
 
672
                .id       = V4L2_CID_AUDIO_VOLUME,
 
673
                .type     = V4L2_CTRL_TYPE_INTEGER,
 
674
                .name     = "Volume",
 
675
                .minimum  = 0,
 
676
                .maximum  = 31,
 
677
                .step     =   1,
 
678
                .default_value = 16,
 
679
                .flags    = 0,
 
680
                .reserved = {0, 0}
 
681
        },
 
682
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
683
        {
 
684
                .id       = V4L2_CID_AUDIO_MUTE,
 
685
                .type     = V4L2_CTRL_TYPE_BOOLEAN,
 
686
                .name     = "Mute",
 
687
                .default_value = true,
 
688
                .flags    = 0,
 
689
                .reserved = {0, 0}
 
690
        },
 
691
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
 
692
        {
 
693
                .id = 0xFFFFFFFF
 
694
        }
680
695
};
681
696
/*****************************************************************************/