libgpac
Documentation of the core library of GPAC
video.c File Reference
#include "sdl_out.h"
#include <locale.h>
#include <gpac/media_tools.h>
#include <gpac/list.h>
+ Include dependency graph for video.c:

Data Structures

struct  SDLKeyToGPAC
 

Macros

#define SDLVID()   SDLVidCtx *ctx = (SDLVidCtx *)dr->opaque
 
#define SDLK_KP_0   SDLK_KP0
 
#define SDLK_KP_1   SDLK_KP1
 
#define SDLK_KP_2   SDLK_KP2
 
#define SDLK_KP_3   SDLK_KP3
 
#define SDLK_KP_4   SDLK_KP4
 
#define SDLK_KP_5   SDLK_KP5
 
#define SDLK_KP_6   SDLK_KP6
 
#define SDLK_KP_7   SDLK_KP7
 
#define SDLK_KP_8   SDLK_KP8
 
#define SDLK_KP_9   SDLK_KP9
 
#define SDLK_NUMLOCKCLEAR   SDLK_NUMLOCK
 
#define SDLK_SCROLLLOCK   SDLK_SCROLLOCK
 
#define SDLK_APPLICATION   SDLK_COMPOSE
 
#define SDLK_PRINTSCREEN   SDLK_PRINT
 
#define SDL_WINDOW_RESIZABLE   SDL_RESIZABLE
 
#define SDL_WINDOW_FLAGS   SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_RESIZABLE
 
#define SDL_FULLSCREEN_FLAGS   SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_FULLSCREEN
 
#define SDL_GL_WINDOW_FLAGS   SDL_HWSURFACE | SDL_OPENGL | SDL_HWACCEL | SDL_RESIZABLE
 
#define SDL_GL_FULLSCREEN_FLAGS   SDL_HWSURFACE | SDL_OPENGL | SDL_HWACCEL | SDL_FULLSCREEN
 

Functions

void SDLVid_SetCaption ()
 
SDL_Cursor * SDLVid_LoadCursor (char *maskdata)
 
static void sdl_translate_key (u32 SDLkey, GF_EventKey *evt)
 
static void SDLVid_DestroyObjects (SDLVidCtx *ctx)
 
void SDLVid_SetIcon (SDLVidCtx *ctx)
 
GF_Err SDLVid_ResizeWindow (GF_VideoOutput *dr, u32 width, u32 height)
 
static void SDLVid_SetCursor (GF_VideoOutput *dr, u32 cursor_type)
 
static Bool SDLVid_InitializeWindow (SDLVidCtx *ctx, GF_VideoOutput *dr)
 
static void SDLVid_ResetWindow (SDLVidCtx *ctx)
 
static void SDLVid_ShutdownWindow (SDLVidCtx *ctx)
 
Bool SDLVid_ProcessMessageQueue (SDLVidCtx *ctx, GF_VideoOutput *dr)
 
GF_Err SDLVid_Setup (struct _video_out *dr, void *os_handle, void *os_display, u32 init_flags)
 
static void SDLVid_Shutdown (GF_VideoOutput *dr)
 
GF_Err SDLVid_SetFullScreen (GF_VideoOutput *dr, Bool bFullScreenOn, u32 *screen_width, u32 *screen_height)
 
GF_Err SDLVid_SetBackbufferSize (GF_VideoOutput *dr, u32 newWidth, u32 newHeight, Bool system_mem)
 
u32 SDLVid_MapPixelFormat (SDL_PixelFormat *format, Bool force_alpha)
 
static GF_Err SDLVid_LockBackBuffer (GF_VideoOutput *dr, GF_VideoSurface *video_info, Bool do_lock)
 
static GF_Err SDLVid_Flush (GF_VideoOutput *dr, GF_Window *dest)
 
static GF_Err SDLVid_ProcessEvent (GF_VideoOutput *dr, GF_Event *evt)
 
static GF_Err SDL_Blit (GF_VideoOutput *dr, GF_VideoSurface *video_src, GF_Window *src_wnd, GF_Window *dst_wnd, u32 overlay_type)
 
void * SDL_NewVideo ()
 
