Skip to content

Commit acea295

Browse files
committed
samples: drivers: video: capture: set video buffer types later
Set the video buffer types inside the main loop after the buffers are dequeued from the video device rather than at the top of the loop. Signed-off-by: Josuah Demangeon <me@josuah.net>
1 parent 450e584 commit acea295

File tree

1 file changed

+2
-1
lines changed
  • samples/drivers/video/capture/src

1 file changed

+2
-1
lines changed

samples/drivers/video/capture/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,15 @@ int main(void)
254254
LOG_INF("Capture started");
255255

256256
/* Grab video frames */
257-
vbuf->type = type;
258257
while (1) {
259258
err = video_dequeue(video_dev, &vbuf, K_FOREVER);
260259
if (err) {
261260
LOG_ERR("Unable to dequeue video buf");
262261
return 0;
263262
}
264263

264+
vbuf->type = type;
265+
265266
LOG_DBG("Got frame %u! size: %u; timestamp %u ms", frame++, vbuf->bytesused,
266267
vbuf->timestamp);
267268

0 commit comments

Comments
 (0)