Commit 5ff854ec authored by Sam Hocevar's avatar Sam Hocevar
Browse files

  * XVideo plugin courtesy of Shane Harper <shanegh@optusnet.com.au>
  * Makefile.in and configure.in fixes by Nilmoni Deb <ndeb@ece.cmu.edu>
  * A few syntax fixes in the plain X11 plugin
parent 52985bd2
......@@ -16,7 +16,7 @@ D: directory browsing code in modules.c
N: Stphane Borel
E: stef@via.ecp.fr
D: MPEG video decoder
D: DVD input
D: DVD input, IFO parsing, CSS decryption
N: Arnaud de Bossoreille de Ribou
E: bozo@via.ecp.fr
......@@ -30,6 +30,10 @@ N: Renaud Dartus
E: reno@via.ecp.fr
D: AC3 decoder
N: Nilmoni Deb
E: ndeb@ece.cmu.edu
D: Minor configure.in and Makefile.in fixes
N: Colin Delacroix
E: colin@zoy.org
D: MacOS X sound support
......@@ -55,6 +59,8 @@ D: Bug fixes
N: Shane Harper
E: shanegh@optusnet.com.au
D: SDL plugin fixes and enhancements
D: XVideo video output
D: Gnome and Gtk+ interface enhancements
N: Gal Hendryckx
E: jimmy@via.ecp.fr
......
......@@ -28,10 +28,6 @@ libdir=@libdir@
CC=@CC@
SHELL=@SHELL@
LIB_SDL=@LIB_SDL@
LIB_GLIDE=@LIB_GLIDE@
LIB_GGI=@LIB_GGI@
#----------------- do not change anything below this line ----------------------
################################################################################
......@@ -73,6 +69,7 @@ endif
#
# C headers directories
#
INCLUDE += @INCLUDE@
INCLUDE += -Iinclude -I/usr/local/include
#
......@@ -423,7 +420,10 @@ PLUGIN_SDL = plugins/sdl/sdl.o \
PLUGIN_TS = plugins/mpeg/ts.o \
plugins/mpeg/input_ts.o
PLUGIN_X11= plugins/x11/x11.o \
PLUGIN_XVIDEO = plugins/x11/xvideo.o \
plugins/x11/vout_xvideo.o
PLUGIN_X11 = plugins/x11/x11.o \
plugins/x11/vout_x11.o
PLUGIN_YUV = plugins/yuv/yuv.o \
......@@ -464,6 +464,7 @@ STD_PLUGIN_OBJ = \
NONSTD_PLUGIN_OBJ = \
$(PLUGIN_X11) \
$(PLUGIN_XVIDEO) \
$(PLUGIN_GLIDE) \
$(PLUGIN_GTK) \
$(PLUGIN_GNOME) \
......@@ -607,6 +608,11 @@ $(STD_PLUGIN_OBJ): %.o: .dep/%.d
$(STD_PLUGIN_OBJ): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
$(PLUGIN_XVIDEO): %.o: Makefile.dep
$(PLUGIN_XVIDEO): %.o: .dep/%.d
$(PLUGIN_XVIDEO): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -I/usr/X11R6/include -c -o $@ $<
$(PLUGIN_X11): %.o: Makefile.dep
$(PLUGIN_X11): %.o: .dep/%.d
$(PLUGIN_X11): %.o: %.c
......@@ -693,10 +699,10 @@ lib/fb.so: $(PLUGIN_FB)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
lib/ggi.so: $(PLUGIN_GGI)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_GGI)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_GGI@
lib/glide.so: $(PLUGIN_GLIDE)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_GLIDE)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_GLIDE@
lib/gnome.so: $(PLUGIN_GNOME)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) `gnome-config --libs gnomeui | sed 's,-rdynamic,,'`
......@@ -750,7 +756,7 @@ lib/qt.so: $(PLUGIN_QT)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -lqt -L${QTDIR}/lib
lib/sdl.so: $(PLUGIN_SDL)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_SDL)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) @LIB_SDL@
lib/ts.so: $(PLUGIN_TS)
ifeq ($(SYS),darwin)
......@@ -759,6 +765,13 @@ else
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
endif
lib/xvideo.so: $(PLUGIN_XVIDEO)
ifeq ($(SYS),nto-qnx)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXv -lsocket
else
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lXv
endif
lib/x11.so: $(PLUGIN_X11)
ifeq ($(SYS),nto-qnx)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) -L/usr/X11R6/lib -lX11 -lXext -lsocket
......
This diff is collapsed.
......@@ -198,7 +198,8 @@ AC_ARG_WITH(sdl,
PLUGINS=${PLUGINS}"sdl ";
if test "x$withval" != "xyes";
then
LIB_SDL="L/usr/X11R6/lib -l"$withval
LIB_SDL="-L/usr/X11R6/lib -L"$withval"/lib -l"$withval
INCLUDE=${INCLUDE}" -I"$withval"/include"
else
AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
LIB_SDL="-L/usr/X11R6/lib -lSDL"
......@@ -245,6 +246,9 @@ fi
AC_ARG_ENABLE(x11,
[ --disable-x11 X11 support (default enabled)])
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
AC_ARG_ENABLE(xvideo,
[ --enable-xvideo XVideo interface support (default disabled)],
[if test x$enable_xvideo = xyes; then PLUGINS=${PLUGINS}"xvideo "; fi])
AC_ARG_ENABLE(alsa,
[ --enable-alsa Alsa sound drivers support (Only for linux) (default disabled)],
......@@ -258,6 +262,7 @@ AC_SUBST(SYS)
AC_SUBST(ARCH)
AC_SUBST(PLUGINS)
AC_SUBST(ALIASES)
AC_SUBST(INCLUDE)
AC_SUBST(DEBUG)
AC_SUBST(STATS)
AC_SUBST(OPTIMS)
......
......@@ -2,7 +2,7 @@
* vout_x11.c: X11 video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_x11.c,v 1.16 2001/03/16 22:37:06 massiot Exp $
* $Id: vout_x11.c,v 1.17 2001/04/01 06:21:44 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -178,7 +178,7 @@ static int vout_Create( vout_thread_t *p_vout )
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
{
intf_ErrMsg("error: %s", strerror(ENOMEM) );
intf_ErrMsg( "vout error: %s", strerror(ENOMEM) );
return( 1 );
}
......@@ -188,7 +188,7 @@ static int vout_Create( vout_thread_t *p_vout )
if( p_vout->p_sys->p_display == NULL ) /* error */
{
intf_ErrMsg("error: can't open display %s\n", psz_display );
intf_ErrMsg( "vout error: cannot open display %s", psz_display );
free( p_vout->p_sys );
return( 1 );
}
......@@ -198,7 +198,7 @@ static int vout_Create( vout_thread_t *p_vout )
* but also command buttons, subtitles and other indicators */
if( X11CreateWindow( p_vout ) )
{
intf_ErrMsg("error: can't create interface window\n" );
intf_ErrMsg( "vout error: cannot create X11 window" );
XCloseDisplay( p_vout->p_sys->p_display );
free( p_vout->p_sys );
return( 1 );
......@@ -210,7 +210,7 @@ static int vout_Create( vout_thread_t *p_vout )
* id is still valid. */
if( X11InitDisplay( p_vout, psz_display ) )
{
intf_ErrMsg("error: can't initialize X11 display" );
intf_ErrMsg( "vout error: cannot initialize X11 display" );
XCloseDisplay( p_vout->p_sys->p_display );
free( p_vout->p_sys );
return( 1 );
......@@ -259,7 +259,7 @@ static int vout_Init( vout_thread_t *p_vout )
}
if( i_err ) /* an error occured */
{
intf_Msg("vout: XShm video extension unavailable" );
intf_Msg( "vout: XShm video extension unavailable" );
p_vout->p_sys->b_shm = 0;
}
}
......@@ -269,14 +269,14 @@ static int vout_Init( vout_thread_t *p_vout )
{
if( X11CreateImage( p_vout, &p_vout->p_sys->p_ximage[0] ) )
{
intf_ErrMsg("error: can't create images");
intf_ErrMsg( "vout error: cannot create images" );
p_vout->p_sys->p_ximage[0] = NULL;
p_vout->p_sys->p_ximage[1] = NULL;
return( 1 );
}
if( X11CreateImage( p_vout, &p_vout->p_sys->p_ximage[1] ) )
{
intf_ErrMsg("error: can't create images");
intf_ErrMsg( "vout error: cannot create images" );
X11DestroyImage( p_vout->p_sys->p_ximage[0] );
p_vout->p_sys->p_ximage[0] = NULL;
p_vout->p_sys->p_ximage[1] = NULL;
......@@ -494,7 +494,7 @@ static int vout_Manage( vout_thread_t *p_vout )
*/
if( p_vout->i_changes & VOUT_SIZE_CHANGE )
{
intf_DbgMsg("resizing window");
intf_DbgMsg( "vout info: resizing window" );
p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
/* Resize window */
......@@ -507,7 +507,7 @@ static int vout_Manage( vout_thread_t *p_vout )
/* Recreate XImages. If SysInit failed, the thread can't go on. */
if( vout_Init( p_vout ) )
{
intf_ErrMsg("error: can't resize display");
intf_ErrMsg( "vout error: cannot resize display" );
return( 1 );
}
......@@ -515,7 +515,8 @@ static int vout_Manage( vout_thread_t *p_vout )
* tables. This is needed since conversion buffer size may have
* changed */
p_vout->i_changes |= VOUT_YUV_CHANGE;
intf_Msg("vout: video display resized (%dx%d)", p_vout->i_width, p_vout->i_height);
intf_Msg( "vout: video display resized (%dx%d)",
p_vout->i_width, p_vout->i_height);
}
return 0;
......@@ -734,7 +735,7 @@ static int X11InitDisplay( vout_thread_t *p_vout, char *psz_display )
== True );
if( !p_vout->p_sys->b_shm )
{
intf_Msg("vout: XShm video extension is not available");
intf_Msg( "vout: XShm video extension is not available" );
}
/* Get screen depth */
......@@ -753,7 +754,7 @@ static int X11InitDisplay( vout_thread_t *p_vout, char *psz_display )
&xvisual_template, &i_count );
if( p_xvisual == NULL )
{
intf_ErrMsg("vout error: no PseudoColor visual available");
intf_ErrMsg( "vout error: no PseudoColor visual available" );
return( 1 );
}
p_vout->i_bytes_per_pixel = 1;
......@@ -772,7 +773,7 @@ static int X11InitDisplay( vout_thread_t *p_vout, char *psz_display )
&xvisual_template, &i_count );
if( p_xvisual == NULL )
{
intf_ErrMsg("vout error: no TrueColor visual available");
intf_ErrMsg( "vout error: no TrueColor visual available" );
return( 1 );
}
p_vout->i_red_mask = p_xvisual->red_mask;
......@@ -822,7 +823,7 @@ static int X11CreateImage( vout_thread_t *p_vout, XImage **pp_ximage )
pb_data = (byte_t *) malloc( p_vout->i_bytes_per_line * p_vout->i_height );
if( !pb_data ) /* error */
{
intf_ErrMsg("error: %s", strerror(ENOMEM));
intf_ErrMsg( "vout error: %s", strerror(ENOMEM));
return( 1 );
}
......@@ -877,7 +878,7 @@ static int X11CreateShmImage( vout_thread_t *p_vout, XImage **pp_ximage,
p_shm_info, p_vout->i_width, p_vout->i_height );
if(! *pp_ximage ) /* error */
{
intf_ErrMsg("error: XShmCreateImage() failed");
intf_ErrMsg( "vout error: XShmCreateImage() failed" );
return( 1 );
}
......@@ -888,7 +889,7 @@ static int X11CreateShmImage( vout_thread_t *p_vout, XImage **pp_ximage,
* (*pp_ximage)->height, IPC_CREAT | 0777);
if( p_shm_info->shmid < 0) /* error */
{
intf_ErrMsg("error: can't allocate shared image data (%s)",
intf_ErrMsg( "vout error: cannot allocate shared image data (%s)",
strerror(errno));
XDestroyImage( *pp_ximage );
return( 1 );
......@@ -898,7 +899,7 @@ static int X11CreateShmImage( vout_thread_t *p_vout, XImage **pp_ximage,
p_shm_info->shmaddr = (*pp_ximage)->data = shmat(p_shm_info->shmid, 0, 0);
if(! p_shm_info->shmaddr )
{ /* error */
intf_ErrMsg("error: can't attach shared memory (%s)",
intf_ErrMsg( "vout error: cannot attach shared memory (%s)",
strerror(errno));
shmctl( p_shm_info->shmid, IPC_RMID, 0 ); /* free shared memory */
XDestroyImage( *pp_ximage );
......@@ -914,7 +915,7 @@ static int X11CreateShmImage( vout_thread_t *p_vout, XImage **pp_ximage,
if( XShmAttach( p_vout->p_sys->p_display, p_shm_info )
== False ) /* error */
{
intf_ErrMsg("error: can't attach shared memory to X11 server");
intf_ErrMsg( "vout error: cannot attach shared memory to X11 server" );
shmdt( p_shm_info->shmaddr ); /* detach shared memory from process
* and automatic free */
XDestroyImage( *pp_ximage );
......@@ -962,7 +963,7 @@ static void X11DestroyShmImage( vout_thread_t *p_vout, XImage *p_ximage,
if( shmdt( p_shm_info->shmaddr ) ) /* detach shared memory from process */
{ /* also automatic freeing... */
intf_ErrMsg( "error: can't detach shared memory (%s)",
intf_ErrMsg( "error: cannot detach shared memory (%s)",
strerror(errno) );
}
}
......@@ -1002,7 +1003,7 @@ void X11DisableScreenSaver( vout_thread_t *p_vout )
&p_vout->p_sys->i_ss_exposure );
/* Disable screen saver */
intf_DbgMsg("intf: disabling screen saver");
intf_DbgMsg( "vout: disabling screen saver" );
XSetScreenSaver( p_vout->p_sys->p_display, 0,
p_vout->p_sys->i_ss_interval,
p_vout->p_sys->i_ss_blanking,
......
/*****************************************************************************
* vout_xvideo.c: Xvideo video output display method
*****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
* $Id: vout_xvideo.c,v 1.1 2001/04/01 06:21:44 sam Exp $
*
* Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
*
* This program 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME xvideo
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#ifdef HAVE_MACHINE_PARAM_H
/* BSD */
#include <machine/param.h>
#include <sys/types.h> /* typedef ushort */
#include <sys/ipc.h>
#endif
#include <sys/shm.h> /* shmget(), shmctl() */
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/keysym.h>
#include <X11/extensions/XShm.h>
#include <X11/extensions/Xv.h>
#include <X11/extensions/Xvlib.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "modules.h"
#include "video.h"
#include "video_output.h"
#include "interface.h"
#include "intf_msg.h"
#include "main.h"
/*****************************************************************************
* vout_sys_t: video output X11 method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the X11 specific properties of an output thread. X11 video
* output is performed through regular resizable windows. Windows can be
* dynamically resized to adapt to the size of the streams.
*****************************************************************************/
typedef struct vout_sys_s
{
/* User settings */
#if 0
/* this plugin (currently) requires the SHM Ext... */
boolean_t b_shm; /* shared memory extension flag */
#endif
/* Internal settings and properties */
Display * p_display; /* display pointer */
int i_screen; /* screen number */
Window window; /* root window */
GC gc; /* graphic context instance handler */
int xv_port;
/* Display buffers and shared memory information */
/* Note: only 1 buffer (I don't know why the X11 plugin had 2.) */
XvImage * p_xvimage;
XShmSegmentInfo shm_info; /* shared memory zone information */
/* X11 generic properties */
Atom wm_protocols;
Atom wm_delete_window;
int i_width; /* width of main window */
int i_height; /* height of main window */
/* Screen saver properties */
int i_ss_timeout; /* timeout */
int i_ss_interval; /* interval between changes */
int i_ss_blanking; /* blanking mode */
int i_ss_exposure; /* exposure mode */
/* Mouse pointer properties */
boolean_t b_mouse; /* is the mouse pointer displayed ? */
} vout_sys_t;
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int vout_Probe ( probedata_t * );
static int vout_Create ( vout_thread_t * );
static int vout_Init ( vout_thread_t * );
static void vout_End ( vout_thread_t * );
static void vout_Destroy ( vout_thread_t * );
static int vout_Manage ( vout_thread_t * );
static void vout_Display ( vout_thread_t * );
static void vout_SetPalette( vout_thread_t *, u16 *, u16 *, u16 *, u16 * );
static int XVideoCreateWindow ( vout_thread_t * );
static int XVideoCreateShmImage ( vout_thread_t *, XvImage **,
XShmSegmentInfo *p_shm_info );
static void XVideoDestroyShmImage ( vout_thread_t *, XvImage *,
XShmSegmentInfo * );
static void XVideoTogglePointer ( vout_thread_t * );
static void XVideoEnableScreenSaver ( vout_thread_t * );
static void XVideoDisableScreenSaver ( vout_thread_t * );
static int XVideoCheckForXv ( Display * );
static void XVideoOutputCoords ( const picture_t *, const boolean_t,
const int, const int,
int *, int *, int *, int * );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = vout_Probe;
p_function_list->functions.vout.pf_create = vout_Create;
p_function_list->functions.vout.pf_init = vout_Init;
p_function_list->functions.vout.pf_end = vout_End;
p_function_list->functions.vout.pf_destroy = vout_Destroy;
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = vout_SetPalette;
}
/*****************************************************************************
* vout_Probe: probe the video driver and return a score
*****************************************************************************
* This returns a score to the plugin manager so that it can select the best
* plugin.
*****************************************************************************/
static int vout_Probe( probedata_t *p_data )
{
if( TestMethod( VOUT_METHOD_VAR, "xvideo" ) )
{
return( 999 );
}
return( 90 );
}
/*****************************************************************************
* vout_Create: allocate XVideo video thread output method
*****************************************************************************
* This function allocate and initialize a X11 vout method. It uses some of the
* vout properties to choose the window size, and change them according to the
* actual properties of the display.
*****************************************************************************/
static int vout_Create( vout_thread_t *p_vout )
{
char *psz_display;
/* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL )
{
intf_ErrMsg( "vout error: %s", strerror(ENOMEM) );
return( 1 );
}
/* Open display, unsing 'vlc_display' or DISPLAY environment variable */
psz_display = XDisplayName( main_GetPszVariable( VOUT_DISPLAY_VAR, NULL ) );
p_vout->p_sys->p_display = XOpenDisplay( psz_display );
if( p_vout->p_sys->p_display == NULL ) /* error */
{
intf_ErrMsg( "vout error: cannot open display %s", psz_display );
free( p_vout->p_sys );
return( 1 );
}
p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );
if( !XVideoCheckForXv( p_vout->p_sys->p_display ) )
{
intf_ErrMsg( "vout error: no XVideo extension" );
XCloseDisplay( p_vout->p_sys->p_display );
free( p_vout->p_sys );
return( 1 );
}
/* Spawn base window - this window will include the video output window,
* but also command buttons, subtitles and other indicators */
if( XVideoCreateWindow( p_vout ) )
{
intf_ErrMsg( "vout error: cannot create XVideo window" );
XCloseDisplay( p_vout->p_sys->p_display );
free( p_vout->p_sys );
return( 1 );
}
p_vout->p_sys->b_mouse = 1;
/* Disable screen saver and return */
XVideoDisableScreenSaver( p_vout );
return( 0 );
}
/*****************************************************************************
* vout_Init: initialize XVideo video thread output method
*****************************************************************************
* This function create the XImages needed by the output thread. It is called
* at the beginning of the thread, but also each time the window is resized.
*****************************************************************************/
static int vout_Init( vout_thread_t *p_vout )
{
int i_err;
#ifdef SYS_DARWIN1_3
/* FIXME : As of 2001-03-16, XFree4 for MacOS X does not support Xshm. */
p_vout->p_sys->b_shm = 0;
#endif
/* Create XImages using XShm extension */
i_err = XVideoCreateShmImage( p_vout, &p_vout->p_sys->p_xvimage,
&p_vout->p_sys->shm_info );
if( i_err )
{
intf_Msg( "vout: XShm video extension unavailable" );
/* p_vout->p_sys->b_shm = 0; */
}
p_vout->b_need_render = 0; /* = 1 if not using Xv extension. */
/* Set bytes per line and initialize buffers */
p_vout->i_bytes_per_line =
(p_vout->p_sys->p_xvimage->data_size) /
(p_vout->p_sys->p_xvimage->height);
/* vout_SetBuffers( p_vout, p_vout->p_sys->p_xvimage[0]->data,
* p_vout->p_sys->p_xvimage[1]->data ); */
p_vout->p_buffer[0].i_pic_x = 0;
p_vout->p_buffer[0].i_pic_y = 0;
p_vout->p_buffer[0].i_pic_width = 0;
p_vout->p_buffer[0].i_pic_height = 0;
/* The first area covers all the screen */
p_vout->p_buffer[0].i_areas = 1;
p_vout->p_buffer[0].pi_area_begin[0] = 0;
p_vout->p_buffer[0].pi_area_end[0] = p_vout->i_height - 1;
/* Set addresses */
p_vout->p_buffer[0].p_data = p_vout->p_sys->p_xvimage->data;
return( 0 );
}
/*****************************************************************************
* vout_End: terminate XVideo video thread output method
*****************************************************************************
* Destroy the XVideo xImages created by vout_Init. It is called at the end of
* the thread, but also each time the window is resized.
*****************************************************************************/
static void vout_End( vout_thread_t *p_vout )
{
XVideoDestroyShmImage( p_vout, p_vout->p_sys->p_xvimage,
&p_vout->p_sys->shm_info );
}
/*****************************************************************************
* vout_Destroy: destroy XVideo video thread output method
*****************************************************************************
* Terminate an output method created by vout_CreateOutputMethod
*****************************************************************************/
static void vout_Destroy( vout_thread_t *p_vout )
{
/* Enable screen saver */
XVideoEnableScreenSaver( p_vout );
/* Destroy window */
XUnmapWindow( p_vout->p_sys->p_display, p_vout->p_sys->window );
XFreeGC( p_vout->p_sys->p_display, p_vout->p_sys->gc );
XDestroyWindow( p_vout->p_sys->p_display, p_vout->p_sys->window );
XCloseDisplay( p_vout->p_sys->p_display );
/* Destroy structure */
free( p_vout->p_sys );
}
/*****************************************************************************
* vout_Manage: handle X11 events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* X11 events and allows window resizing. It returns a non null value on
* error.