void SDL_DeleteVideo (void *ifce)
 

Variables

static char hand_data []
 
static char collide_data []
 
static u32 video_modes []
 
static const u32 nb_video_modes = 8
 
static SDLKeyToGPAC SDLKeys []
 
static u32 num_sdl_keys = sizeof(SDLKeys) / sizeof(SDLKeyToGPAC)
 
static GF_List * video_outputs = NULL
 
static u32 nb_video_outputs =0
 
static GF_GPACArg SDLArgs []
 

Data Structure Documentation

◆ SDLKeyToGPAC

struct SDLKeyToGPAC
Data Fields
u32 sdl_key
u32 gf_key
u32 gf_flags

Macro Definition Documentation

◆ SDLVID

#define SDLVID ( )    SDLVidCtx *ctx = (SDLVidCtx *)dr->opaque

◆ SDLK_KP_0

#define SDLK_KP_0   SDLK_KP0

◆ SDLK_KP_1

#define SDLK_KP_1   SDLK_KP1

◆ SDLK_KP_2

#define SDLK_KP_2   SDLK_KP2

◆ SDLK_KP_3

#define SDLK_KP_3   SDLK_KP3

◆ SDLK_KP_4

#define SDLK_KP_4   SDLK_KP4

◆ SDLK_KP_5

#define SDLK_KP_5   SDLK_KP5

◆ SDLK_KP_6

#define SDLK_KP_6   SDLK_KP6

◆ SDLK_KP_7

#define SDLK_KP_7   SDLK_KP7

◆ SDLK_KP_8

#define SDLK_KP_8   SDLK_KP8

◆ SDLK_KP_9

#define SDLK_KP_9   SDLK_KP9

◆ SDLK_NUMLOCKCLEAR

#define SDLK_NUMLOCKCLEAR   SDLK_NUMLOCK

◆ SDLK_SCROLLLOCK

#define SDLK_SCROLLLOCK   SDLK_SCROLLOCK

◆ SDLK_APPLICATION

#define SDLK_APPLICATION   SDLK_COMPOSE

◆ SDLK_PRINTSCREEN

#define SDLK_PRINTSCREEN   SDLK_PRINT

◆ SDL_WINDOW_RESIZABLE

#define SDL_WINDOW_RESIZABLE   SDL_RESIZABLE

◆ SDL_WINDOW_FLAGS

#define SDL_WINDOW_FLAGS   SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_RESIZABLE

◆ SDL_FULLSCREEN_FLAGS

#define SDL_FULLSCREEN_FLAGS   SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_FULLSCREEN

◆ SDL_GL_WINDOW_FLAGS

#define SDL_GL_WINDOW_FLAGS   SDL_HWSURFACE | SDL_OPENGL | SDL_HWACCEL | SDL_RESIZABLE

◆ SDL_GL_FULLSCREEN_FLAGS

#define SDL_GL_FULLSCREEN_FLAGS   SDL_HWSURFACE | SDL_OPENGL | SDL_HWACCEL | SDL_FULLSCREEN

Function Documentation

◆ SDLVid_SetCaption()

void SDLVid_SetCaption ( )
+ Here is the caller graph for this function:

◆ SDLVid_LoadCursor()

SDL_Cursor* SDLVid_LoadCursor ( char *  maskdata)
+ Here is the caller graph for this function:

◆ sdl_translate_key()

static void sdl_translate_key ( u32  SDLkey,
GF_EventKey evt 
)
static
+ Here is the caller graph for this function:

◆ SDLVid_DestroyObjects()

