#ifndef _GF_SDL_OUT_H_
#define _GF_SDL_OUT_H_
#include <gpac/modules/audio_out.h>
#include <gpac/modules/video_out.h>
#include <gpac/thread.h>
#include <SDL.h>
Bool SDLOUT_InitSDL();
void SDLOUT_CloseSDL();
#ifdef WIN32
#endif
typedef enum {
SDL_STATE_STOPPED = 0,
SDL_STATE_RUNNING,
SDL_STATE_STOP_REQ,
SDL_STATE_WAIT_FOR_THREAD_TERMINATION
} GF_SDL_STATE;
typedef struct
{
#ifdef SDL_WINDOW_THREAD
GF_Thread *sdl_th;
GF_SDL_STATE sdl_th_state;
#endif
GF_Mutex *evt_mx;
Bool is_init, fullscreen;
u32 fs_width, fs_height;
u32 store_width, store_height;
SDL_Cursor *curs_def, *curs_hand, *curs_collide;
Bool use_systems_memory;
#if SDL_VERSION_ATLEAST(2,0,0)
char szCaption[100];
Bool enable_defer_mode;
Bool needs_clear;
Bool needs_bb_flush;
Bool needs_bb_grab;
#if defined(__APPLE__) && !defined(GPAC_IPHONE)
Bool disable_vsync;
#endif
SDL_GLContext gl_context;
SDL_Renderer *renderer;
SDL_Window *screen;
SDL_Texture *tx_back_buffer;
char *back_buffer_pixels;
SDL_Texture *pool_rgb, *pool_rgba, *pool_yuv;
#else
SDL_Surface *screen;
SDL_Surface *back_buffer;
SDL_Surface *pool_rgb, *pool_rgba;
SDL_Overlay *yuv_overlay;
#endif
u32 width, height;
SDL_Surface *offscreen_gl;
u32 output_3d_type;
void *os_handle;
Bool force_alpha, hidden;
u32 last_mouse_move;
Bool cursor_on;
Bool ctrl_down, alt_down, meta_down;
} SDLVidCtx;
void SDL_DeleteVideo(void *ifce);
void *SDL_NewVideo();
typedef struct
{
u32 num_buffers, total_duration, delay_ms, total_size, volume, alloc_size;
Bool is_init, is_running;
Uint8 * audioBuff;
} SDLAudCtx;
void SDL_DeleteAudio(void *ifce);
void *SDL_NewAudio();
#endif