#include <screen/screen.h> int screen_get_buffer_property_cv( screen_buffer_t buf, int pname, int len, char *param ); int screen_get_buffer_property_iv( screen_buffer_t buf, int pname, int *param ); int screen_get_buffer_property_llv( screen_buffer_t buf, int pname, long long *param ); int screen_get_buffer_property_pv( screen_buffer_t buf, int pname, void **param );
- The handle of the buffer whose property is being queried.
- The name of the property whose value is requested. The properties that can
be queried with these function are:
- A pair of integers containing the width and height of the buffer. param must point to a buffer with enough storage for two integers.
- A single integer that indicates the pixel format of the buffer
associated with this buffer. param must point
to a buffer with enough storage for one integer. The format will
be one of:
- A single integer indicating if the buffer contains interlaced fields instead of progressive data. param must point to a buffer with enough storage for one integer.
- A single long integer that corresponds to the physical address of the buffer. This property is only alid only when the buffer is physically contiguous.
- A single integer indicating whether the buffer is physically contiguous or not. param must point to a buffer with enough storage for one integer.
- Three integers that provide the offset from the base address for each of the Y, U, and V components of planar YUV formats. param must point to a buffer with enough storage for three integers.
- A pointer that can be used by software renderers to read from and/or write to the buffer. param must point to a buffer with enough storage for one void pointer. The buffer must have been realized with a usage containing SCREEN_USAGE_READ and/or SCREEN_USAGE_WRITE for this property to be a valid pointer.
- A single integer that specifies whether the content of the buffer requires protection or not. param must point to a buffer with enough storage for one integer.
- A single integer indicating the number of bytes between the same pixels on adjacent rows. param must point to a buffer with enough storage for one integer.
- (screen_get_buffer_property_cv() only). The maximum number of bytes that can be written to param.
- A buffer where the values will be stored.
These functions store the current value of a buffer property in a user-provided array. No more than len bytes of the specified type will be written. Each property must be queried with the variant corresponding to the type associated with this property. For example, SCREEN_PROPERTY_STRIDE must be queried using the screen_get_buffer_property_iv() function.
The functions and their types are described below:
- Takes a char value of a given length.
- Takes an integer value.
- Takes a long long value.
- Takes a null pointer.
You can set buffer properties with the screen_set_buffer_property_*() functions.
If the function succeeds, it returns 0 and the value(s) of the property are stored in the buffer provided. Otherwise, the function returns -1 and errno is set.