Don't pass video_info by value to context_driver init function
This commit is contained in:
parent
f770ea8560
commit
1ea3bea0ee
|
@ -64,11 +64,11 @@ bool drm_get_resources(int fd)
|
|||
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 monitor_index = 0;
|
||||
unsigned monitor = MAX(video_info.monitor_index, 1);
|
||||
unsigned monitor = MAX(video_info->monitor_index, 1);
|
||||
|
||||
/* Enumerate all connectors. */
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ void drm_setup(int fd);
|
|||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -100,7 +100,7 @@ static void android_gfx_ctx_destroy(void *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
|
||||
EGLint n, major, minor;
|
||||
|
|
|
@ -275,7 +275,7 @@ static CGSSurfaceID attach_gl_context_to_window(CGLContextObj glCtx,
|
|||
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;
|
||||
gfx_ctx_cgl_data_t *cgl = (gfx_ctx_cgl_data_t*)calloc(1, sizeof(gfx_ctx_cgl_data_t));
|
||||
|
|
|
@ -213,7 +213,7 @@ void cocoagl_gfx_ctx_update(void)
|
|||
#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;
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ static bool gfx_ctx_d3d_bind_api(void *data,
|
|||
#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();
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ static void gfx_ctx_drm_destroy_resources(gfx_ctx_drm_data_t *drm)
|
|||
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;
|
||||
unsigned monitor_index;
|
||||
|
|
|
@ -99,7 +99,7 @@ static void gfx_ctx_emscripten_destroy(void *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
|
||||
unsigned width, height;
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -108,7 +108,7 @@ static void gfx_ctx_null_bind_hw_render(void *data, bool 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;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ static void gfx_ctx_khr_display_get_video_size(void *data,
|
|||
*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));
|
||||
if (!khr)
|
||||
|
|
|
@ -87,7 +87,7 @@ static void gfx_ctx_mali_fbdev_get_video_size(void *data,
|
|||
*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
|
||||
EGLint n;
|
||||
|
|
|
@ -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
|
||||
EGLint n;
|
||||
|
|
|
@ -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
|
||||
const int attribs[] = {
|
||||
|
|
|
@ -197,7 +197,7 @@ static void gfx_ctx_ps3_get_video_size(void *data,
|
|||
#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
|
||||
PSGLdeviceParameters params;
|
||||
|
|
|
@ -72,7 +72,7 @@ static void gfx_ctx_qnx_destroy(void *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 major, minor;
|
||||
|
|
|
@ -71,7 +71,7 @@ static void sdl_ctx_destroy_resources(gfx_ctx_sdl_data_t *sdl)
|
|||
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*)
|
||||
calloc(1, sizeof(gfx_ctx_sdl_data_t));
|
||||
|
|
|
@ -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_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;
|
||||
EGLint n, major, minor;
|
||||
|
|
|
@ -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
|
||||
EGLint n;
|
||||
|
|
|
@ -773,7 +773,7 @@ static bool gfx_ctx_wl_get_metrics(void *data,
|
|||
EGL_DEPTH_SIZE, 0
|
||||
#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
|
||||
static const EGLint egl_attribs_gl[] = {
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -401,7 +401,7 @@ static bool gfx_ctx_x_set_resize(void *data,
|
|||
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 major = 0;
|
||||
|
|
|
@ -91,7 +91,7 @@ EGL_BLUE_SIZE, 1, \
|
|||
EGL_ALPHA_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
|
||||
static const EGLint egl_attribs_gl[] = {
|
||||
|
|
|
@ -191,7 +191,7 @@ static const gfx_ctx_driver_t *video_context_driver_init(
|
|||
|
||||
video_driver_build_info(&video_info);
|
||||
|
||||
ctx_data = ctx->init(video_info, data);
|
||||
ctx_data = ctx->init(&video_info, data);
|
||||
|
||||
if (!ctx_data)
|
||||
return NULL;
|
||||
|
|
|
@ -67,7 +67,7 @@ typedef struct gfx_ctx_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.*/
|
||||
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);
|
||||
|
||||
/* Which API to bind to. */
|
||||
|
|
Loading…
Reference in New Issue