Don't pass video_info by value to context_driver init function

This commit is contained in:
twinaphex 2017-01-22 18:29:22 +01:00
parent f770ea8560
commit 1ea3bea0ee
25 changed files with 26 additions and 26 deletions

View File

@ -64,11 +64,11 @@ bool drm_get_resources(int fd)
return true; return true;
} }
bool drm_get_connector(int fd, video_frame_info_t video_info) bool drm_get_connector(int fd, video_frame_info_t *video_info)
{ {
unsigned i; unsigned i;
unsigned monitor_index = 0; unsigned monitor_index = 0;
unsigned monitor = MAX(video_info.monitor_index, 1); unsigned monitor = MAX(video_info->monitor_index, 1);
/* Enumerate all connectors. */ /* Enumerate all connectors. */

View File

@ -53,7 +53,7 @@ void drm_setup(int fd);
void drm_free(void); void drm_free(void);
bool drm_get_connector(int fd, video_frame_info_t video_info); bool drm_get_connector(int fd, video_frame_info_t *video_info);
static INLINE bool drm_wait_flip(int timeout) static INLINE bool drm_wait_flip(int timeout)
{ {

View File

@ -100,7 +100,7 @@ static void android_gfx_ctx_destroy(void *data)
free(data); free(data);
} }
static void *android_gfx_ctx_init(video_frame_info_t video_info, void *video_driver) static void *android_gfx_ctx_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_OPENGLES #ifdef HAVE_OPENGLES
EGLint n, major, minor; EGLint n, major, minor;

View File

@ -275,7 +275,7 @@ static CGSSurfaceID attach_gl_context_to_window(CGLContextObj glCtx,
return sid; return sid;
} }
static void *gfx_ctx_cgl_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_cgl_init(video_frame_info_t *video_info, void *video_driver)
{ {
CGError err; CGError err;
gfx_ctx_cgl_data_t *cgl = (gfx_ctx_cgl_data_t*)calloc(1, sizeof(gfx_ctx_cgl_data_t)); gfx_ctx_cgl_data_t *cgl = (gfx_ctx_cgl_data_t*)calloc(1, sizeof(gfx_ctx_cgl_data_t));

View File

@ -213,7 +213,7 @@ void cocoagl_gfx_ctx_update(void)
#endif #endif
} }
static void *cocoagl_gfx_ctx_init(video_frame_info_t video_info, void *video_driver) static void *cocoagl_gfx_ctx_init(video_frame_info_t *video_info, void *video_driver)
{ {
(void)video_driver; (void)video_driver;

View File

@ -165,7 +165,7 @@ static bool gfx_ctx_d3d_bind_api(void *data,
#endif #endif
} }
static void *gfx_ctx_d3d_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_d3d_init(video_frame_info_t *video_info, void *video_driver)
{ {
win32_monitor_init(); win32_monitor_init();

View File

@ -330,7 +330,7 @@ static void gfx_ctx_drm_destroy_resources(gfx_ctx_drm_data_t *drm)
g_next_bo = NULL; g_next_bo = NULL;
} }
static void *gfx_ctx_drm_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_drm_init(video_frame_info_t *video_info, void *video_driver)
{ {
int fd, i; int fd, i;
unsigned monitor_index; unsigned monitor_index;

View File

@ -99,7 +99,7 @@ static void gfx_ctx_emscripten_destroy(void *data)
free(data); free(data);
} }
static void *gfx_ctx_emscripten_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_emscripten_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
unsigned width, height; unsigned width, height;

View File

@ -124,7 +124,7 @@ static void gfx_ctx_gdi_get_video_size(void *data,
} }
} }
static void *gfx_ctx_gdi_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_gdi_init(video_frame_info_t *video_info, void *video_driver)
{ {
WNDCLASSEX wndclass = {0}; WNDCLASSEX wndclass = {0};

View File

@ -108,7 +108,7 @@ static void gfx_ctx_null_bind_hw_render(void *data, bool enable)
(void)enable; (void)enable;
} }
static void *gfx_ctx_null_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_null_init(video_frame_info_t *video_info, void *video_driver)
{ {
(void)video_driver; (void)video_driver;

View File

@ -52,7 +52,7 @@ static void gfx_ctx_khr_display_get_video_size(void *data,
*height = khr->height; *height = khr->height;
} }
static void *gfx_ctx_khr_display_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_khr_display_init(video_frame_info_t *video_info, void *video_driver)
{ {
khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)calloc(1, sizeof(*khr)); khr_display_ctx_data_t *khr = (khr_display_ctx_data_t*)calloc(1, sizeof(*khr));
if (!khr) if (!khr)

View File

@ -87,7 +87,7 @@ static void gfx_ctx_mali_fbdev_get_video_size(void *data,
*height = mali->height; *height = mali->height;
} }
static void *gfx_ctx_mali_fbdev_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_mali_fbdev_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
EGLint n; EGLint n;

View File

@ -55,7 +55,7 @@ static void gfx_ctx_opendingux_destroy(void *data)
} }
} }
static void *gfx_ctx_opendingux_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_opendingux_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
EGLint n; EGLint n;

