@@ -39,11 +39,11 @@ int main(void)
3939 struct video_format fmt ;
4040 struct video_caps caps ;
4141 enum video_buf_type type = VIDEO_BUF_TYPE_OUTPUT ;
42- const struct device * video ;
42+ const struct device * video_dev ;
4343
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 );
4747 return 0 ;
4848 }
4949
@@ -74,14 +74,14 @@ int main(void)
7474
7575 /* Get capabilities */
7676 caps .type = type ;
77- if (video_get_caps (video , & caps )) {
77+ if (video_get_caps (video_dev , & caps )) {
7878 LOG_ERR ("Unable to retrieve video capabilities" );
7979 return 0 ;
8080 }
8181
8282 /* Get default/native format */
8383 fmt .type = type ;
84- if (video_get_format (video , & fmt )) {
84+ if (video_get_format (video_dev , & fmt )) {
8585 LOG_ERR ("Unable to retrieve video format" );
8686 return 0 ;
8787 }
@@ -118,11 +118,11 @@ int main(void)
118118
119119 /* Enqueue Buffers */
120120 for (i = 0 ; i < ARRAY_SIZE (buffers ); i ++ ) {
121- video_enqueue (video , buffers [i ]);
121+ video_enqueue (video_dev , buffers [i ]);
122122 }
123123
124124 /* Start video capture */
125- if (video_stream_start (video , type )) {
125+ if (video_stream_start (video_dev , type )) {
126126 LOG_ERR ("Unable to start video" );
127127 return 0 ;
128128 }
@@ -133,7 +133,7 @@ int main(void)
133133 i = 0 ;
134134 vbuf -> type = type ;
135135 do {
136- ret = video_dequeue (video , & vbuf , K_FOREVER );
136+ ret = video_dequeue (video_dev , & vbuf , K_FOREVER );
137137 if (ret ) {
138138 LOG_ERR ("Unable to dequeue video buf" );
139139 return 0 ;
@@ -149,18 +149,18 @@ int main(void)
149149 close (client );
150150 }
151151
152- (void )video_enqueue (video , vbuf );
152+ (void )video_enqueue (video_dev , vbuf );
153153 } while (!ret );
154154
155155 /* stop capture */
156- if (video_stream_stop (video , type )) {
156+ if (video_stream_stop (video_dev , type )) {
157157 LOG_ERR ("Unable to stop video" );
158158 return 0 ;
159159 }
160160
161161 /* Flush remaining buffers */
162162 do {
163- ret = video_dequeue (video , & vbuf , K_NO_WAIT );
163+ ret = video_dequeue (video_dev , & vbuf , K_NO_WAIT );
164164 } while (!ret );
165165
166166 } while (1 );
0 commit comments