screen_attach_stream_buffers()

Associate an externally allocated buffer with a stream

Synopsis:

#include <screen/screen.h>
int screen_attach_stream_buffers(screen_stream_t stream,
                                 int count,
                                 screen_buffer_t *buf)

Arguments:

stream
The handle of a stream that doesn't already share a buffer with another stream, and that doesn't have any buffers created or associated with it.
count
The number of buffers to be attached.
buf
An array, allocated by the application, of count buffers to be attached.

Library:

libscreen

Description:

Function Type: Flushing Execution

This function can be used by drivers and other middleware components that must allocate their own buffers. The client must ensure that all usage constraints are met when allocating the buffers. Failure to do so may prevent the buffers from being successfully attached, or may result in artifacts and system instability. You must use either screen_attach_stream_buffers() or screen_create_stream_buffers() to associate streams with buffers, but not both.

Returns:

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