@@ -39,11 +39,11 @@ int main(void)
39
39
struct video_format fmt ;
40
40
struct video_caps caps ;
41
41
enum video_buf_type type = VIDEO_BUF_TYPE_OUTPUT ;
42
- const struct device * video ;
42
+ const struct device * video_dev ;
43
43
44
- video = DEVICE_DT_GET (DT_CHOSEN (zephyr_camera ));
45
- if (!device_is_ready (video )) {
46
- LOG_ERR ("%s: video device not ready." , video -> name );
44
+ video_dev = DEVICE_DT_GET (DT_CHOSEN (zephyr_camera ));
45
+ if (!device_is_ready (video_dev )) {
46
+ LOG_ERR ("%s: video device not ready." , video_dev -> name );
47
47
return 0 ;
48
48
}
49
49
@@ -74,14 +74,14 @@ int main(void)
74
74
75
75
/* Get capabilities */
76
76
caps .type = type ;
77
- if (video_get_caps (video , & caps )) {
77
+ if (video_get_caps (video_dev , & caps )) {
78
78
LOG_ERR ("Unable to retrieve video capabilities" );
79
79
return 0 ;
80
80
}
81
81
82
82
/* Get default/native format */
83
83
fmt .type = type ;
84
- if (video_get_format (video , & fmt )) {
84
+ if (video_get_format (video_dev , & fmt )) {
85
85
LOG_ERR ("Unable to retrieve video format" );
86
86
return 0 ;
87
87
}
@@ -118,11 +118,11 @@ int main(void)
118
118
119
119
/* Enqueue Buffers */
120
120
for (i = 0 ; i < ARRAY_SIZE (buffers ); i ++ ) {
121
- video_enqueue (video , buffers [i ]);
121
+ video_enqueue (video_dev , buffers [i ]);
122
122
}
123
123
124
124
/* Start video capture */
125
- if (video_stream_start (video , type )) {
125
+ if (video_stream_start (video_dev , type )) {
126
126
LOG_ERR ("Unable to start video" );
127
127
return 0 ;
128
128
}
@@ -133,7 +133,7 @@ int main(void)
133
133
i = 0 ;
134
134
vbuf -> type = type ;
135
135
do {
136
- ret = video_dequeue (video , & vbuf , K_FOREVER );
136
+ ret = video_dequeue (video_dev , & vbuf , K_FOREVER );
137
137
if (ret ) {
138
138
LOG_ERR ("Unable to dequeue video buf" );
139
139
return 0 ;
@@ -149,18 +149,18 @@ int main(void)
149
149
close (client );
150
150
}
151
151
152
- (void )video_enqueue (video , vbuf );
152
+ (void )video_enqueue (video_dev , vbuf );
153
153
} while (!ret );
154
154
155
155
/* stop capture */
156
- if (video_stream_stop (video , type )) {
156
+ if (video_stream_stop (video_dev , type )) {
157
157
LOG_ERR ("Unable to stop video" );
158
158
return 0 ;
159
159
}
160
160
161
161
/* Flush remaining buffers */
162
162
do {
163
- ret = video_dequeue (video , & vbuf , K_NO_WAIT );
163
+ ret = video_dequeue (video_dev , & vbuf , K_NO_WAIT );
164
164
} while (!ret );
165
165
166
166
} while (1 );
0 commit comments