File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
samples/drivers/video/capture/src Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,6 @@ static inline void video_display_frame(const struct device *const display_dev,
91
91
92
92
int main (void )
93
93
{
94
- struct video_buffer * buffers [CONFIG_VIDEO_BUFFER_POOL_NUM_MAX ];
95
94
struct video_buffer * vbuf = & (struct video_buffer ){};
96
95
const struct device * video_dev ;
97
96
struct video_format fmt ;
@@ -285,19 +284,19 @@ int main(void)
285
284
}
286
285
287
286
/* Alloc video buffers and enqueue for capture */
288
- for (i = 0 ; i < ARRAY_SIZE ( buffers ) ; i ++ ) {
287
+ for (i = 0 ; i < CONFIG_VIDEO_BUFFER_POOL_NUM_MAX ; i ++ ) {
289
288
/*
290
289
* For some hardwares, such as the PxP used on i.MX RT1170 to do image rotation,
291
290
* buffer alignment is needed in order to achieve the best performance
292
291
*/
293
- buffers [ i ] = video_buffer_aligned_alloc (bsize , CONFIG_VIDEO_BUFFER_POOL_ALIGN ,
292
+ vbuf = video_buffer_aligned_alloc (bsize , CONFIG_VIDEO_BUFFER_POOL_ALIGN ,
294
293
K_FOREVER );
295
- if (buffers [ i ] == NULL ) {
294
+ if (vbuf == NULL ) {
296
295
LOG_ERR ("Unable to alloc video buffer" );
297
296
return 0 ;
298
297
}
299
- buffers [ i ] -> type = type ;
300
- video_enqueue (video_dev , buffers [ i ] );
298
+ vbuf -> type = type ;
299
+ video_enqueue (video_dev , vbuf );
301
300
}
302
301
303
302
/* Start video capture */
You can’t perform that action at this time.
0 commit comments