~ubuntu-branches/ubuntu/trusty/v4l-utils/trusty

« back to all changes in this revision

Viewing changes to utils/v4l2-ctl/v4l2-ctl.h

  • Committer: Package Import Robot
  • Author(s): Gregor Jasny
  • Date: 2012-10-09 18:38:05 UTC
  • mfrom: (11.1.15 sid)
  • Revision ID: package-import@ubuntu.com-20121009183805-v1m5kb2a1i97rw9y
* Imported Upstream version 0.8.9
  - libv4lconvert: Various Pixart JPEG fixes
  - libv4lconvert: Add more notebooks to the upside down device table
  - keytable: Add support for Sanyo IR and RC-5-SZ protocol
  - keytable: Add missing buttons in shipped keytables (LP: #1054122)
  - v4l2-compliance, v4l-ctl, qv4l2: Sync with development branch
* Drop 32bit cross compiled libraries

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _V4L2_CTL_H
 
2
#define _V4L2_CTL_H
 
3
 
 
4
/* Available options.
 
5
 
 
6
   Please keep the first part (options < 128) in alphabetical order.
 
7
   That makes it easier to see which short options are still free.
 
8
 
 
9
   In general the lower case is used to set something and the upper
 
10
   case is used to retrieve a setting. */
 
11
enum Option {
 
12
        OptGetSlicedVbiFormat = 'B',
 
13
        OptSetSlicedVbiFormat = 'b',
 
14
        OptGetCtrl = 'C',
 
15
        OptSetCtrl = 'c',
 
16
        OptSetDevice = 'd',
 
17
        OptGetDriverInfo = 'D',
 
18
        OptGetFreq = 'F',
 
19
        OptSetFreq = 'f',
 
20
        OptHelp = 'h',
 
21
        OptGetInput = 'I',
 
22
        OptSetInput = 'i',
 
23
        OptListCtrls = 'l',
 
24
        OptListCtrlsMenus = 'L',
 
25
        OptListOutputs = 'N',
 
26
        OptListInputs = 'n',
 
27
        OptGetOutput = 'O',
 
28
        OptSetOutput = 'o',
 
29
        OptGetParm = 'P',
 
30
        OptSetParm = 'p',
 
31
        OptGetStandard = 'S',
 
32
        OptSetStandard = 's',
 
33
        OptGetTuner = 'T',
 
34
        OptSetTuner = 't',
 
35
        OptGetVideoFormat = 'V',
 
36
        OptSetVideoFormat = 'v',
 
37
        OptUseWrapper = 'w',
 
38
 
 
39
        OptGetVideoMplaneFormat = 128,
 
40
        OptSetVideoMplaneFormat,
 
41
        OptGetSlicedVbiOutFormat,
 
42
        OptGetOverlayFormat,
 
43
        OptGetOutputOverlayFormat,
 
44
        OptGetVbiFormat,
 
45
        OptGetVbiOutFormat,
 
46
        OptGetVideoOutFormat,
 
47
        OptGetVideoOutMplaneFormat,
 
48
        OptSetSlicedVbiOutFormat,
 
49
        OptSetOutputOverlayFormat,
 
50
        OptSetOverlayFormat,
 
51
        //OptSetVbiFormat, TODO
 
52
        //OptSetVbiOutFormat, TODO
 
53
        OptSetVideoOutFormat,
 
54
        OptSetVideoOutMplaneFormat,
 
55
        OptTryVideoOutFormat,
 
56
        OptTryVideoOutMplaneFormat,
 
57
        OptTrySlicedVbiOutFormat,
 
58
        OptTrySlicedVbiFormat,
 
59
        OptTryVideoFormat,
 
60
        OptTryVideoMplaneFormat,
 
61
        OptTryOutputOverlayFormat,
 
62
        OptTryOverlayFormat,
 
63
        //OptTryVbiFormat, TODO
 
64
        //OptTryVbiOutFormat, TODO
 
65
        OptAll,
 
66
        OptListStandards,
 
67
        OptListFormats,
 
68
        OptListMplaneFormats,
 
69
        OptListFormatsExt,
 
70
        OptListMplaneFormatsExt,
 
71
        OptListFrameSizes,
 
72
        OptListFrameIntervals,
 
73
        OptListOverlayFormats,
 
74
        OptListOutFormats,
 
75
        OptListOutMplaneFormats,
 
76
        OptLogStatus,
 
77
        OptVerbose,
 
78
        OptSilent,
 
79
        OptGetSlicedVbiCap,
 
80
        OptGetSlicedVbiOutCap,
 
81
        OptGetFBuf,
 
82
        OptSetFBuf,
 
83
        OptGetCrop,
 
84
        OptSetCrop,
 
85
        OptGetOutputCrop,
 
86
        OptSetOutputCrop,
 
87
        OptGetOverlayCrop,
 
88
        OptSetOverlayCrop,
 
89
        OptGetOutputOverlayCrop,
 
90
        OptSetOutputOverlayCrop,
 
91
        OptGetSelection,
 
92
        OptSetSelection,
 
93
        OptGetOutputSelection,
 
94
        OptSetOutputSelection,
 
95
        OptGetAudioInput,
 
96
        OptSetAudioInput,
 
97
        OptGetAudioOutput,
 
98
        OptSetAudioOutput,
 
99
        OptListAudioOutputs,
 
100
        OptListAudioInputs,
 
101
        OptGetCropCap,
 
102
        OptGetOutputCropCap,
 
103
        OptGetOverlayCropCap,
 
104
        OptGetOutputOverlayCropCap,
 
105
        OptOverlay,
 
106
        OptSleep,
 
107
        OptGetJpegComp,
 
108
        OptSetJpegComp,
 
109
        OptGetModulator,
 
110
        OptSetModulator,
 
111
        OptListFreqBands,
 
112
        OptListDevices,
 
113
        OptGetOutputParm,
 
114
        OptSetOutputParm,
 
115
        OptQueryStandard,
 
116
        OptPollForEvent,
 
117
        OptWaitForEvent,
 
118
        OptGetPriority,
 
119
        OptSetPriority,
 
120
        OptListDvPresets,
 
121
        OptSetDvPreset,
 
122
        OptGetDvPreset,
 
123
        OptQueryDvPreset,
 
124
        OptListDvTimings,
 
125
        OptQueryDvTimings,
 
126
        OptGetDvTimings,
 
127
        OptSetDvBtTimings,
 
128
        OptGetDvTimingsCap,
 
129
        OptFreqSeek,
 
130
        OptEncoderCmd,
 
131
        OptTryEncoderCmd,
 
132
        OptDecoderCmd,
 
133
        OptTryDecoderCmd,
 
134
        OptTunerIndex,
 
135
        OptListBuffers,
 
136
        OptListBuffersOut,
 
137
        OptListBuffersVbi,
 
138
        OptListBuffersSlicedVbi,
 
139
        OptListBuffersVbiOut,
 
140
        OptListBuffersSlicedVbiOut,
 
141
        OptStreamCount,
 
142
        OptStreamSkip,
 
143
        OptStreamPoll,
 
144
        OptStreamTo,
 
145
        OptStreamMmap,
 
146
        OptStreamUser,
 
147
        OptStreamFrom,
 
148
        OptStreamPattern,
 
149
        OptStreamOutMmap,
 
150
        OptStreamOutUser,
 
151
        OptHelpTuner,
 
152
        OptHelpIO,
 
153
        OptHelpStds,
 
154
        OptHelpVidCap,
 
155
        OptHelpVidOut,
 
156
        OptHelpOverlay,
 
157
        OptHelpVbi,
 
158
        OptHelpSelection,
 
159
        OptHelpMisc,
 
160
        OptHelpStreaming,
 
161
        OptHelpAll,
 
162
        OptLast = 256
 
163
};
 
164
 
 
165
extern char options[OptLast];
 
166
extern unsigned capabilities;
 
167
extern int verbose;
 
168
 
 
169
typedef struct {
 
170
        unsigned flag;
 
171
        const char *str;
 
172
} flag_def;
 
173
 
 
174
/* fmts specified */
 
175
#define FmtWidth                (1L<<0)
 
176
#define FmtHeight               (1L<<1)
 
177
#define FmtChromaKey            (1L<<2)
 
178
#define FmtGlobalAlpha          (1L<<3)
 
179
#define FmtPixelFormat          (1L<<4)
 
180
#define FmtLeft                 (1L<<5)
 
181
#define FmtTop                  (1L<<6)
 
182
#define FmtField                (1L<<7)
 
183
 
 
184
// v4l2-ctl.cpp
 
185
int doioctl_name(int fd, unsigned long int request, void *parm, const char *name);
 
186
int test_ioctl(int fd, int cmd, void *arg);
 
187
std::string flags2s(unsigned val, const flag_def *def);
 
188
int parse_subopt(char **subs, const char * const *subopts, char **value);
 
189
std::string std2s(v4l2_std_id std);
 
190
std::string buftype2s(int type);
 
191
std::string fcc2s(unsigned int val);
 
192
std::string fmtdesc2s(unsigned flags);
 
193
std::string colorspace2s(int val);
 
194
std::string service2s(unsigned service);
 
195
std::string field2s(int val);
 
196
void print_v4lstd(v4l2_std_id std);
 
197
int parse_fmt(char *optarg, __u32 &width, __u32 &height, __u32 &pixelformat);
 
198
__u32 find_pixel_format(int fd, unsigned index, bool mplane);
 
199
void printfmt(const struct v4l2_format &vfmt);
 
200
void print_video_formats(int fd, enum v4l2_buf_type type);
 
201
 
 
202
#define doioctl(n, r, p) doioctl_name(n, r, p, #r)
 
203
 
 
204
// v4l2-ctl-common.cpp
 
205
void common_usage(void);
 
206
void common_cmd(int ch, char *optarg);
 
207
void common_set(int fd);
 
208
void common_get(int fd);
 
209
void common_list(int fd);
 
210
void common_process_controls(int fd);
 
211
void common_control_event(const struct v4l2_event *ev);
 
212
int common_find_ctrl_id(const char *name);
 
213
 
 
214
// v4l2-ctl-tuner.cpp
 
215
void tuner_usage(void);
 
216
void tuner_cmd(int ch, char *optarg);
 
217
void tuner_set(int fd);
 
218
void tuner_get(int fd);
 
219
 
 
220
// v4l2-ctl-io.cpp
 
221
void io_usage(void);
 
222
void io_cmd(int ch, char *optarg);
 
223
void io_set(int fd);
 
224
void io_get(int fd);
 
225
void io_list(int fd);
 
226
 
 
227
// v4l2-ctl-stds.cpp
 
228
void stds_usage(void);
 
229
void stds_cmd(int ch, char *optarg);
 
230
void stds_set(int fd);
 
231
void stds_get(int fd);
 
232
void stds_list(int fd);
 
233
 
 
234
// v4l2-ctl-vidcap.cpp
 
235
void vidcap_usage(void);
 
236
void vidcap_cmd(int ch, char *optarg);
 
237
void vidcap_set(int fd);
 
238
void vidcap_get(int fd);
 
239
void vidcap_list(int fd);
 
240
 
 
241
// v4l2-ctl-vidout.cpp
 
242
void vidout_usage(void);
 
243
void vidout_cmd(int ch, char *optarg);
 
244
void vidout_set(int fd);
 
245
void vidout_get(int fd);
 
246
void vidout_list(int fd);
 
247
 
 
248
// v4l2-ctl-overlay.cpp
 
249
void overlay_usage(void);
 
250
void overlay_cmd(int ch, char *optarg);
 
251
void overlay_set(int fd);
 
252
void overlay_get(int fd);
 
253
void overlay_list(int fd);
 
254
 
 
255
// v4l2-ctl-vbi.cpp
 
256
void vbi_usage(void);
 
257
void vbi_cmd(int ch, char *optarg);
 
258
void vbi_set(int fd);
 
259
void vbi_get(int fd);
 
260
void vbi_list(int fd);
 
261
 
 
262
// v4l2-ctl-selection.cpp
 
263
void selection_usage(void);
 
264
void selection_cmd(int ch, char *optarg);
 
265
void selection_set(int fd);
 
266
void selection_get(int fd);
 
267
 
 
268
// v4l2-ctl-misc.cpp
 
269
void misc_usage(void);
 
270
void misc_cmd(int ch, char *optarg);
 
271
void misc_set(int fd);
 
272
void misc_get(int fd);
 
273
 
 
274
// v4l2-ctl-streaming.cpp
 
275
void streaming_usage(void);
 
276
void streaming_cmd(int ch, char *optarg);
 
277
void streaming_set(int fd);
 
278
void streaming_list(int fd);
 
279
 
 
280
#endif