static void SDLVid_DestroyObjects ( SDLVidCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_SetIcon()

void SDLVid_SetIcon ( SDLVidCtx ctx)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_ResizeWindow()

GF_Err SDLVid_ResizeWindow ( GF_VideoOutput dr,
u32  width,
u32  height 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_SetCursor()

static void SDLVid_SetCursor ( GF_VideoOutput dr,
u32  cursor_type 
)
static
+ Here is the caller graph for this function:

◆ SDLVid_InitializeWindow()

static Bool SDLVid_InitializeWindow ( SDLVidCtx ctx,
GF_VideoOutput dr 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_ResetWindow()

static void SDLVid_ResetWindow ( SDLVidCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_ShutdownWindow()

static void SDLVid_ShutdownWindow ( SDLVidCtx ctx)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_ProcessMessageQueue()

Bool SDLVid_ProcessMessageQueue ( SDLVidCtx ctx,
GF_VideoOutput dr 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_Setup()

GF_Err SDLVid_Setup ( struct _video_out *  dr,
void *  os_handle,
void *  os_display,
u32  init_flags 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_Shutdown()

static void SDLVid_Shutdown ( GF_VideoOutput dr)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_SetFullScreen()

GF_Err SDLVid_SetFullScreen ( GF_VideoOutput dr,
Bool  bFullScreenOn,
u32 screen_width,
u32 screen_height 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_SetBackbufferSize()

GF_Err SDLVid_SetBackbufferSize ( GF_VideoOutput dr,
u32  newWidth,
u32  newHeight,
Bool  system_mem 
)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_MapPixelFormat()

u32 SDLVid_MapPixelFormat ( SDL_PixelFormat *  format,
Bool  force_alpha 
)
+ Here is the caller graph for this function:

◆ SDLVid_LockBackBuffer()

static GF_Err SDLVid_LockBackBuffer ( GF_VideoOutput dr,
GF_VideoSurface video_info,
Bool  do_lock 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_Flush()

static GF_Err SDLVid_Flush ( GF_VideoOutput dr,
GF_Window dest 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDLVid_ProcessEvent()

static GF_Err SDLVid_ProcessEvent ( GF_VideoOutput dr,
GF_Event evt 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDL_Blit()

static GF_Err SDL_Blit ( GF_VideoOutput dr,
GF_VideoSurface video_src,
GF_Window src_wnd,
GF_Window dst_wnd,
u32  overlay_type 
)
static
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDL_NewVideo()

void* SDL_NewVideo ( )
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SDL_DeleteVideo()

void SDL_DeleteVideo ( void *  ifce)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ hand_data

char hand_data[]
static

◆ collide_data

char collide_data[]
static

◆ video_modes

u32 video_modes[]
static
Initial value:
=
{
320, 200,
320, 240,
400, 300,
600, 400,
800, 600,
1024, 768,
1152, 864,
1280, 1024
}

◆ nb_video_modes

const u32 nb_video_modes = 8
static

◆ SDLKeys

SDLKeyToGPAC SDLKeys[]
static

◆ num_sdl_keys

u32 num_sdl_keys = sizeof(SDLKeys) / sizeof(SDLKeyToGPAC)
static

◆ video_outputs

GF_List* video_outputs = NULL
static

◆ nb_video_outputs

u32 nb_video_outputs =0
static

◆ SDLArgs

GF_GPACArg SDLArgs[]
static
Initial value:
= {
GF_DEF_ARG("vsync", NULL, "enable vertical synchro", "true", NULL, GF_ARG_BOOL, 0),
GF_DEF_ARG("switch-vres", NULL, "enable resolution switching of display", "false", NULL, GF_ARG_BOOL, 0),
GF_DEF_ARG("defer", NULL, "enable defer mode when bliting", "false", NULL, GF_ARG_BOOL, 0),
GF_DEF_ARG("hwvmem", NULL, "specify (2D rendering only) memory type of main video backbuffer. Depending on the scene type, this may drastically change the playback speed\n"
"- always: always on hardware\n"
"- never: always on system memory\n"
"- auto: selected by GPAC based on content type (graphics or video)", "auto", "auto|always|never", GF_ARG_INT, GF_ARG_HINT_EXPERT|GF_ARG_SUBSYS_VIDEO),
{0},
}
#define GF_ARG_SUBSYS_VIDEO
Definition: main.h:138
#define GF_ARG_INT
Definition: main.h:151
#define GF_DEF_ARG(_a, _b, _c, _d, _e, _f, _g)
Definition: main.h:166
#define GF_ARG_HINT_EXPERT
Definition: main.h:123
#define GF_ARG_BOOL
Definition: main.h:149