screen_get_buffer_property_*()

Get the current value of a buffer property

Function type:

Immediate execution

Synopsis:

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

Arguments:

buf
The handle of the buffer whose property is being queried.
pname
The name of the property whose value is requested. The properties that can be queried with these function are:
SCREEN_PROPERTY_BUFFER_SIZE
A pair of integers containing the width and height of the buffer. param must point to a buffer with enough storage for two integers.
SCREEN_PROPERTY_FORMAT
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:
  • SCREEN_FORMAT_BYTE
  • SCREEN_FORMAT_RGBA4444
  • SCREEN_FORMAT_RGBX4444
  • SCREEN_FORMAT_RGBA5551
  • SCREEN_FORMAT_RGBX5551
  • SCREEN_FORMAT_RGB565
  • SCREEN_FORMAT_RGBA8888
  • SCREEN_FORMAT_RGBX8888
  • SCREEN_FORMAT_YVU9
  • SCREEN_FORMAT_YUV420
  • SCREEN_FORMAT_NV12
  • SCREEN_FORMAT_YV12
  • SCREEN_FORMAT_UYVY
  • SCREEN_FORMAT_YUY2
  • SCREEN_FORMAT_YVYU
  • SCREEN_FORMAT_V422
  • SCREEN_FORMAT_AYUV
SCREEN_PROPERTY_INTERLACED
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.
SCREEN_PROPERTY_PHYSICAL_ADDRESS
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.
SCREEN_PROPERTY_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.
SCREEN_PROPERTY_PLANAR_OFFSETS
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.
SCREEN_PROPERTY_POINTER
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.
SCREEN_PROPERTY_PROTECTED
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.
SCREEN_PROPERTY_STRIDE
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.
len
(screen_get_buffer_property_cv() only). The maximum number of bytes that can be written to param.
param
A buffer where the values will be stored.

Library:

screen

Description:

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:

screen_get_buffer_property_cv()
Takes a char value of a given length.
screen_get_buffer_property_iv()
Takes an integer value.
screen_get_buffer_property_llv()
Takes a long long value.
screen_get_buffer_property_pv()
Takes a null pointer.

You can set buffer properties with the screen_set_buffer_property_*() functions.

Returns:

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.

Classification:

Windowing API

Safety  Value  
Interrupt handler No
Signal handler No
Thread Yes