libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Enumerations | Functions
graphic_buffer_queue.h File Reference

Graphics buffer queues data structures and functions. More...

#include <libtransistor/types.h>
#include <libtransistor/display/binder.h>
#include <libtransistor/display/graphic_buffer.h>
#include <libtransistor/display/fence.h>
#include <libtransistor/display/rect.h>
Include dependency graph for graphic_buffer_queue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  igbp_t
 IGraphicBufferProducer object. More...
 
struct  compositor_timing_t
 Description here... More...
 
struct  frame_event_history_delta_t
 ToDo: maybe someday actually implement this. More...
 
struct  __attribute__
 
struct  queue_buffer_output_t
 Values received back from queueBuffer. More...
 

Enumerations

enum  pixel_format_t { RGBA_8888 = 0x1, RGBX_8888 = 0x2, RGB_888 = 0x3 }
 Various pixel formats. More...
 
enum  disconnect_mode_t { API, ALL_LOCAL }
 Disconnection mode. More...
 
enum  dataspace_t { UNKNOWN = 0x0 }
 

Functions

result_t igbp_request_buffer (igbp_t *igbp, uint32_t slot, uint32_t *status, graphic_buffer_t *gb)
 Request a buffer from the IGraphicBufferProducer. More...
 
result_t igbp_dequeue_buffer (igbp_t *igbp, uint32_t width, uint32_t height, pixel_format_t pixel_format, uint32_t usage, bool get_frame_timestamps, uint32_t *status, uint32_t *slot, fence_t *fence, frame_event_history_delta_t *out_timestamps)
 Dequeue a buffer from the IGraphicBufferProducer. More...
 
result_t igbp_queue_buffer (igbp_t *igbp, int slot, queue_buffer_input_t *qbi, queue_buffer_output_t *qbo, int *status)
 Queue a buffer to the IGraphicBufferProducer. More...
 
result_t igbp_cancel_buffer (igbp_t *igbp, int slot, fence_t *fence)
 Cancel a buffer on the IGraphicBufferProducer. More...
 
result_t igbp_query (igbp_t *igbp, int what, int *status, int *value)
 Query values on the IGraphicBufferProducer. More...
 
result_t igbp_connect (igbp_t *igbp, int api, bool producer_controlled_by_app, int *status, queue_buffer_output_t *qbo)
 Connect to the IGraphicBufferProducer. More...
 
result_t igbp_disconnect (igbp_t *igbp, int api, disconnect_mode_t mode, int *status)
 Disconnect from the IGraphicBufferProducer. More...
 
result_t igbp_set_preallocated_buffer (igbp_t *igbp, int slot, graphic_buffer_t *gb)
 Set a pre-allocated buffer on the IGraphicBufferProducer. More...
 

Detailed Description

Graphics buffer queues data structures and functions.

Enumeration Type Documentation

Various pixel formats.

There are more but these are probably the only ones we're ever going to use

Enumerator
RGBA_8888 

Full RGBA channels.

RGBX_8888 

RGB channels normal, X always 255 (Alpha is ignored)

RGB_888 

Only RGB channels, no alpha.

Function Documentation

result_t igbp_cancel_buffer ( igbp_t igbp,
int  slot,
fence_t fence 
)

Cancel a buffer on the IGraphicBufferProducer.

Parameters
igbpIGraphicBufferProducer to cancel a buffer on
slotSlot of the buffer to cancel
fenceFence that must be waited on before it's ok to overwrite the buffer

https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#cancelbuffer

result_t igbp_connect ( igbp_t igbp,
int  api,
bool  producer_controlled_by_app,
int *  status,
queue_buffer_output_t qbo 
)

Connect to the IGraphicBufferProducer.

Parameters
igbpIGBP to connect to
apiDescription
producer_controlled_by_appDescription
statusDescription
qboDescription

https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#connect

result_t igbp_dequeue_buffer ( igbp_t igbp,
uint32_t  width,
uint32_t  height,
pixel_format_t  pixel_format,
uint32_t  usage,
bool  get_frame_timestamps,
uint32_t *  status,
uint32_t *  slot,
fence_t fence,
frame_event_history_delta_t out_timestamps 
)

Dequeue a buffer from the IGraphicBufferProducer.

Parameters
igbpIGraphicBufferProducer to dequeue buffer from
widthWidth of buffer to dequeue
heightHeight of buffer to dequeue
pixel_formatPixel format of buffer to dequeue
usageUsage flags of buffer to sequeue
get_frame_timestampsWhether or not to get frame timestamps
statusThe returned status from the IGraphicBufferProducer interface
slotThe slot of the buffer that was dequeued
fenceThe fence to wait on before writing to the dequeued buffer
out_timestampsFrame event timestamp history

https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#dequeuebuffer

result_t igbp_disconnect ( igbp_t igbp,
int  api,
disconnect_mode_t  mode,
int *  status 
)

Disconnect from the IGraphicBufferProducer.

Parameters
igbpIGBP to disconnect from
apiDescription
modeDisconnect mode
statusStatus output

https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#disconnect

result_t igbp_query ( igbp_t igbp,
int  what,
int *  status,
int *  value 
)

Query values on the IGraphicBufferProducer.

Parameters
igbpIGBP to query
whatWhich value to query
statusReturned status
valueReturned value

https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#query

result_t igbp_queue_buffer ( igbp_t igbp,
int  slot,
queue_buffer_input_t qbi,
queue_buffer_output_t qbo,
int *  status 
)

Queue a buffer to the IGraphicBufferProducer.

Parameters
igbpIGraphicBufferProducer to queue buffer to
slotSlot of the buffer to queue
qbiInput parameters
qboOutput values
statusStatus returned from IGraphicBufferProducer

https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#queuebuffer

result_t igbp_request_buffer ( igbp_t igbp,
uint32_t  slot,
uint32_t *  status,
graphic_buffer_t gb 
)

Request a buffer from the IGraphicBufferProducer.

Parameters
igbpIGraphicBufferProducer to request buffer from
slotSlot to request buffer from
statusThe returned status from the IGraphicBufferProducer interface
gbThe requested GraphicBuffer

https://source.android.com/reference/hidl/android/hardware/graphics/bufferqueue/1.0/IGraphicBufferProducer#requestbuffer

result_t igbp_set_preallocated_buffer ( igbp_t igbp,
int  slot,
graphic_buffer_t gb 
)

Set a pre-allocated buffer on the IGraphicBufferProducer.

Parameters
igbpIGBP to preallocate a buffer on
slotSlot to preallocate the buffer in
gbPreallocated GraphicBuffer

This one seems to be Nintendo custom.