/*
* vo_sdl.c
*
* (was video_out_sdl.c from OMS project/mpeg2dec -> http://linuxvideo.org)
*
* Copyright (C) Ryan C. Gordon <icculus@lokigames.com> - April 22, 2000
*
* Copyright (C) Felix Buenemann <atmosfear@users.sourceforge.net> - 2001
*
* (for extensive code enhancements)
*
* Current maintainer for MPlayer project (report bugs to that address):
* Felix Buenemann <atmosfear@users.sourceforge.net>
*
* This file is a video out driver using the SDL library (http://libsdl.org/),
* to be used with MPlayer, further info from http://www.mplayerhq.hu
*
* -- old disclaimer --
*
* A mpeg2dec display driver that does output through the
* Simple DirectMedia Layer (SDL) library. This effectively gives us all
* sorts of output options: X11, SVGAlib, fbcon, AAlib, GGI. Win32, MacOS
* and BeOS support, too. Yay. SDL info, source, and binaries can be found
* at http://slouken.devolution.com/SDL/
*
* -- end old disclaimer --
*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/* define to force software-surface (video surface stored in system memory)*/
#undef SDL_NOHWSURFACE
/* define to enable surface locks, this might be needed on SMP machines */
#undef SDL_ENABLE_LOCKS
/* MONITOR_ASPECT MUST BE FLOAT */
#define MONITOR_ASPECT 4.0/3.0
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "config.h"
#include "mp_msg.h"
#include "mp_msg.h"
#include "help_mp.h"
#include "video_out.h"
#include "video_out_internal.h"
#include "fastmemcpy.h"
#include "sub.h"
#include "aspect.h"
#include "libmpcodecs/vfcap.h"
#ifdef CONFIG_X11
#include <X11/Xlib.h>
#include "x11_common.h"
#endif
#include "input/input.h"
#include "input/mouse.h"
#include "subopt-helper.h"
#include "mp_fifo.h"
static const vo_info_t info =
{
"SDL YUV/RGB/BGR renderer (SDL v1.1.7+ only!)",
"sdl",
"Ryan C. Gordon <icculus@lokigames.com>, Felix Buenemann <atmosfear@users.sourceforge.net>",
""
};
const LIBVO_EXTERN(sdl)
#ifdef CONFIG_SDL_SDL_H
#include <SDL/SDL.h>
#else
#include <SDL.h>
#endif
//#include <SDL/SDL_syswm.h>
#ifdef SDL_ENABLE_LOCKS
#define SDL_OVR_LOCK(x) if (SDL_LockYUVOverlay (priv->overlay)) { \
mp_msg(MSGT_VO,MSGL_V, "SDL: Couldn't lock YUV overlay\n"); \
return x; \
}
#define SDL_OVR_UNLOCK SDL_UnlockYUVOverlay (priv->overlay);
#define SDL_SRF_LOCK(srf, x) if(SDL_MUSTLOCK(srf)) { \
if(SDL_LockSurface (srf)) { \
mp_msg(MSGT_VO,MSGL_V, "SDL: Couldn't lock RGB surface\n"); \
return x; \
} \
}
#define SDL_SRF_UNLOCK(srf) if(SDL_MUSTLOCK(srf)) \
SDL_UnlockSurface (srf);
#else
#define SDL_OVR_LOCK(x)
#define SDL_OVR_UNLOCK
#define SDL
|