Skip to content

Commit 128ef74

Browse files
author
Alain Volmat
committed
samples: usb: uvc: ensure video buffer is properly aligned
Honor the CONFIG_VIDEO_BUFFER_POOL_ALIGN config by using the video_buffer_aligned_alloc function instead of video_buffer_alloc in order to provide properly aligned buffers to drivers. Signed-off-by: Alain Volmat <[email protected]>
1 parent 0ecc7be commit 128ef74

File tree

1 file changed

+2
-1
lines changed
  • samples/subsys/usb/uvc/src

1 file changed

+2
-1
lines changed

samples/subsys/usb/uvc/src/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ int main(void)
175175
LOG_INF("Preparing %u buffers of %u bytes", CONFIG_VIDEO_BUFFER_POOL_NUM_MAX, fmt.size);
176176

177177
for (int i = 0; i < CONFIG_VIDEO_BUFFER_POOL_NUM_MAX; i++) {
178-
vbuf = video_buffer_alloc(fmt.size, K_NO_WAIT);
178+
vbuf = video_buffer_aligned_alloc(fmt.size, CONFIG_VIDEO_BUFFER_POOL_ALIGN,
179+
K_NO_WAIT);
179180
if (vbuf == NULL) {
180181
LOG_ERR("Could not allocate the video buffer");
181182
return -ENOMEM;

0 commit comments

Comments
 (0)