-
Notifications
You must be signed in to change notification settings - Fork 0
/
v4l2-isp-params.c
63 lines (48 loc) · 998 Bytes
/
v4l2-isp-params.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/un.h>
#include <linux/videodev2.h>
#include <cairo.h>
#include <v4l2-params.h>
int main(int argc, char *argv[])
{
struct v4l2_params params = { 0 };
bool enable = !!(argc > 1);
int ret;
ret = v4l2_params_open(¶ms, "sun6i-isp", "sun6i-isp-params");
if (ret)
goto error;
ret = v4l2_params_setup(¶ms);
if (ret)
goto error;
ret = v4l2_params_start(¶ms);
if (ret)
goto error;
ret = v4l2_params_prepare(¶ms, enable);
if (ret)
return ret;
ret = v4l2_params_run(¶ms);
if (ret)
return ret;
ret = v4l2_params_complete(¶ms);
if (ret)
return ret;
ret = v4l2_params_stop(¶ms);
if (ret)
goto error;
ret = v4l2_params_teardown(¶ms);
if (ret)
goto error;
return 0;
error:
return 1;
}