34 #include <EGL/eglext.h>
36 #include <GLES/glext.h>
37 #include "interface/khronos/include/EGL/eglext_brcm.h"
38 #include "interface/mmal/mmal.h"
40 #define RASPITEX_VERSION_MAJOR 1
41 #define RASPITEX_VERSION_MINOR 0
44 RASPITEX_SCENE_SQUARE = 0,
45 RASPITEX_SCENE_MIRROR,
46 RASPITEX_SCENE_TEAPOT,
88 uint8_t **buffer,
size_t *buffer_size);
149 DISPMANX_DISPLAY_HANDLE_T
disp;
150 EGL_DISPMANX_WINDOW_T
win;
185 MMAL_PORT_T *preview_port);
188 const char *arg1,
const char *arg2);
Definition: RaspiTex.h:54
void(* close)(struct RASPITEX_STATE *state)
Called when the scene is unloaded.
Definition: RaspiTex.h:97
int version_minor
For binary compatibility.
Definition: RaspiTex.h:126
void(* destroy_native_window)(struct RASPITEX_STATE *state)
Destroys the native window.
Definition: RaspiTex.h:94
EGLNativeWindowType * native_window
Dispmanx handle for preview surface.
Definition: RaspiTex.h:152
int opacity
height in pixels
Definition: RaspiTex.h:144
int(* update_model)(struct RASPITEX_STATE *state)
Advance to the next animation step.
Definition: RaspiTex.h:80
RASPITEX_SCENE_OPS ops
Id of the scene to load.
Definition: RaspiTex.h:171
EGLSurface surface
The current EGL display.
Definition: RaspiTex.h:154
int raspitex_start(RASPITEX_STATE *state)
Definition: RaspiTex.c:683
int(* gl_init)(struct RASPITEX_STATE *state)
Creates EGL surface for native window.
Definition: RaspiTex.h:61
GLuint u_texture
EGL image for Y plane texture.
Definition: RaspiTex.h:163
uint8_t * buffer
The RGB capture buffer.
Definition: RaspiTex.h:109
EGLImageKHR u_egl_image
The U plane texture.
Definition: RaspiTex.h:164
int32_t height
width in pixels
Definition: RaspiTex.h:143
GLuint v_texture
EGL image for U plane texture.
Definition: RaspiTex.h:165
int raspitex_capture(RASPITEX_STATE *state, FILE *output_file)
Definition: RaspiTex.c:705
int(* update_v_texture)(struct RASPITEX_STATE *state, EGLClientBuffer mm_buf)
Definition: RaspiTex.h:77
int(* update_u_texture)(struct RASPITEX_STATE *state, EGLClientBuffer mm_buf)
Definition: RaspiTex.h:73
int32_t x
preview y-plane height in pixels
Definition: RaspiTex.h:140
GLuint y_texture
The current preview EGL image.
Definition: RaspiTex.h:161
RASPITEX_SCENE_T scene_id
MMAL buffer currently bound to texture(s)
Definition: RaspiTex.h:170
VCOS_SEMAPHORE_T start_sem
Wait for previous capture to complete.
Definition: RaspiTex.h:103
MMAL_QUEUE_T * preview_queue
Pool for storing opaque buffer handles.
Definition: RaspiTex.h:129
int(* update_texture)(struct RASPITEX_STATE *state, EGLClientBuffer mm_buf)
Definition: RaspiTex.h:65
const EGLint * egl_config_attribs
The current EGL context.
Definition: RaspiTex.h:156
VCOS_THREAD_T preview_thread
Queue preview buffers to display in order.
Definition: RaspiTex.h:130
int(* update_y_texture)(struct RASPITEX_STATE *state, EGLClientBuffer mm_buf)
Definition: RaspiTex.h:69
int raspitex_parse_cmdline(RASPITEX_STATE *state, const char *arg1, const char *arg2)
Definition: RaspiTex.c:112
int32_t preview_height
preview y-plane width in pixels
Definition: RaspiTex.h:137
RASPITEX_CAPTURE capture
Log FPS.
Definition: RaspiTex.h:175
size_t size
Size of the captured buffer in bytes.
Definition: RaspiTex.h:112
MMAL_POOL_T * preview_pool
Source port for preview opaque buffers.
Definition: RaspiTex.h:128
MMAL_BUFFER_HEADER_T * preview_buf
EGL image for V plane texture.
Definition: RaspiTex.h:168
int(* capture)(struct RASPITEX_STATE *state, uint8_t **buffer, size_t *buffer_size)
Definition: RaspiTex.h:87
EGLDisplay display
Native window used for EGL surface.
Definition: RaspiTex.h:153
void * scene_state
The interface for the current scene.
Definition: RaspiTex.h:172
MMAL_PORT_T * preview_port
Incremented for new features.
Definition: RaspiTex.h:127
EGLImageKHR y_egl_image
The Y plane texture.
Definition: RaspiTex.h:162
uint32_t preview_stop
Preview worker / GL rendering thread.
Definition: RaspiTex.h:131
VCOS_SEMAPHORE_T completed_sem
Posted once the capture is complete.
Definition: RaspiTex.h:106
int request
Definition: RaspiTex.h:116
int gl_win_defined
Alpha value for display element.
Definition: RaspiTex.h:145
int32_t y
x-offset in pixels
Definition: RaspiTex.h:141
void(* gl_term)(struct RASPITEX_STATE *state)
Creates EGL surface for native window.
Definition: RaspiTex.h:91
int32_t preview_x
If zero the worker can continue.
Definition: RaspiTex.h:134
GLuint texture
GL scenes preferred EGL configuration.
Definition: RaspiTex.h:158
int(* create_native_window)(struct RASPITEX_STATE *state)
Definition: RaspiTex.h:58
int32_t width
y-offset in pixels
Definition: RaspiTex.h:142
EGLImageKHR egl_image
Name for the preview texture.
Definition: RaspiTex.h:159
EGLContext context
The current EGL surface.
Definition: RaspiTex.h:155
int verbose
Pointer to scene specific data.
Definition: RaspiTex.h:173
DISPMANX_DISPLAY_HANDLE_T disp
Use rect from –glwin instead of preview.
Definition: RaspiTex.h:149
Definition: RaspiTex.h:123
int32_t preview_y
x-offset of preview window
Definition: RaspiTex.h:135
Definition: RaspiTex.h:100
int32_t preview_width
y-offset of preview window
Definition: RaspiTex.h:136
EGLImageKHR v_egl_image
The V plane texture.
Definition: RaspiTex.h:166
EGL_DISPMANX_WINDOW_T win
Dispmanx display for GL preview.
Definition: RaspiTex.h:150
int(* redraw)(struct RASPITEX_STATE *state)
Draw the scene - called after update_model.
Definition: RaspiTex.h:83
void raspitex_display_help()
Definition: RaspiTex.c:175