<html><head></head><body><div class="gmail_quote">Le 7 août 2017 10:12:45 GMT+03:00, Steve Lhomme <robux4@gmail.com> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">You might want to remove the contrib as well.<br /><br />On Sat, Aug 5, 2017 at 8:14 PM, Rémi Denis-Courmont <remi@remlab.net> wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;"> The SDL video output has been forcefully disabled on MacOS X for 12<br /> years. It has also been disabled in Windows builds for over 6 years.<br /> Finally, it has been broken on X11 due to lack of windowing<br /> integration, for several years, cannot be fixed without changes to<br /> the SDL API, and is completely useless.<br /> ---<br /> <a href="http://configure.ac">configure.ac</a> | 30 +-<br /> modules/MODULES_LIST | 1 -<br /> modules/video_output/<a href="http://Makefile.am">Makefile.am</a> | 15 -<br /> modules/video_output/sdl.c | 713<hr /><br /> po/<a href="http://POTFILES.in">POTFILES.in</a> | 1 -<br /> 5 files changed, 8 insertions(+), 752 deletions(-)<br /> delete mode 100644 modules/video_output/sdl.c<br /><br /> diff --git a/<a href="http://configure.ac">configure.ac</a> b/<a href="http://configure.ac">configure.ac</a><br /> index 7501bee1ba..8487fea895 100644<br /> --- a/<a href="http://configure.ac">configure.ac</a><br /> +++ b/<a href="http://configure.ac">configure.ac</a><br /> @@ -3118,31 +3118,17 @@ AM_CONDITIONAL([HAVE_WAYLAND_EGL], [test "${have_wayland_egl}" = "yes"])<br /><br /><br /> dnl<br /> -dnl SDL module<br /> +dnl SDL image decoder module<br /> dnl<br /> -AC_ARG_ENABLE(sdl,<br /> - [ --enable-sdl SDL support (default enabled)])<br /> AC_ARG_ENABLE(sdl-image,<br /> [ --enable-sdl-image SDL image support (default enabled)])<br /> -if test "${enable_sdl}" != "no"<br /> -then<br /> - PKG_CHECK_MODULES(SDL, [sdl >= 1.2.10], [<br /> - # SDL on Darwin is heavily patched and can only run SDL_image<br /> - if test "${SYS}" != "darwin"; then<br /> - VLC_ADD_PLUGIN([vout_sdl])<br /> - fi<br /> -<br /> - # SDL_image<br /> - AS_IF([ test "${enable_sdl_image}" != "no"],[<br /> - PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [<br /> - VLC_ADD_PLUGIN([sdl_image])],<br /> - [ AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])<br /> - ])<br /> - ])<br /> - ],[<br /> - AC_MSG_WARN([${SDL_PKG_ERRORS}.])<br /> - ])<br /> -fi<br /> +AS_IF([test "${enable_sdl_image}" != "no"],[<br /> + PKG_CHECK_MODULES(SDL_IMAGE, [SDL_image >= 1.2.10], [<br /> + VLC_ADD_PLUGIN([sdl_image])<br /> + ], [<br /> + AC_MSG_WARN([${SDL_IMAGE_PKG_ERRORS}. You should install it alongside your SDL package.])<br /> + ])<br /> +])<br /><br /> dnl<br /> dnl freetype module<br /> diff --git a/modules/MODULES_LIST b/modules/MODULES_LIST<br /> index d125a999e0..9509eba71d 100644<br /> --- a/modules/MODULES_LIST<br /> +++ b/modules/MODULES_LIST<br /> @@ -447,7 +447,6 @@ $Id$<br /> * vorbis: a vorbis audio decoder/packetizer using the libvorbis library<br /> * vout_ios: iOS video provider using OpenGL ES 2<br /> * vout_macosx: Mac OS X OpenGL provider<br /> - * vout_sdl: video output module using the SDL library<br /> * vpx: WebM encoder and decoder (VP8/VP9)<br /> * vsxu: audio visualization using Vovoid VSXu<br /> * wall: image wall filter<br /> diff --git a/modules/video_output/<a href="http://Makefile.am">Makefile.am</a> b/modules/video_output/<a href="http://Makefile.am">Makefile.am</a><br /> index 6c5ee08057..e25fc40a99 100644<br /> --- a/modules/video_output/<a href="http://Makefile.am">Makefile.am</a><br /> +++ b/modules/video_output/<a href="http://Makefile.am">Makefile.am</a><br /> @@ -405,21 +405,6 @@ EXTRA_LTLIBRARIES += libfb_<a href="http://plugin.la">plugin.la</a><br /> vout_LTLIBRARIES += $(LTLIBfb)<br /><br /><br /> -### Simple DirectMedia Layer ###<br /> -libvout_sdl_plugin_la_SOURCES = video_output/sdl.c<br /> -libvout_sdl_plugin_la_CFLAGS = $(AM_CFLAGS) $(SDL_CFLAGS)<br /> -libvout_sdl_plugin_la_LIBADD = $(SDL_LIBS)<br /> -if !HAVE_WIN32<br /> -if !HAVE_OS2<br /> -libvout_sdl_plugin_la_LIBADD += $(X_LIBS) $(X_PRE_LIBS) -lX11<br /> -endif<br /> -endif<br /> -libvout_sdl_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath '$(voutdir)'<br /> -EXTRA_LTLIBRARIES += libvout_sdl_<a href="http://plugin.la">plugin.la</a><br /> -vout_LTLIBRARIES += $(LTLIBvout_sdl)<br /> -<br /> -<br /> -<br /> ### ASCII Art ###<br /> libaa_plugin_la_SOURCES = video_output/aa.c<br /> libaa_plugin_la_LIBADD = -laa<br /> diff --git a/modules/video_output/sdl.c b/modules/video_output/sdl.c<br /> deleted file mode 100644<br /> index 51c935cbe0..0000000000<br /> --- a/modules/video_output/sdl.c<br /> +++ /dev/null<br /> @@ -1,713 +0,0 @@<br /> -/*****************************************************************************<br /> - * sdl.c: SDL video output display method<br /> - *****************************************************************************<br /> - * Copyright (C) 1998-2009 VLC authors and VideoLAN<br /> - * $Id$<br /> - *<br /> - * Authors: Samuel Hocevar <sam@zoy.org><br /> - * Pierre Baillet <oct@zoy.org><br /> - * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr><br /> - * Laurent Aimar <fenrir _AT_ videolan _DOT_ org><br /> - *<br /> - * This program is free software; you can redistribute it and/or modify it<br /> - * under the terms of the GNU Lesser General Public License as published by<br /> - * the Free Software Foundation; either version 2.1 of the License, or<br /> - * (at your option) any later version.<br /> - *<br /> - * This program is distributed in the hope that it will be useful,<br /> - * but WITHOUT ANY WARRANTY; without even the implied warranty of<br /> - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br /> - * GNU Lesser General Public License for more details.<br /> - *<br /> - * You should have received a copy of the GNU Lesser General Public License<br /> - * along with this program; if not, write to the Free Software Foundation,<br /> - * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.<br /> - *****************************************************************************/<br /> -<br /> -/*****************************************************************************<br /> - * Preamble<br /> - *****************************************************************************/<br /> -#ifdef HAVE_CONFIG_H<br /> -# include "config.h"<br /> -#endif<br /> -<br /> -#include <vlc_common.h><br /> -#include <vlc_plugin.h><br /> -#include <vlc_vout_display.h><br /> -#include <vlc_picture_pool.h><br /> -<br /> -#include <assert.h><br /> -<br /> -#include <SDL.h><br /> -<br /> -#if !defined(_WIN32) && !defined(__OS2__)<br /> -# ifdef X_DISPLAY_MISSING<br /> -# error Xlib required due to XInitThreads<br /> -# endif<br /> -# include <vlc_xlib.h><br /> -#endif<br /> -<br /> -/*****************************************************************************<br /> - * Module descriptor<br /> - *****************************************************************************/<br /> -static int Open (vlc_object_t *);<br /> -static void Close(vlc_object_t *);<br /> -<br /> -#define CHROMA_TEXT N_("SDL chroma format")<br /> -#define CHROMA_LONGTEXT N_(\<br /> - "Force the SDL renderer to use a specific chroma format instead of " \<br /> - "trying to improve performances by using the most efficient one.")<br /> -<br /> -#define OVERLAY_TEXT N_("YUV overlay")<br /> -#define OVERLAY_LONGTEXT N_(\<br /> - "Use the hardware YUV overlay of the graphic card (if available).")<br /> -<br /> -vlc_module_begin()<br /> - set_shortname("SDL")<br /> - set_category(CAT_VIDEO)<br /> - set_subcategory(SUBCAT_VIDEO_VOUT)<br /> - set_description(N_("Simple DirectMedia Layer video output"))<br /> - set_capability("vout display", 70)<br /> - add_shortcut("sdl")<br /> - add_bool("sdl-overlay", true, OVERLAY_TEXT, OVERLAY_LONGTEXT, false)<br /> - add_string("sdl-chroma", NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true)<br /> - add_obsolete_string("sdl-video-driver") /* obsolete since 1.1.0 */<br /> - set_callbacks(Open, Close)<br /> -#if defined(__i386__) || defined(__x86_64__)<br /> - /* On i386, SDL is linked against svgalib */<br /> - cannot_unload_broken_library()<br /> -#endif<br /> -vlc_module_end()<br /> -<br /> -<br /> -/*****************************************************************************<br /> - * Local prototypes<br /> - *****************************************************************************/<br /> -static picture_pool_t *Pool (vout_display_t *, unsigned);<br /> -static void PictureDisplay(vout_display_t *, picture_t *, subpicture_t *);<br /> -static int Control(vout_display_t *, int, va_list);<br /> -static void Manage(vout_display_t *);<br /> -<br /> -/* */<br /> -static int ConvertKey(SDLKey);<br /> -<br /> -/* */<br /> -static vlc_mutex_t sdl_lock = VLC_STATIC_MUTEX;<br /> -<br /> -/* */<br /> -struct vout_display_sys_t {<br /> - vout_display_place_t place;<br /> -<br /> - SDL_Surface *display;<br /> - int display_bpp;<br /> - uint32_t display_flags;<br /> -<br /> - unsigned int desktop_width;<br /> - unsigned int desktop_height;<br /> -<br /> - /* For YUV output */<br /> - SDL_Overlay *overlay;<br /> - bool is_uv_swapped;<br /> -<br /> - /* */<br /> - picture_pool_t *pool;<br /> -};<br /> -<br /> -/**<br /> - * This function initializes SDL vout method.<br /> - */<br /> -static int Open(vlc_object_t *object)<br /> -{<br /> - vout_display_t *vd = (vout_display_t *)object;<br /> - vout_display_sys_t *sys;<br /> -<br /> - if (vout_display_IsWindowed(vd))<br /> - return VLC_EGENERIC;<br /> -#if !defined(_WIN32) && !defined(__OS2__)<br /> - if (!vlc_xlib_init (object))<br /> - return VLC_EGENERIC;<br /> -#endif<br /> -<br /> - /* XXX: check for conflicts with the SDL audio output */<br /> - vlc_mutex_lock(&sdl_lock);<br /> -<br /> - /* Check if SDL video module has been initialized */<br /> - if (SDL_WasInit(SDL_INIT_VIDEO) != 0) {<br /> - vlc_mutex_unlock(&sdl_lock);<br /> - return VLC_EGENERIC;<br /> - }<br /> -<br /> - vd->sys = sys = calloc(1, sizeof(*sys));<br /> - if (!sys) {<br /> - vlc_mutex_unlock(&sdl_lock);<br /> - return VLC_ENOMEM;<br /> - }<br /> -<br /> - /* */<br /> - int sdl_flags = SDL_INIT_VIDEO;<br /> -#ifndef _WIN32<br /> - /* Win32 SDL implementation doesn't support SDL_INIT_EVENTTHREAD yet*/<br /> - sdl_flags |= SDL_INIT_EVENTTHREAD;<br /> -#endif<br /> - /* In debug mode you may want vlc to dump a core instead of staying stuck */<br /> - sdl_flags |= SDL_INIT_NOPARACHUTE;<br /> -<br /> - /* Initialize library */<br /> - if (SDL_Init(sdl_flags) < 0) {<br /> - vlc_mutex_unlock(&sdl_lock);<br /> -<br /> - msg_Err(vd, "cannot initialize SDL (%s)", SDL_GetError());<br /> - free(sys);<br /> - return VLC_EGENERIC;<br /> - }<br /> - vlc_mutex_unlock(&sdl_lock);<br /> -<br /> - /* Translate keys into unicode */<br /> - SDL_EnableUNICODE(1);<br /> -<br /> - /* Get the desktop resolution */<br /> - /* FIXME: SDL has a problem with virtual desktop */<br /> - sys->desktop_width = SDL_GetVideoInfo()->current_w;<br /> - sys->desktop_height = SDL_GetVideoInfo()->current_h;<br /> -<br /> - /* */<br /> - video_format_t fmt;<br /> - video_format_ApplyRotation(&fmt, &vd->fmt);<br /> -<br /> - /* */<br /> - vout_display_info_t info = vd->info;<br /> -<br /> - info.needs_event_thread = true;<br /> -<br /> - /* Set main window's size */<br /> - int display_width;<br /> - int display_height;<br /> - if (vd->cfg->is_fullscreen) {<br /> - display_width = sys->desktop_width;<br /> - display_height = sys->desktop_height;<br /> - } else {<br /> - display_width = vd->cfg->display.width;<br /> - display_height = vd->cfg->display.height;<br /> - }<br /> -<br /> - /* Initialize flags and cursor */<br /> - sys->display_flags = SDL_ANYFORMAT | SDL_HWPALETTE | SDL_HWSURFACE | SDL_DOUBLEBUF;<br /> - sys->display_flags |= vd->cfg->is_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE;<br /> -<br /> - sys->display_bpp = SDL_VideoModeOK(display_width, display_height,<br /> - 16, sys->display_flags);<br /> - if (sys->display_bpp == 0) {<br /> - msg_Err(vd, "no video mode available");<br /> - goto error;<br /> - }<br /> -<br /> - sys->display = SDL_SetVideoMode(display_width, display_height,<br /> - sys->display_bpp, sys->display_flags);<br /> - if (!sys->display) {<br /> - msg_Err(vd, "cannot set video mode");<br /> - goto error;<br /> - }<br /> -<br /> - /* We keep the surface locked forever */<br /> - SDL_LockSurface(sys->display);<br /> -<br /> - /* */<br /> - vlc_fourcc_t forced_chroma = 0;<br /> - char *psz_chroma = var_InheritString(vd, "sdl-chroma");<br /> - if (psz_chroma) {<br /> - forced_chroma = vlc_fourcc_GetCodecFromString(VIDEO_ES, psz_chroma);<br /> - if (forced_chroma)<br /> - msg_Dbg(vd, "Forcing chroma to 0x%.8x (%4.4s)",<br /> - forced_chroma, (const char*)&forced_chroma);<br /> - free(psz_chroma);<br /> - }<br /> -<br /> - /* Try to open an overlay if requested */<br /> - sys->overlay = NULL;<br /> - const bool is_overlay = var_InheritBool(vd, "sdl-overlay");<br /> - if (is_overlay) {<br /> - static const struct<br /> - {<br /> - vlc_fourcc_t vlc;<br /> - uint32_t sdl;<br /> - } vlc_to_sdl[] = {<br /> - { VLC_CODEC_YV12, SDL_YV12_OVERLAY },<br /> - { VLC_CODEC_I420, SDL_IYUV_OVERLAY },<br /> - { VLC_CODEC_YUYV, SDL_YUY2_OVERLAY },<br /> - { VLC_CODEC_UYVY, SDL_UYVY_OVERLAY },<br /> - { VLC_CODEC_YVYU, SDL_YVYU_OVERLAY },<br /> -<br /> - { 0, 0 }<br /> - };<br /> - const vlc_fourcc_t forced_chromas[] = {<br /> - forced_chroma, 0<br /> - };<br /> - const vlc_fourcc_t *fallback_chromas =<br /> - vlc_fourcc_GetYUVFallback(fmt.i_chroma);<br /> - const vlc_fourcc_t *chromas = forced_chroma ? forced_chromas : fallback_chromas;<br /> -<br /> - for (int pass = forced_chroma ? 1 : 0; pass < 2 && !sys->overlay; pass++) {<br /> - for (int i = 0; chromas[i] != 0; i++) {<br /> - const vlc_fourcc_t vlc = chromas[i];<br /> -<br /> - uint32_t sdl = 0;<br /> - for (int j = 0; vlc_to_sdl[j].vlc != 0 && !sdl; j++) {<br /> - if (vlc_to_sdl[j].vlc == vlc)<br /> - sdl = vlc_to_sdl[j].sdl;<br /> - }<br /> - if (!sdl)<br /> - continue;<br /> -<br /> - sys->overlay = SDL_CreateYUVOverlay(fmt.i_width, fmt.i_height,<br /> - sdl, sys->display);<br /> - if (sys->overlay && !sys->overlay->hw_overlay && pass == 0) {<br /> - /* Ignore non hardware overlay surface in first pass */<br /> - SDL_FreeYUVOverlay(sys->overlay);<br /> - sys->overlay = NULL;<br /> - }<br /> - if (sys->overlay) {<br /> - /* We keep the surface locked forever */<br /> - SDL_LockYUVOverlay(sys->overlay);<br /> -<br /> - fmt.i_chroma = vlc;<br /> - sys->is_uv_swapped = vlc_fourcc_AreUVPlanesSwapped(fmt.i_chroma,<br /> - vd->fmt.i_chroma);<br /> - if (sys->is_uv_swapped)<br /> - fmt.i_chroma = vd->fmt.i_chroma;<br /> - break;<br /> - }<br /> - }<br /> - }<br /> - } else {<br /> - msg_Warn(vd, "SDL overlay disabled by the user");<br /> - }<br /> -<br /> - /* */<br /> - vout_display_cfg_t place_cfg = *vd->cfg;<br /> - place_cfg.display.width = display_width;<br /> - place_cfg.display.height = display_height;<br /> - vout_display_PlacePicture(&sys->place, &vd->source, &place_cfg, !sys->overlay);<br /> -<br /> - /* If no overlay, fallback to software output */<br /> - if (!sys->overlay) {<br /> - /* */<br /> - switch (sys->display->format->BitsPerPixel) {<br /> - case 8:<br /> - fmt.i_chroma = VLC_CODEC_RGB8;<br /> - break;<br /> - case 15:<br /> - fmt.i_chroma = VLC_CODEC_RGB15;<br /> - break;<br /> - case 16:<br /> - fmt.i_chroma = VLC_CODEC_RGB16;<br /> - break;<br /> - case 24:<br /> - fmt.i_chroma = VLC_CODEC_RGB24;<br /> - break;<br /> - case 32:<br /> - fmt.i_chroma = VLC_CODEC_RGB32;<br /> - break;<br /> - default:<br /> - msg_Err(vd, "unknown screen depth %i",<br /> - sys->display->format->BitsPerPixel);<br /> - goto error;<br /> - }<br /> -<br /> - /* All we have is an RGB image with square pixels */<br /> - fmt.i_width = display_width;<br /> - fmt.i_height = display_height;<br /> - fmt.i_rmask = sys->display->format->Rmask;<br /> - fmt.i_gmask = sys->display->format->Gmask;<br /> - fmt.i_bmask = sys->display->format->Bmask;<br /> -<br /> - info.has_pictures_invalid = true;<br /> - }<br /> -<br /> - if (vd->cfg->display.title)<br /> - SDL_WM_SetCaption(vd->cfg->display.title,<br /> - vd->cfg->display.title);<br /> - else if (!sys->overlay)<br /> - SDL_WM_SetCaption(VOUT_TITLE " (software RGB SDL output)",<br /> - VOUT_TITLE " (software RGB SDL output)");<br /> - else if (sys->overlay->hw_overlay)<br /> - SDL_WM_SetCaption(VOUT_TITLE " (hardware YUV SDL output)",<br /> - VOUT_TITLE " (hardware YUV SDL output)");<br /> - else<br /> - SDL_WM_SetCaption(VOUT_TITLE " (software YUV SDL output)",<br /> - VOUT_TITLE " (software YUV SDL output)");<br /> -<br /> - /* Setup events */<br /> - SDL_EventState(SDL_KEYUP, SDL_IGNORE); /* ignore keys up */<br /> -<br /> - /* Setup vout_display now that everything is fine */<br /> - vd->fmt = fmt;<br /> - vd->info = info;<br /> -<br /> - vd->pool = Pool;<br /> - vd->prepare = NULL;<br /> - vd->display = PictureDisplay;<br /> - vd->control = Control;<br /> - vd->manage = Manage;<br /> -<br /> - /* */<br /> - vout_display_SendEventDisplaySize(vd, display_width, display_height);<br /> - return VLC_SUCCESS;<br /> -<br /> -error:<br /> - msg_Err(vd, "cannot set up SDL (%s)", SDL_GetError());<br /> -<br /> - if (sys->display) {<br /> - SDL_UnlockSurface(sys->display);<br /> - SDL_FreeSurface(sys->display);<br /> - }<br /> -<br /> - vlc_mutex_lock(&sdl_lock);<br /> - SDL_QuitSubSystem(SDL_INIT_VIDEO);<br /> - vlc_mutex_unlock(&sdl_lock);<br /> -<br /> - free(sys);<br /> - return VLC_EGENERIC;<br /> -}<br /> -<br /> -/**<br /> - * Close a SDL video output<br /> - */<br /> -static void Close(vlc_object_t *object)<br /> -{<br /> - vout_display_t *vd = (vout_display_t *)object;<br /> - vout_display_sys_t *sys = vd->sys;<br /> -<br /> - if (sys->pool)<br /> - picture_pool_Release(sys->pool);<br /> -<br /> - if (sys->overlay) {<br /> - SDL_LockYUVOverlay(sys->overlay);<br /> - SDL_FreeYUVOverlay(sys->overlay);<br /> - }<br /> - SDL_UnlockSurface (sys->display);<br /> - SDL_FreeSurface(sys->display);<br /> -<br /> - vlc_mutex_lock(&sdl_lock);<br /> - SDL_QuitSubSystem(SDL_INIT_VIDEO);<br /> - vlc_mutex_unlock(&sdl_lock);<br /> -<br /> - free(sys);<br /> -}<br /> -<br /> -/**<br /> - * Return a pool of direct buffers<br /> - */<br /> -static picture_pool_t *Pool(vout_display_t *vd, unsigned count)<br /> -{<br /> - vout_display_sys_t *sys = vd->sys;<br /> - VLC_UNUSED(count);<br /> -<br /> - if (!sys->pool) {<br /> - picture_resource_t rsc;<br /> -<br /> - memset(&rsc, 0, sizeof(rsc));<br /> -<br /> - if (sys->overlay) {<br /> - SDL_Overlay *ol = sys->overlay;<br /> -<br /> - for (int i = 0; i < ol->planes; i++) {<br /> - rsc.p[i].p_pixels = ol->pixels[ i > 0 && sys->is_uv_swapped ? (3-i) : i];<br /> - rsc.p[i].i_pitch = ol->pitches[i > 0 && sys->is_uv_swapped ? (3-i) : i];<br /> - rsc.p[i].i_lines = ol->h;<br /> - if (ol->format == SDL_YV12_OVERLAY ||<br /> - ol->format == SDL_IYUV_OVERLAY)<br /> - rsc.p[i].i_lines /= 2;<br /> -<br /> - }<br /> - } else {<br /> - const int x = sys->place.x;<br /> - const int y = sys->place.y;<br /> -<br /> - SDL_Surface *sf = sys->display;<br /> - SDL_FillRect(sf, NULL, 0);<br /> -<br /> - assert(x >= 0 && y >= 0);<br /> - rsc.p[0].p_pixels = (uint8_t*)sf->pixels + y * sf->pitch + x * ((sf->format->BitsPerPixel + 7) / 8);<br /> - rsc.p[0].i_pitch = sf->pitch;<br /> - rsc.p[0].i_lines = vd->fmt.i_height;<br /> - }<br /> -<br /> - picture_t *picture = picture_NewFromResource(&vd->fmt, &rsc);;<br /> - if (!picture)<br /> - return NULL;<br /> -<br /> - sys->pool = picture_pool_New(1, &picture);<br /> - }<br /> -<br /> - return sys->pool;<br /> -}<br /> -<br /> -/**<br /> - * Display a picture<br /> - */<br /> -static void PictureDisplay(vout_display_t *vd, picture_t *p_pic, subpicture_t *p_subpicture)<br /> -{<br /> - vout_display_sys_t *sys = vd->sys;<br /> -<br /> - if (sys->overlay) {<br /> - SDL_Rect disp;<br /> - disp.x = sys->place.x;<br /> - disp.y = sys->place.y;<br /> - disp.w = sys->place.width;<br /> - disp.h = sys->place.height;<br /> -<br /> - SDL_UnlockYUVOverlay(sys->overlay);<br /> - SDL_DisplayYUVOverlay(sys->overlay , &disp);<br /> - SDL_LockYUVOverlay(sys->overlay);<br /> - } else {<br /> - SDL_Flip(sys->display);<br /> - }<br /> -<br /> - picture_Release(p_pic);<br /> - VLC_UNUSED(p_subpicture);<br /> -}<br /> -<br /> -<br /> -/**<br /> - * Control for vout display<br /> - */<br /> -static int Control(vout_display_t *vd, int query, va_list args)<br /> -{<br /> - vout_display_sys_t *sys = vd->sys;<br /> -<br /> - switch (query)<br /> - {<br /> - case VOUT_DISPLAY_HIDE_MOUSE:<br /> - SDL_ShowCursor(0);<br /> - return VLC_SUCCESS;<br /> -<br /> - case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: {<br /> - const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);<br /> -<br /> - /* */<br /> - sys->display = SDL_SetVideoMode(cfg->display.width,<br /> - cfg->display.height,<br /> - sys->display_bpp, sys->display_flags);<br /> - if (!sys->display) {<br /> - sys->display = SDL_SetVideoMode(vd->cfg->display.width,<br /> - vd->cfg->display.height,<br /> - sys->display_bpp, sys->display_flags);<br /> - return VLC_EGENERIC;<br /> - }<br /> - if (sys->overlay)<br /> - vout_display_PlacePicture(&sys->place, &vd->source, cfg, !sys->overlay);<br /> - else<br /> - vout_display_SendEventPicturesInvalid(vd);<br /> - return VLC_SUCCESS;<br /> - }<br /> - case VOUT_DISPLAY_CHANGE_FULLSCREEN: {<br /> - bool fs = va_arg(args, int);<br /> -<br /> - /* Fix flags */<br /> - sys->display_flags &= ~(SDL_FULLSCREEN | SDL_RESIZABLE);<br /> - sys->display_flags |= fs ? SDL_FULLSCREEN : SDL_RESIZABLE;<br /> -<br /> - if (sys->overlay)<br /> - sys->display = SDL_SetVideoMode(sys->desktop_width, sys->desktop_height,<br /> - sys->display_bpp, sys->display_flags);<br /> -<br /> - vout_display_SendEventDisplaySize(vd, sys->desktop_width, sys->desktop_height);<br /> - return VLC_SUCCESS;<br /> - }<br /> - case VOUT_DISPLAY_CHANGE_ZOOM:<br /> - case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:<br /> - case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT: {<br /> - const vout_display_cfg_t *cfg;<br /> -<br /> - if (query == VOUT_DISPLAY_CHANGE_SOURCE_ASPECT) {<br /> - cfg = vd->cfg;<br /> - } else {<br /> - cfg = va_arg(args, const vout_display_cfg_t *);<br /> - }<br /> - if (sys->overlay) {<br /> - sys->display = SDL_SetVideoMode(cfg->display.width, cfg->display.height,<br /> - sys->display_bpp, sys->display_flags);<br /> -<br /> - vout_display_PlacePicture(&sys->place, &vd->source, cfg, !sys->overlay);<br /> - } else {<br /> - vout_display_SendEventPicturesInvalid(vd);<br /> - }<br /> - return VLC_SUCCESS;<br /> - }<br /> -<br /> - case VOUT_DISPLAY_RESET_PICTURES: {<br /> - /* */<br /> - assert(!sys->overlay);<br /> -<br /> - /* */<br /> - if (sys->pool)<br /> - picture_pool_Release(sys->pool);<br /> - sys->pool = NULL;<br /> -<br /> - vout_display_PlacePicture(&sys->place, &vd->source, vd->cfg, !sys->overlay);<br /> -<br /> - /* */<br /> - vd->fmt.i_width = sys->place.width;<br /> - vd->fmt.i_height = sys->place.height;<br /> - return VLC_SUCCESS;<br /> - }<br /> -<br /> - case VOUT_DISPLAY_CHANGE_SOURCE_CROP:<br /> - /* I don't think it is possible to support with SDL:<br /> - * - crop<br /> - */<br /> - return VLC_EGENERIC;<br /> -<br /> - default:<br /> - msg_Err(vd, "Unsupported query in vout display SDL");<br /> - return VLC_EGENERIC;<br /> - }<br /> -}<br /> -<br /> -/**<br /> - * Proccess pending event<br /> - */<br /> -static void Manage(vout_display_t *vd)<br /> -{<br /> - vout_display_sys_t *sys = vd->sys;<br /> - SDL_Event event;<br /> -<br /> - /* */<br /> - while (SDL_PollEvent(&event)) {<br /> - switch (event.type) {<br /> - case SDL_QUIT:<br /> - vout_display_SendEventClose(vd);<br /> - break;<br /> -<br /> - case SDL_KEYDOWN: {<br /> - /* convert the key if possible */<br /> - int key = ConvertKey(event.key.keysym.sym);<br /> -<br /> - if (!key) {<br /> - /* Find the right caracter */<br /> - if ((event.key.keysym.unicode & 0xff80) == 0) {<br /> - key = event.key.keysym.unicode & 0x7f;<br /> - /* FIXME: find a better solution than this<br /> - hack to find the right caracter */<br /> - if (key >= 1 && key <= 26)<br /> - key += 96;<br /> - else if (key >= 65 && key <= 90)<br /> - key += 32;<br /> - }<br /> - }<br /> - if (!key)<br /> - break;<br /> -<br /> - if (event.key.keysym.mod & KMOD_SHIFT)<br /> - key |= KEY_MODIFIER_SHIFT;<br /> - if (event.key.keysym.mod & KMOD_CTRL)<br /> - key |= KEY_MODIFIER_CTRL;<br /> - if (event.key.keysym.mod & KMOD_ALT)<br /> - key |= KEY_MODIFIER_ALT;<br /> - vout_display_SendEventKey(vd, key);<br /> - break;<br /> - }<br /> -<br /> - case SDL_MOUSEBUTTONDOWN:<br /> - case SDL_MOUSEBUTTONUP: {<br /> - static const struct { int sdl; int vlc; } buttons[] = {<br /> - { SDL_BUTTON_LEFT, MOUSE_BUTTON_LEFT },<br /> - { SDL_BUTTON_MIDDLE, MOUSE_BUTTON_CENTER },<br /> - { SDL_BUTTON_RIGHT, MOUSE_BUTTON_RIGHT },<br /> - { SDL_BUTTON_WHEELUP, MOUSE_BUTTON_WHEEL_UP },<br /> - { SDL_BUTTON_WHEELDOWN, MOUSE_BUTTON_WHEEL_DOWN },<br /> - { -1, -1 },<br /> - };<br /> -<br /> - SDL_ShowCursor(1);<br /> - for (int i = 0; buttons[i].sdl != -1; i++) {<br /> - if (buttons[i].sdl == event.button.button) {<br /> - if (event.type == SDL_MOUSEBUTTONDOWN)<br /> - vout_display_SendEventMousePressed(vd, buttons[i].vlc);<br /> - else<br /> - vout_display_SendEventMouseReleased(vd, buttons[i].vlc);<br /> - }<br /> - }<br /> - break;<br /> - }<br /> -<br /> - case SDL_MOUSEMOTION: {<br /> - if (sys->place.width <= 0 || sys->place.height <= 0)<br /> - break;<br /> -<br /> - SDL_ShowCursor(1);<br /> -<br /> - vout_display_SendMouseMovedDisplayCoordinates(vd, ORIENT_NORMAL,<br /> - event.motion.x, event.motion.y,<br /> - &sys->place);<br /> - break;<br /> - }<br /> -<br /> - case SDL_VIDEORESIZE:<br /> - vout_display_SendEventDisplaySize(vd, event.resize.w, event.resize.h);<br /> - break;<br /> -<br /> - default:<br /> - break;<br /> - }<br /> - }<br /> -<br /> -}<br /> -<br /> -static const struct {<br /> - SDLKey sdl_key;<br /> - int vlckey;<br /> -<br /> -} sdlkeys_to_vlckeys[] = {<br /> - { SDLK_F1, KEY_F1 },<br /> - { SDLK_F2, KEY_F2 },<br /> - { SDLK_F3, KEY_F3 },<br /> - { SDLK_F4, KEY_F4 },<br /> - { SDLK_F5, KEY_F5 },<br /> - { SDLK_F6, KEY_F6 },<br /> - { SDLK_F7, KEY_F7 },<br /> - { SDLK_F8, KEY_F8 },<br /> - { SDLK_F9, KEY_F9 },<br /> - { SDLK_F10, KEY_F10 },<br /> - { SDLK_F11, KEY_F11 },<br /> - { SDLK_F12, KEY_F12 },<br /> -<br /> - { SDLK_RETURN, KEY_ENTER },<br /> - { SDLK_KP_ENTER, KEY_ENTER },<br /> - { SDLK_SPACE, ' ' },<br /> - { SDLK_ESCAPE, KEY_ESC },<br /> -<br /> - { SDLK_MENU, KEY_MENU },<br /> - { SDLK_LEFT, KEY_LEFT },<br /> - { SDLK_RIGHT, KEY_RIGHT },<br /> - { SDLK_UP, KEY_UP },<br /> - { SDLK_DOWN, KEY_DOWN },<br /> -<br /> - { SDLK_HOME, KEY_HOME },<br /> - { SDLK_END, KEY_END },<br /> - { SDLK_PAGEUP, KEY_PAGEUP },<br /> - { SDLK_PAGEDOWN, KEY_PAGEDOWN },<br /> -<br /> - { SDLK_INSERT, KEY_INSERT },<br /> - { SDLK_DELETE, KEY_DELETE },<br /> - /*TODO: find a equivalent for SDL<br /> - { , KEY_MEDIA_NEXT_TRACK }<br /> - { , KEY_MEDIA_PREV_TRACK }<br /> - { , KEY_VOLUME_MUTE }<br /> - { , KEY_VOLUME_DOWN }<br /> - { , KEY_VOLUME_UP }<br /> - { , KEY_MEDIA_PLAY_PAUSE }<br /> - { , KEY_MEDIA_PLAY_PAUSE }*/<br /> -<br /> - { 0, 0 }<br /> -};<br /> -<br /> -static int ConvertKey(SDLKey sdl_key)<br /> -{<br /> - for (int i = 0; sdlkeys_to_vlckeys[i].sdl_key != 0; i++) {<br /> - if (sdlkeys_to_vlckeys[i].sdl_key == sdl_key)<br /> - return sdlkeys_to_vlckeys[i].vlckey;<br /> - }<br /> - return 0;<br /> -}<br /> -<br /> diff --git a/po/<a href="http://POTFILES.in">POTFILES.in</a> b/po/<a href="http://POTFILES.in">POTFILES.in</a><br /> index 0aa9f039ee..49b0679632 100644<br /> --- a/po/<a href="http://POTFILES.in">POTFILES.in</a><br /> +++ b/po/<a href="http://POTFILES.in">POTFILES.in</a><br /> @@ -1140,7 +1140,6 @@ modules/video_output/win32/directdraw.c<br /> modules/video_output/win32/events.c<br /> modules/video_output/win32/glwin32.c<br /> modules/video_output/win32/wingdi.c<br /> -modules/video_output/sdl.c<br /> modules/video_output/vdummy.c<br /> modules/video_output/vmem.c<br /> modules/video_output/wayland/shell.c<br /> --<br /> 2.13.3<br /><br /><hr /><br /> vlc-devel mailing list<br /> To unsubscribe or modify your subscription options:<br /> <a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br /></blockquote><hr /><br />vlc-devel mailing list<br />To unsubscribe or modify your subscription options:<br /><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br clear="all">Yeah, I know. That's what I answered to Marvin.<br>
<br>
It boils down to what we want of SDL image. It is a bit weird to have that plugin only on non-Windows non-Darwin. I suspect it is useless.<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>