libtransistor
A userland library for the Nintendo Switch
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
graphic_buffer_queue.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include<libtransistor/types.h>
17 
24 typedef struct {
26 } igbp_t;
27 
34 typedef enum {
35  RGBA_8888 = 0x1,
36  RGBX_8888 = 0x2,
37  RGB_888 = 0x3,
39 
46 typedef enum {
47  API,
48  ALL_LOCAL
50 
57 typedef struct {
58  int64_t deadline_ns;
59  int64_t internal_ns;
60  int64_t present_latency_ns;
62 
69 typedef struct {
70  compositor_timing_t compositor_timing;
72 
73 typedef enum {
74  UNKNOWN = 0x0
75 } dataspace_t;
76 
83 typedef struct {
84  uint32_t size;
85  uint32_t num_fds;
86  int64_t timestamp;
87  int32_t is_auto_timestamp;
88  rect_t crop;
89  int32_t scaling_mode;
90  uint32_t transform;
91  uint32_t sticky_transform;
92  uint32_t unknown[2];
93  fence_t fence;
95 
102 typedef struct {
103  uint32_t width;
104  uint32_t height;
105  uint32_t transform_hint;
106  uint32_t num_pending_buffers;
107  uint64_t next_frame_number;
108  bool buffer_replaced;
109  frame_event_history_delta_t frame_timestamps;
111 
112 
123 result_t igbp_request_buffer(igbp_t *igbp, uint32_t slot, uint32_t *status, graphic_buffer_t *gb);
124 
141 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);
142 
154 result_t igbp_queue_buffer(igbp_t *igbp, int slot, queue_buffer_input_t *qbi, queue_buffer_output_t *qbo, int *status);
155 
165 result_t igbp_cancel_buffer(igbp_t *igbp, int slot, fence_t *fence);
166 
177 result_t igbp_query(igbp_t *igbp, int what, int *status, int *value);
178 
190 result_t igbp_connect(igbp_t *igbp, int api, bool producer_controlled_by_app, int *status, queue_buffer_output_t *qbo);
191 
202 result_t igbp_disconnect(igbp_t *igbp, int api, disconnect_mode_t mode, int *status);
203 
214 
215 #ifdef __cplusplus
216 }
217 #endif
RGB channels normal, X always 255 (Alpha is ignored)
Definition: graphic_buffer_queue.h:36
Various system types.
Represents conditions for the completion of an asynchronous graphics operation.
Definition: fence.h:18
result_t igbp_query(igbp_t *igbp, int what, int *status, int *value)
Query values on the IGraphicBufferProducer.
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.
IGraphicBufferProducer object.
Definition: graphic_buffer_queue.h:24
disconnect_mode_t
Disconnection mode.
Definition: graphic_buffer_queue.h:46
Data structures and functions for interacting with the Android Binder IPC interface used in vi servic...
Graphics buffer.
Definition: graphic_buffer.h:19
uint32_t result_t
Function result.
Definition: types.h:51
Rectangle.
Values received back from queueBuffer.
Definition: graphic_buffer_queue.h:102
Parameters passed to queueBuffer.
void __attribute__((__noreturn__)) svcExitProcess()
Exit the process.
ToDo: maybe someday actually implement this.
Definition: graphic_buffer_queue.h:69
Description here...
Definition: graphic_buffer_queue.h:57
Represents a remote interface.
Definition: binder.h:19
Graphics buffer data structures.
result_t igbp_request_buffer(igbp_t *igbp, uint32_t slot, uint32_t *status, graphic_buffer_t *gb)
Request a buffer from the IGraphicBufferProducer.
pixel_format_t
Various pixel formats.
Definition: graphic_buffer_queue.h:34
Only RGB channels, no alpha.
Definition: graphic_buffer_queue.h:37
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.
Fence data structures.
Full RGBA channels.
Definition: graphic_buffer_queue.h:35
result_t igbp_cancel_buffer(igbp_t *igbp, int slot, fence_t *fence)
Cancel a buffer on the IGraphicBufferProducer.
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.
A simple rectangle.
Definition: rect.h:18
binder_t igbp_binder
IGraphicBufferProducer.
Definition: graphic_buffer_queue.h:25
result_t igbp_set_preallocated_buffer(igbp_t *igbp, int slot, graphic_buffer_t *gb)
Set a pre-allocated buffer on the IGraphicBufferProducer.
result_t igbp_disconnect(igbp_t *igbp, int api, disconnect_mode_t mode, int *status)
Disconnect from the IGraphicBufferProducer.