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