X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_output%2Fgl.c;h=082aa7837bd5a11d6586a67ff2974833fb2bd5c6;hb=refs%2Fheads%2Fmaster;hp=39ddae316180a03ea7a12ff51cae8254187e79b6;hpb=6444fb21ac5168fc2307e68cec22de63ecf33f28;p=vlc diff --git a/modules/video_output/gl.c b/modules/video_output/gl.c index 39ddae3161..082aa7837b 100644 --- a/modules/video_output/gl.c +++ b/modules/video_output/gl.c @@ -49,7 +49,7 @@ vlc_module_begin () # define MODULE_VARNAME "gles2" set_shortname (N_("OpenGL ES2")) set_description (N_("OpenGL for Embedded Systems 2 video output")) - set_capability ("vout display", /*165*/0) + set_capability ("vout display", /*265*/0) set_callbacks (Open, Close) add_shortcut ("opengles2", "gles2") add_module ("gles2", "opengl es2", NULL, @@ -60,7 +60,7 @@ vlc_module_begin () # define MODULE_VARNAME "gles" set_shortname (N_("OpenGL ES")) set_description (N_("OpenGL for Embedded Systems video output")) - set_capability ("vout display", /*160*/0) + set_capability ("vout display", /*260*/0) set_callbacks (Open, Close) add_shortcut ("opengles", "gles") add_module ("gles", "opengl es", NULL, @@ -72,7 +72,7 @@ vlc_module_begin () set_description (N_("OpenGL video output (experimental)")) set_category (CAT_VIDEO) set_subcategory (SUBCAT_VIDEO_VOUT) - set_capability ("vout display", /*170*/0) + set_capability ("vout display", /*270*/0) set_callbacks (Open, Close) add_shortcut ("opengl", "gl") add_module ("gl", "opengl", NULL, @@ -93,30 +93,6 @@ static void PictureRender (vout_display_t *, picture_t *, subpicture_t *); static void PictureDisplay (vout_display_t *, picture_t *, subpicture_t *); static int Control (vout_display_t *, int, va_list); -static vout_window_t *MakeWindow (vout_display_t *vd) -{ - vout_window_cfg_t cfg = { - .width = vd->cfg->display.width, - .height = vd->cfg->display.height, - }; - vout_window_t *wnd; - -#if defined(_WIN32) - cfg.type = VOUT_WINDOW_TYPE_HWND; -#elif defined(__ANDROID__) - cfg.type = VOUT_WINDOW_TYPE_ANDROID_NATIVE; -#else - cfg.type = VOUT_WINDOW_TYPE_XID; -#endif - - wnd = vout_display_NewWindow (vd, &cfg); - if (wnd != NULL) - return wnd; - - msg_Err (vd, "parent window not available"); - return NULL; -} - /** * Allocates a surface and an OpenGL context for video output. */ @@ -130,14 +106,19 @@ static int Open (vlc_object_t *obj) sys->gl = NULL; sys->pool = NULL; - vout_window_t *surface = MakeWindow (vd); + vout_window_t *surface = vout_display_NewWindow (vd, VOUT_WINDOW_TYPE_INVALID); if (surface == NULL) + { + msg_Err (vd, "parent window not available"); goto error; + } sys->gl = vlc_gl_Create (surface, API, "$" MODULE_VARNAME); if (sys->gl == NULL) goto error; + vlc_gl_Resize (sys->gl, vd->cfg->display.width, vd->cfg->display.height); + /* Initialize video display */ const vlc_fourcc_t *spu_chromas; @@ -150,11 +131,6 @@ static int Open (vlc_object_t *obj) if (sys->vgl == NULL) goto error; - bool fs = vd->cfg->is_fullscreen; - if (vout_window_SetFullScreen (sys->gl->surface, fs)) - fs = false; - vout_display_SendEventFullscreen (vd, fs); - vd->sys = sys; vd->info.has_pictures_invalid = false; vd->info.has_event_thread = false; @@ -241,15 +217,8 @@ static int Control (vout_display_t *vd, int query, va_list ap) break; #ifndef NDEBUG case VOUT_DISPLAY_RESET_PICTURES: // not needed - assert(0); + vlc_assert_unreachable(); #endif - case VOUT_DISPLAY_CHANGE_FULLSCREEN: - { - const vout_display_cfg_t *c = - va_arg (ap, const vout_display_cfg_t *); - - return vout_window_SetFullScreen (sys->gl->surface, c->is_fullscreen); - } case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: @@ -260,6 +229,7 @@ static int Control (vout_display_t *vd, int query, va_list ap) vout_display_place_t place; vout_display_PlacePicture (&place, src, c, false); + vlc_gl_Resize (sys->gl, place.width, place.height); vlc_gl_MakeCurrent (sys->gl); glViewport (place.x, place.y, place.width, place.height); vlc_gl_ReleaseCurrent (sys->gl); @@ -279,15 +249,6 @@ static int Control (vout_display_t *vd, int query, va_list ap) vlc_gl_ReleaseCurrent (sys->gl); return VLC_SUCCESS; } - - case VOUT_DISPLAY_GET_OPENGL: - { - vlc_gl_t **pgl = va_arg (ap, vlc_gl_t **); - - *pgl = sys->gl; - return VLC_SUCCESS; - } - default: msg_Err (vd, "Unknown request %d", query); }