Commit 0ae751d3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove Xlib XVideo video output

parent e5b397fa
......@@ -368,7 +368,6 @@ case "${host_os}" in
;;
*nto*)
SYS=nto
VLC_ADD_LIBS([xvideo],[-lsocket])
;;
solaris*)
SYS=solaris
......@@ -3455,26 +3454,6 @@ dnl Check for DPMS
])
])
dnl
dnl XVideo module
dnl (enabled by default except on win32)
dnl
AC_ARG_ENABLE(xvideo,
[ --enable-xvideo XVideo support (default enabled)],, [
enable_xvideo="$enable_x11"
])
AS_IF([test "${enable_xvideo}" != "no"], [
AC_CHECK_HEADERS(X11/extensions/Xv.h, [
CFLAGS="${CFLAGS_save} ${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext"
AC_CHECK_LIB(Xv,XvPutImage,[
VLC_ADD_PLUGIN([xvideo])
VLC_ADD_CPPFLAGS([xvideo],[${X_CFLAGS}])
VLC_ADD_LIBS([xvideo],[${X_LIBS} ${X_PRE_LIBS} -lX11 -lXext -lXv])
])
CFLAGS="${CFLAGS_save}"
])
])
dnl
dnl GLX module
dnl (enabled by default except on win32)
......@@ -3529,6 +3508,10 @@ AC_ARG_ENABLE(xcb,
enable_xcb="no"
])
])
AC_ARG_ENABLE(xvideo,
[ --enable-xvideo XVideo support (default enabled)],, [
enable_xvideo="$enable_xcb"
])
AS_IF([test "${enable_xcb}" != "no"], [
PKG_CHECK_MODULES(XPROTO, [xproto])
......@@ -4930,13 +4913,13 @@ AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
dnl Tests for Osso and Xsp
AC_CHECK_LIB(osso, osso_display_blanking_pause, [
PKG_CHECK_MODULES(GLIB2, glib-2.0, [
VLC_ADD_CPPFLAGS([xvideo xvmc glx omapfb],[-DHAVE_OSSO ${DBUS_CFLAGS} ${GLIB2_CFLAGS}])
VLC_ADD_LIBS([xvideo xvmc glx omapfb],[-losso])
VLC_ADD_CPPFLAGS([xvmc glx omapfb],[-DHAVE_OSSO ${DBUS_CFLAGS} ${GLIB2_CFLAGS}])
VLC_ADD_LIBS([xvmc glx omapfb],[-losso])
])
])
AC_CHECK_LIB(Xsp, XSPSetPixelDoubling,[
VLC_ADD_CPPFLAGS([xvideo xvmc glx],[-DHAVE_XSP])
VLC_ADD_LIBS([xvideo xvmc glx],[-lXsp])
VLC_ADD_CPPFLAGS([xvmc glx],[-DHAVE_XSP])
VLC_ADD_LIBS([xvmc glx],[-lXsp])
])
dnl
......
SOURCES_xvideo = \
xvideo.c \
xcommon.c \
xcommon.h \
$(NULL)
SOURCES_glx = \
glx.c \
xcommon.c \
......
......@@ -64,16 +64,13 @@
# include <X11/extensions/dpms.h>
#endif
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
# include <X11/extensions/Xv.h>
# include <X11/extensions/Xvlib.h>
#endif
#ifdef MODULE_NAME_IS_glx
# include <GL/glx.h>
#endif
#ifdef MODULE_NAME_IS_xvmc
# include <X11/extensions/Xv.h>
# include <X11/extensions/Xvlib.h>
# include <X11/extensions/vldXvMC.h>
# include "../../codec/xvmc/accel_xvmc.h"
#endif
......@@ -117,12 +114,9 @@ static void CreateCursor ( vout_thread_t * );
static void DestroyCursor ( vout_thread_t * );
static void ToggleCursor ( vout_thread_t * );
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
static int XVideoGetPort ( vout_thread_t *, vlc_fourcc_t, picture_heap_t * );
static void XVideoReleasePort( vout_thread_t *, int );
#endif
#ifdef MODULE_NAME_IS_xvmc
static void RenderVideo ( vout_thread_t *, picture_t * );
static int xvmc_check_yv12( Display *display, XvPortID port );
static void xvmc_update_XV_DOUBLE_BUFFER( vout_thread_t *p_vout );
......@@ -154,8 +148,6 @@ int Activate ( vlc_object_t *p_this )
char * psz_display;
#if defined(MODULE_NAME_IS_xvmc)
char *psz_value;
#endif
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
char * psz_chroma;
vlc_fourcc_t i_chroma = 0;
bool b_chroma = 0;
......@@ -204,7 +196,7 @@ int Activate ( vlc_object_t *p_this )
/* Get a screen ID matching the XOpenDisplay return value */
p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
psz_chroma = config_GetPsz( p_vout, "xvideo-chroma" );
if( psz_chroma )
{
......@@ -441,9 +433,7 @@ void Deactivate ( vlc_object_t *p_this )
ToggleCursor( p_vout );
}
#if defined(MODULE_NAME_IS_xvideo)
XVideoReleasePort( p_vout, p_vout->p_sys->i_xvport );
#elif defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
if( p_vout->p_sys->xvmc_cap )
{
xvmc_context_writer_lock( &p_vout->p_sys->xvmc_lock );
......@@ -763,7 +753,7 @@ static int InitVideo( vout_thread_t *p_vout )
I_OUTPUTPICTURES = 0;
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
/* Initialize the output structure; we already found an XVideo port,
* and the corresponding chroma we will be using. Since we can
* arbitrary scale, stick to the coordinates and aspect. */
......@@ -1217,43 +1207,7 @@ static int ManageVideo( vout_thread_t *p_vout )
/* Handle events for video output sub-window */
while( XCheckWindowEvent( p_vout->p_sys->p_display,
p_vout->p_sys->window.video_window,
ExposureMask, &xevent ) == True )
{
/* Window exposed (only handled if stream playback is paused) */
if( xevent.type == Expose )
{
if( ((XExposeEvent *)&xevent)->count == 0 )
{
/* (if this is the last a collection of expose events...) */
#if defined(MODULE_NAME_IS_xvideo)
x11_window_t *p_win = &p_vout->p_sys->window;
/* Paint the colour key if needed */
if( p_vout->p_sys->b_paint_colourkey &&
xevent.xexpose.window == p_win->video_window )
{
XSetForeground( p_vout->p_sys->p_display,
p_win->gc, p_vout->p_sys->i_colourkey );
XFillRectangle( p_vout->p_sys->p_display,
p_win->video_window, p_win->gc, 0, 0,
p_win->i_width, p_win->i_height );
}
#endif
#if 0
if( p_vout->p_libvlc->p_input_bank->pp_input[0] != NULL )
{
if( PAUSE_S == p_vout->p_libvlc->p_input_bank->pp_input[0]
->stream.control.i_status )
{
/* XVideoDisplay( p_vout )*/;
}
}
#endif
}
}
}
ExposureMask, &xevent ) == True );
/* ClientMessage event - only WM_PROTOCOLS with WM_DELETE_WINDOW data
* are handled - according to the man pages, the format is always 32
......@@ -1919,7 +1873,7 @@ static void ToggleCursor( vout_thread_t *p_vout )
}
}
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
/*****************************************************************************
* XVideoGetPort: get YUV12 port
*****************************************************************************/
......@@ -1971,11 +1925,7 @@ static int XVideoGetPort( vout_thread_t *p_vout,
}
i_selected_port = -1;
#ifdef MODULE_NAME_IS_xvmc
i_requested_adaptor = config_GetInt( p_vout, "xvmc-adaptor" );
#else
i_requested_adaptor = config_GetInt( p_vout, "xvideo-adaptor" );
#endif
for( i_adaptor = 0; i_adaptor < i_num_adaptors; ++i_adaptor )
{
XvImageFormatValues *p_formats;
......@@ -2162,15 +2112,6 @@ static int InitDisplay( vout_thread_t *p_vout )
msg_Dbg( p_vout, "XShm video extension disabled" );
#endif
#ifdef MODULE_NAME_IS_xvideo
/* XXX The brightness and contrast values should be read from environment
* XXX variables... */
#if 0
XVideoSetAttribute( p_vout, "XV_BRIGHTNESS", 0.5 );
XVideoSetAttribute( p_vout, "XV_CONTRAST", 0.5 );
#endif
#endif
return VLC_SUCCESS;
}
......@@ -2193,10 +2134,7 @@ IMAGE_TYPE * CreateShmImage( vout_thread_t *p_vout,
Status result;
/* Create XImage / XvImage */
#ifdef MODULE_NAME_IS_xvideo
p_image = XvShmCreateImage( p_display, i_xvport, i_chroma, 0,
i_width, i_height, p_shm );
#elif defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
p_image = XvShmCreateImage( p_display, i_xvport, i_chroma, 0,
i_width, i_height, p_shm );
#endif
......@@ -2271,40 +2209,6 @@ IMAGE_TYPE * CreateShmImage( vout_thread_t *p_vout,
}
#endif
/*****************************************************************************
* CreateImage: create an XImage or XvImage
*****************************************************************************
* Create a simple image used as a buffer.
*****************************************************************************/
static IMAGE_TYPE * CreateImage( vout_thread_t *p_vout,
Display *p_display, EXTRA_ARGS,
int i_width, int i_height )
{
uint8_t * p_data; /* image data storage zone */
IMAGE_TYPE *p_image;
/* Allocate memory for image */
#ifdef MODULE_NAME_IS_xvideo
p_data = malloc( i_width * i_height * i_bits_per_pixel / 8 );
#endif
if( !p_data )
return NULL;
/* Create XImage. p_data will be automatically freed */
#ifdef MODULE_NAME_IS_xvideo
p_image = XvCreateImage( p_display, i_xvport, i_chroma,
(char *)p_data, i_width, i_height );
#endif
if( p_image == NULL )
{
msg_Err( p_vout, "XCreateImage() failed" );
free( p_data );
return NULL;
}
return p_image;
}
#endif
/*****************************************************************************
* X11ErrorHandler: replace error handler so we can intercept some of them
......
......@@ -27,7 +27,7 @@
/*****************************************************************************
* Defines
*****************************************************************************/
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
# define IMAGE_TYPE XvImage
# define EXTRA_ARGS int i_xvport, int i_chroma, int i_bits_per_pixel
# define EXTRA_ARGS_SHM int i_xvport, int i_chroma, XShmSegmentInfo *p_shm
......@@ -219,7 +219,7 @@ struct vout_sys_t
int i_shm_opcode; /* shared memory extension opcode */
#endif
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
int i_xvport;
bool b_paint_colourkey;
int i_colourkey;
......@@ -359,9 +359,7 @@ typedef struct mwmhints_t
/*****************************************************************************
* Chroma defines
*****************************************************************************/
#ifdef MODULE_NAME_IS_xvideo
# define MAX_DIRECTBUFFERS (VOUT_MAX_PICTURES)
#elif defined(MODULE_NAME_IS_xvmc)
#if defined(MODULE_NAME_IS_xvmc)
# define MAX_DIRECTBUFFERS (VOUT_MAX_PICTURES+2)
#else
# define MAX_DIRECTBUFFERS 2
......
/*****************************************************************************
* xvideo.c : Xvideo plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 the VideoLAN team
* $Id$
*
* Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
* David Kennedy <dkennedy@tinytoad.com>
*
* 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_plugin.h>
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
extern int Activate ( vlc_object_t * );
extern void Deactivate ( vlc_object_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
#define ADAPTOR_TEXT N_("XVideo adaptor number")
#define ADAPTOR_LONGTEXT N_( \
"If your graphics card provides several adaptors, you need to choose " \
"which one will be used (you shouldn't have to change this).")
#define DISPLAY_TEXT N_("X11 display")
#define DISPLAY_LONGTEXT N_( \
"X11 hardware display to use. By default VLC will " \
"use the value of the DISPLAY environment variable.")
#define CHROMA_TEXT N_("XVimage chroma format")
#define CHROMA_LONGTEXT N_( \
"Force the XVideo renderer to use a specific chroma format instead of " \
"trying to improve performances by using the most efficient one.")
#define SHM_TEXT N_("Use shared memory")
#define SHM_LONGTEXT N_( \
"Use shared memory to communicate between VLC and the X server.")
vlc_module_begin ()
set_shortname( "XVideo" )
set_category( CAT_VIDEO )
set_subcategory( SUBCAT_VIDEO_VOUT )
add_string( "xvideo-display", NULL, NULL, DISPLAY_TEXT, DISPLAY_LONGTEXT, true )
add_integer( "xvideo-adaptor", -1, NULL, ADAPTOR_TEXT, ADAPTOR_LONGTEXT, true )
add_string( "xvideo-chroma", NULL, NULL, CHROMA_TEXT, CHROMA_LONGTEXT, true )
#ifdef HAVE_SYS_SHM_H
add_bool( "xvideo-shm", 1, NULL, SHM_TEXT, SHM_LONGTEXT, true )
#endif
set_description( N_("XVideo extension video output") )
set_capability( "video output", 150 )
set_callbacks( Activate, Deactivate )
vlc_module_end ()
/* following functions are local */
#if 0
/*****************************************************************************
* XVideoSetAttribute
*****************************************************************************
* This function can be used to set attributes, e.g. XV_BRIGHTNESS and
* XV_CONTRAST. "f_value" should be in the range of 0 to 1.
*****************************************************************************/
static void XVideoSetAttribute( vout_thread_t *p_vout,
char *attr_name, float f_value )
{
int i_attrib;
XvAttribute *p_attrib;
Display *p_display = p_vout->p_sys->p_display;
int i_xvport = p_vout->p_sys->i_xvport;
p_attrib = XvQueryPortAttributes( p_display, i_xvport, &i_attrib );
do
{
i_attrib--;
if( i_attrib >= 0 && !strcmp( p_attrib[ i_attrib ].name, attr_name ) )
{
int i_sv = f_value * ( p_attrib[ i_attrib ].max_value
- p_attrib[ i_attrib ].min_value + 1 )
+ p_attrib[ i_attrib ].min_value;
XvSetPortAttribute( p_display, i_xvport,
XInternAtom( p_display, attr_name, False ), i_sv );
break;
}
} while( i_attrib > 0 );
if( p_attrib )
XFree( p_attrib );
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment