adas_pixel_buffer

Updated: May 06, 2022

Definitions and functions associated with a pixel buffer

Synopsis:

#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);
} ;

Data:

adas_pixel_buffer_type_internal_t type
The type of pixel buffer.
uint64_t timestamp
The timestamp associated with the pixel buffer.
adas_error_t (*clone)(adas_pixel_buffer_handle_t pixel_buffer_handle, adas_pixel_buffer_handle_t *return_handle)
Creates a new reference to this pixel buffer through 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)
For internal use only; do not use.
adas_error_t (*get_format)(adas_pixel_buffer_handle_t pixel_buffer_handle, adas_pixel_format_t *format)
Retrieves the format of this pixel buffer.
adas_error_t (*get_dimensions)(adas_pixel_buffer_handle_t pixel_buffer_handle, adas_dimensions_t *dimensions)
Retrieves the dimensions of this pixel buffer.
adas_error_t (*get_pointer)(adas_pixel_buffer_handle_t pixel_buffer_handle, void **ptr)
Retrieves a pointer to the data associated with this pixel buffer.
adas_error_t (*get_physical_offset)(adas_pixel_buffer_handle_t pixel_buffer_handle, uint64_t *offset, bool *contiguous)
Retrieves the physical address (offset) to the data associated with this pixel buffer and indicates if the memory of the buffer is physically contiguous.
adas_error_t (*get_screen_buffer)(adas_pixel_buffer_handle_t pixel_buffer_handle, screen_buffer_t *screen_buffer)
Retrieves a pointer to the screen_buffer_t handle associated with this pixel buffer.

Note that this may not be supported by all types of pixel buffers.

adas_error_t (*get_nb_planes)(adas_pixel_buffer_handle_t pixel_buffer_handle, size_t *nb_planes)
Retrieves the number of planes associated with this pixel buffer.

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).

adas_error_t (*get_strides)(adas_pixel_buffer_handle_t pixel_buffer_handle, size_t *strides)
Retrieves the strides associated with this pixel buffer.

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.

adas_error_t (*get_offsets)(adas_pixel_buffer_handle_t pixel_buffer_handle, size_t *offsets)
Retrieves the planar offsets associated with this pixel buffer.

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.

adas_error_t (*get_native_handle)(adas_pixel_buffer_handle_t pixel_buffer_handle, void **native_handle)
Retrieves the native handle associated with the pixel buffer.

The type of handle returned depends on the type of pixel buffer.

adas_error_t (*destroy)(adas_pixel_buffer_handle_t pixel_buffer_handle)
Indicates that you no longer need to use this pixel buffer.

Once all references on a pixel buffer have called this function, the pixel buffer will be freed.

Library:

libadas