| Updated: October 28, 2024 |
Definitions and functions associated with a pixel buffer
#include <adas/adas_defs.h>
struct adas_pixel_buffer {
adas_pixel_buffer_type_internal_t type;
uint64_t timestamp;
adas_error_t (*clone)
(adas_pixel_buffer_handle_t pixel_buffer_handle, adas_pixel_buffer_handle_t *return_handle);
adas_error_t (*convert)
(adas_pixel_buffer_handle_t pixel_buffer_handle, adas_dimensions_t *dimensions,
adas_pixel_format_t format, adas_pixel_buffer_handle_t *return_handle);
adas_error_t (*get_format)
(adas_pixel_buffer_handle_t pixel_buffer_handle, adas_pixel_format_t *format);
adas_error_t (*get_dimensions)
(adas_pixel_buffer_handle_t pixel_buffer_handle, adas_dimensions_t *dimensions);
adas_error_t (*get_pointer)
(adas_pixel_buffer_handle_t pixel_buffer_handle, void **ptr);
adas_error_t (*get_physical_offset)
(adas_pixel_buffer_handle_t pixel_buffer_handle, uint64_t *offset, bool *contiguous);
adas_error_t (*get_screen_buffer)
(adas_pixel_buffer_handle_t pixel_buffer_handle, screen_buffer_t *screen_buffer);
adas_error_t (*get_nb_planes)
(adas_pixel_buffer_handle_t pixel_buffer_handle, size_t *nb_planes);
adas_error_t (*get_strides)
(adas_pixel_buffer_handle_t pixel_buffer_handle, size_t *strides);
adas_error_t (*get_offsets)
(adas_pixel_buffer_handle_t pixel_buffer_handle, size_t *offsets);
adas_error_t (*get_native_handle)
(adas_pixel_buffer_handle_t pixel_buffer_handle, void **native_handle);
adas_error_t (*destroy)
(adas_pixel_buffer_handle_t pixel_buffer_handle);
} ;
Note that this may not be supported by all types of pixel buffers.
This is typically a number between 1 to 3 and is dependent on the format of the buffer (i.e. packed formats have 1 plane, semi-planar have 2 planes while planar have 3 planes).
It is an array of stride, one entry for each plane. The stride is the number of bytes that separates one line of an image to the next.
It is an array of offsets, one entry for each plane. The planar offset is the number of bytes that separates one plane from the next.
The type of handle returned depends on the type of pixel buffer.
Once all references on a pixel buffer have called this function, the pixel buffer will be freed.