View File

@ -141,7 +141,7 @@ static void osmesa_fifo_write(gfx_ctx_osmesa_data_t *osmesa)
} }
} }
static void *osmesa_ctx_init(video_frame_info_t video_info, void *video_driver) static void *osmesa_ctx_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_OSMESA_CREATE_CONTEXT_ATTRIBS #ifdef HAVE_OSMESA_CREATE_CONTEXT_ATTRIBS
const int attribs[] = { const int attribs[] = {

View File

@ -197,7 +197,7 @@ static void gfx_ctx_ps3_get_video_size(void *data,
#endif #endif
} }
static void *gfx_ctx_ps3_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_ps3_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_PSGL #ifdef HAVE_PSGL
PSGLdeviceParameters params; PSGLdeviceParameters params;

View File

@ -72,7 +72,7 @@ static void gfx_ctx_qnx_destroy(void *data)
free(data); free(data);
} }
static void *gfx_ctx_qnx_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_qnx_init(video_frame_info_t *video_info, void *video_driver)
{ {
EGLint n; EGLint n;
EGLint major, minor; EGLint major, minor;

View File

@ -71,7 +71,7 @@ static void sdl_ctx_destroy_resources(gfx_ctx_sdl_data_t *sdl)
SDL_QuitSubSystem(SDL_INIT_VIDEO); SDL_QuitSubSystem(SDL_INIT_VIDEO);
} }
static void *sdl_ctx_init(video_frame_info_t video_info, void *video_driver) static void *sdl_ctx_init(video_frame_info_t *video_info, void *video_driver)
{ {
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*) gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)
calloc(1, sizeof(gfx_ctx_sdl_data_t)); calloc(1, sizeof(gfx_ctx_sdl_data_t));

View File

@ -136,7 +136,7 @@ static void gfx_ctx_vc_get_video_size(void *data,
static void gfx_ctx_vc_destroy(void *data); static void gfx_ctx_vc_destroy(void *data);
static void *gfx_ctx_vc_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_vc_init(video_frame_info_t *video_info, void *video_driver)
{ {
VC_DISPMANX_ALPHA_T alpha; VC_DISPMANX_ALPHA_T alpha;
EGLint n, major, minor; EGLint n, major, minor;

View File

@ -58,7 +58,7 @@ static void gfx_ctx_vivante_destroy(void *data)
} }
static void *gfx_ctx_vivante_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_vivante_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
EGLint n; EGLint n;

View File

@ -773,7 +773,7 @@ static bool gfx_ctx_wl_get_metrics(void *data,
EGL_DEPTH_SIZE, 0 EGL_DEPTH_SIZE, 0
#endif #endif
static void *gfx_ctx_wl_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_wl_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
static const EGLint egl_attribs_gl[] = { static const EGLint egl_attribs_gl[] = {

View File

@ -427,7 +427,7 @@ static void gfx_ctx_wgl_get_video_size(void *data,
} }
} }
static void *gfx_ctx_wgl_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_wgl_init(video_frame_info_t *video_info, void *video_driver)
{ {
WNDCLASSEX wndclass = {0}; WNDCLASSEX wndclass = {0};

View File

@ -401,7 +401,7 @@ static bool gfx_ctx_x_set_resize(void *data,
return false; return false;
} }
static void *gfx_ctx_x_init(video_frame_info_t video_info, void *data) static void *gfx_ctx_x_init(video_frame_info_t *video_info, void *data)
{ {
int nelements = 0; int nelements = 0;
int major = 0; int major = 0;

View File

@ -91,7 +91,7 @@ EGL_BLUE_SIZE, 1, \
EGL_ALPHA_SIZE, 0, \ EGL_ALPHA_SIZE, 0, \
EGL_DEPTH_SIZE, 0 EGL_DEPTH_SIZE, 0
static void *gfx_ctx_xegl_init(video_frame_info_t video_info, void *video_driver) static void *gfx_ctx_xegl_init(video_frame_info_t *video_info, void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
static const EGLint egl_attribs_gl[] = { static const EGLint egl_attribs_gl[] = {

View File

@ -191,7 +191,7 @@ static const gfx_ctx_driver_t *video_context_driver_init(
video_driver_build_info(&video_info); video_driver_build_info(&video_info);
ctx_data = ctx->init(video_info, data); ctx_data = ctx->init(&video_info, data);
if (!ctx_data) if (!ctx_data)
return NULL; return NULL;

View File

@ -67,7 +67,7 @@ typedef struct gfx_ctx_driver
* to hold a pointer to it as the context never outlives the video driver. * to hold a pointer to it as the context never outlives the video driver.
* *
* The context driver is responsible for it's own data.*/ * The context driver is responsible for it's own data.*/
void* (*init)(video_frame_info_t video_info, void *video_driver); void* (*init)(video_frame_info_t *video_info, void *video_driver);
void (*destroy)(void *data); void (*destroy)(void *data);
/* Which API to bind to. */ /* Which API to bind to. */