Get rid of video_frame_info dependency

This commit is contained in:
twinaphex 2020-03-07 00:39:06 +01:00
parent 83b815df17
commit 4598f186a8
29 changed files with 35 additions and 40 deletions

View File

@ -102,7 +102,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(void *video_driver)
{ {
#ifdef HAVE_OPENGLES #ifdef HAVE_OPENGLES
EGLint n, major, minor; EGLint n, major, minor;

View File

@ -289,7 +289,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(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

@ -819,7 +819,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data,
return true; return true;
} }
static void *cocoagl_gfx_ctx_init(video_frame_info_t *video_info, void *video_driver) static void *cocoagl_gfx_ctx_init(void *video_driver)
{ {
cocoa_ctx_data_t *cocoa_ctx = (cocoa_ctx_data_t*) cocoa_ctx_data_t *cocoa_ctx = (cocoa_ctx_data_t*)
calloc(1, sizeof(cocoa_ctx_data_t)); calloc(1, sizeof(cocoa_ctx_data_t));

View File

@ -389,7 +389,7 @@ static void gfx_ctx_drm_destroy_resources(gfx_ctx_drm_data_t *drm)
} }
#endif #endif
static void *gfx_ctx_drm_init(video_frame_info_t *video_info, void *video_driver) static void *gfx_ctx_drm_init(void *video_driver)
{ {
#ifndef HAVE_ODROIDGO2 #ifndef HAVE_ODROIDGO2
int fd, i; int fd, i;

View File

@ -172,8 +172,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, static void *gfx_ctx_emscripten_init(void *video_driver)
void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
unsigned width, height; unsigned width, height;

View File

@ -68,7 +68,7 @@ static void gfx_ctx_fpga_get_video_size(void *data,
*height = g_resize_height; *height = g_resize_height;
} }
static void *gfx_ctx_fpga_init(video_frame_info_t *video_info, void *video_driver) static void *gfx_ctx_fpga_init(void *video_driver)
{ {
(void)video_driver; (void)video_driver;

View File

@ -107,8 +107,7 @@ static void gfx_ctx_gdi_get_video_size(void *data,
} }
} }
static void *gfx_ctx_gdi_init( static void *gfx_ctx_gdi_init(void *video_driver)
video_frame_info_t *video_info, void *video_driver)
{ {
WNDCLASSEX wndclass = {0}; WNDCLASSEX wndclass = {0};
gfx_ctx_gdi_data_t *gdi = (gfx_ctx_gdi_data_t*)calloc(1, sizeof(*gdi)); gfx_ctx_gdi_data_t *gdi = (gfx_ctx_gdi_data_t*)calloc(1, sizeof(*gdi));

View File

@ -112,7 +112,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(void *video_driver)
{ {
(void)video_driver; (void)video_driver;

View File

@ -58,8 +58,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, static void *gfx_ctx_khr_display_init(void *video_driver)
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

@ -92,8 +92,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, static void *gfx_ctx_mali_fbdev_init(void *video_driver)
void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
EGLint n; EGLint n;

View File

@ -54,8 +54,7 @@ static void gfx_ctx_network_get_video_size(void *data,
(void)data; (void)data;
} }
static void *gfx_ctx_network_init( static void *gfx_ctx_network_init(void *video_driver)
video_frame_info_t *video_info, void *video_driver)
{ {
(void)video_driver; (void)video_driver;

View File

@ -59,7 +59,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(void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
EGLint n; EGLint n;

View File

@ -55,7 +55,7 @@ static void orbis_ctx_get_video_size(void *data,
*height = ATTR_ORBISGL_HEIGHT; *height = ATTR_ORBISGL_HEIGHT;
} }
static void *orbis_ctx_init(video_frame_info_t *video_info, void *video_driver) static void *orbis_ctx_init(void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
int ret; int ret;

View File

@ -142,7 +142,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(void *video_driver)
{ {
#ifdef HAVE_OSMESA_CREATE_CONTEXT_ATTRIBS #ifdef HAVE_OSMESA_CREATE_CONTEXT_ATTRIBS
const int attribs[] = { const int attribs[] = {

View File

@ -195,7 +195,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(void *video_driver)
{ {
#ifdef HAVE_PSGL #ifdef HAVE_PSGL
PSGLdeviceParameters params; PSGLdeviceParameters params;

View File

@ -74,7 +74,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(void *video_driver)
{ {
EGLint n; EGLint n;
EGLint major, minor; EGLint major, minor;

View File

@ -76,7 +76,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(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

@ -54,8 +54,7 @@ static void gfx_ctx_sixel_get_video_size(void *data,
(void)data; (void)data;
} }
static void *gfx_ctx_sixel_init( static void *gfx_ctx_sixel_init(void *video_driver)
video_frame_info_t *video_info, void *video_driver)
{ {
(void)video_driver; (void)video_driver;

View File

@ -63,7 +63,7 @@ static void switch_ctx_get_video_size(void *data,
} }
} }
static void *switch_ctx_init(video_frame_info_t *video_info, void *video_driver) static void *switch_ctx_init(void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
EGLint n; EGLint n;

View File

@ -186,7 +186,7 @@ static void gfx_ctx_uwp_get_video_size(void *data,
win32_check_window(&quit, &resize, width, height); win32_check_window(&quit, &resize, width, height);
} }
static void *gfx_ctx_uwp_init(video_frame_info_t *video_info, void *video_driver) static void *gfx_ctx_uwp_init(void *video_driver)
{ {
gfx_ctx_uwp_data_t *uwp = (gfx_ctx_uwp_data_t*)calloc(1, sizeof(*uwp)); gfx_ctx_uwp_data_t *uwp = (gfx_ctx_uwp_data_t*)calloc(1, sizeof(*uwp));

View File

@ -148,10 +148,12 @@ static void dispmanx_vsync_callback(DISPMANX_UPDATE_HANDLE_T u, 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(void *video_driver)
{ {
VC_DISPMANX_ALPHA_T alpha; VC_DISPMANX_ALPHA_T alpha;
EGLint n, major, minor; EGLint n, major, minor;
settings_t *settings = config_get_ptr();
unsigned max_swapchain_images = settings->uints.video_max_swapchain_images;
DISPMANX_ELEMENT_HANDLE_T dispman_element; DISPMANX_ELEMENT_HANDLE_T dispman_element;
DISPMANX_DISPLAY_HANDLE_T dispman_display; DISPMANX_DISPLAY_HANDLE_T dispman_display;
@ -311,7 +313,7 @@ static void *gfx_ctx_vc_init(video_frame_info_t *video_info, void *video_driver)
vc->vsync_condition_mutex = slock_new(); vc->vsync_condition_mutex = slock_new();
vc->vsync_callback_set = false; vc->vsync_callback_set = false;
if (video_info->max_swapchain_images <= 2) if (max_swapchain_images <= 2)
{ {
/* Start sending vsync callbacks so we can wait for vsync after eglSwapBuffers */ /* Start sending vsync callbacks so we can wait for vsync after eglSwapBuffers */
vc_dispmanx_vsync_callback(vc->dispman_display, vc_dispmanx_vsync_callback(vc->dispman_display,

View File

@ -121,7 +121,7 @@ static void vita_bind_hw_render(void *data, bool enable)
(void)enable; (void)enable;
} }
static void *vita_init(video_frame_info_t *video_info, void *video_driver) static void *vita_init(void *video_driver)
{ {
(void)video_driver; (void)video_driver;

View File

@ -61,7 +61,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(void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
EGLint n; EGLint n;

View File

@ -1215,7 +1215,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(void *video_driver)
{ {
int i; int i;
#ifdef HAVE_EGL #ifdef HAVE_EGL

View File

@ -637,7 +637,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(void *video_driver)
{ {
WNDCLASSEX wndclass = {0}; WNDCLASSEX wndclass = {0};
gfx_ctx_wgl_data_t *wgl = (gfx_ctx_wgl_data_t*)calloc(1, sizeof(*wgl)); gfx_ctx_wgl_data_t *wgl = (gfx_ctx_wgl_data_t*)calloc(1, sizeof(*wgl));

View File

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

View File

@ -105,7 +105,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(void *video_driver)
{ {
#ifdef HAVE_EGL #ifdef HAVE_EGL
static const EGLint egl_attribs_gl[] = { static const EGLint egl_attribs_gl[] = {

View File

@ -24153,7 +24153,8 @@ static const gfx_ctx_driver_t *video_context_driver_init(
unsigned minor, bool hw_render_ctx, unsigned minor, bool hw_render_ctx,
void **ctx_data) void **ctx_data)
{ {
video_frame_info_t video_info; settings_t *settings = configuration_settings;
bool video_shared_context = settings->bools.video_shared_context;
if (!ctx->bind_api(data, api, major, minor)) if (!ctx->bind_api(data, api, major, minor))
{ {
@ -24164,14 +24165,12 @@ static const gfx_ctx_driver_t *video_context_driver_init(
return NULL; return NULL;
} }
video_driver_build_info(&video_info); if (!(*ctx_data = ctx->init(data)))
if (!(*ctx_data = ctx->init(&video_info, data)))
return NULL; return NULL;
if (ctx->bind_hw_render) if (ctx->bind_hw_render)
ctx->bind_hw_render(*ctx_data, ctx->bind_hw_render(*ctx_data,
video_info.shared_context && hw_render_ctx); video_shared_context && hw_render_ctx);
return ctx; return ctx;
} }

View File

@ -1209,7 +1209,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)(void *video_driver);
void (*destroy)(void *data); void (*destroy)(void *data);
enum gfx_ctx_api (*get_api)(void *data); enum gfx_ctx_api (*get_api)(void *data);