screen_dequeue_stream_render_buffer()

Updated: April 19, 2023

Acquire the next available render buffer

Synopsis:

#include <screen/screen.h>
int screen_dequeue_stream_render_buffer(screen_buffer_t *pbuf,
                                        screen_stream_t stream,
                                        int flags)

Arguments:

pbuf
A pointer to an address where the function can store a handle to the render buffer.
stream
The handle of a stream from which a render buffer needs to be acquired.
flags
The indication of how you want this function to behave. This integer is a bitmask that represents the combination of Screen flushing types:
  • SCREEN_DONT_BLOCK: When you use SCREEN_DONT_BLOCK, this function returns immediately regardless of whether a render buffer is currently available. If there are no buffers available, the function returns with an EWOULDBLOCK error.

Library:

libscreen

Description:

Function Type: Immediate Execution

This function should be used instead of SCREEN_PROPERTY_RENDER_BUFFERS when screen_post_stream() is called with the SCREEN_DONT_BLOCK flag. SCREEN_PROPERTY_RENDER_BUFFERS is not updated when screen_post_stream() is called with the SCREEN_DONT_BLOCK flag. This function takes a buffer from the render buffers. The buffer will not be available as a render buffer again until the buffer producer calls screen_post_stream() for the buffer and all consumers call screen_release_buffer().

Returns:

0 if successful, or -1 if an error occurred (errno is set; refer to errno.h for more details).