Browse Source

drivers: video: fix order of fields to allow use with FIFOs

The struct video_buffer are currently used with `struct k_fifo`, which
require them to preserve the first word of data for use by the kernel.
Move the first fields to make it possible to keep using video buffers in
FIFO safely.

Fixes #92526

Signed-off-by: Josuah Demangeon <me@josuah.net>
pull/92567/head
Josuah Demangeon 6 days ago committed by Daniel DeGrasse
parent
commit
645f3d38e1
  1. 5
      include/zephyr/drivers/video.h

5
include/zephyr/drivers/video.h

@ -144,10 +144,11 @@ struct video_caps {
* Represent a video frame. * Represent a video frame.
*/ */
struct video_buffer { struct video_buffer {
/** Pointer to driver specific data. */
/* It must be kept as first field of the struct if used for @ref k_fifo APIs. */
void *driver_data;
/** type of the buffer */ /** type of the buffer */
enum video_buf_type type; enum video_buf_type type;
/** pointer to driver specific data. */
void *driver_data;
/** pointer to the start of the buffer. */ /** pointer to the start of the buffer. */
uint8_t *buffer; uint8_t *buffer;
/** index of the buffer, optionally set by the application */ /** index of the buffer, optionally set by the application */

Loading…
Cancel
Save