Commit 176465d2 authored by Sam Hocevar's avatar Sam Hocevar

  * ./configure.in: fix for obscure architectures like hppa where target_os
    isn't properly detected.
  * ./include/video_output.h: got rid of pf_setpalette; I'll find a nicer way.
  * ./plugins/mga.c: fixed MGA module compilation. Doesn't work yet, though.
parent aea6698d
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -292,7 +292,17 @@ if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
fi
ARCH=${target_cpu}
dnl
dnl Check the CPU
dnl
case x"${target_cpu}" in
x)
ARCH=unknown
;;
*)
ARCH=${target_cpu}
;;
esac
dnl
dnl default modules
......@@ -396,39 +406,43 @@ AC_CACHE_CHECK([if linker needs -framework vecLib],
if test x"$ac_cv_ld_altivec" != x"no"; then
LIB_IDCTALTIVEC="${LIB_IDCTALTIVEC} -framework vecLib"
LIB_MOTIONALTIVEC="${LIB_MOTIONALTIVEC} -framework vecLib"
LIB="${LIB} -framework vecLib"
fi
dnl
dnl Check the operating system
dnl
case ${target_os} in
linux*)
case x"${target_os}" in
x)
SYS=unknown
;;
xlinux*)
SYS=linux
;;
bsdi*)
xbsdi*)
SYS=bsdi
;;
darwin*)
xdarwin*)
SYS=darwin
;;
*mingw32*)
x*mingw32*)
SYS=mingw32
AC_CHECK_TOOL(WINDRES, windres, :)
LIB_MPEG_TS="-lws2_32"
LIB_RC="-lws2_32"
;;
*nto*)
x*nto*)
SYS=nto
LIB_X11="${LIB_X11} -lsocket"
LIB_XVIDEO="${LIB_XVIDEO} -lsocket"
;;
beos)
xbeos)
SYS=beos
LIB="${LIB} -lbe"
LIB_BEOS="${LIB_BEOS} -lbe -lgame -lroot -ltracker"
PLDFLAGS="${PLDFLAGS} -nostart"
;;
*)
x*)
SYS=${target_os}
;;
esac
......@@ -927,6 +941,16 @@ AC_ARG_ENABLE(fb,
PLUGINS="${PLUGINS} fb"
fi ])
dnl
dnl Linux MGA module
dnl
AC_ARG_ENABLE(mga,
[ --enable-mga Linux kernel Matrox support (default disabled)],
[ if test x$enable_mga = xyes
then
PLUGINS="${PLUGINS} mga"
fi ])
dnl
dnl GGI module
dnl
......
......@@ -2,7 +2,7 @@
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.39 2002/01/04 14:01:34 sam Exp $
* $Id: modules.h,v 1.40 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -260,8 +260,6 @@ typedef struct function_list_s
struct picture_s * );
void ( * pf_display ) ( struct vout_thread_s *,
struct picture_s * );
void ( * pf_setpalette ) ( struct vout_thread_s *,
u16 *, u16 *, u16 * );
} vout;
/* Motion compensation plugin */
......
......@@ -5,7 +5,7 @@
* thread, and destroy a previously opened video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.70 2002/01/04 14:01:34 sam Exp $
* $Id: video_output.h,v 1.71 2002/01/05 03:49:18 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -132,8 +132,6 @@ typedef struct vout_thread_s
struct picture_s * );
void ( *pf_display ) ( struct vout_thread_s *,
struct picture_s * );
void ( *pf_setpalette ) ( struct vout_thread_s *,
u16 *, u16 *, u16 * );
/* Statistics - these numbers are not supposed to be accurate, but are a
* good indication of the thread status */
......
......@@ -2,7 +2,7 @@
* vout_dummy.c: Dummy video output display method for testing purposes
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_dummy.c,v 1.15 2002/01/04 14:01:34 sam Exp $
* $Id: vout_dummy.c,v 1.16 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -77,7 +77,6 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* deinterlace.c : deinterlacer plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: deinterlace.c,v 1.3 2002/01/04 14:01:34 sam Exp $
* $Id: deinterlace.c,v 1.4 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -106,7 +106,6 @@ static void vout_getfunctions( function_list_t * p_function_list )
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* distort.c : Misc video effects plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: distort.c,v 1.5 2002/01/04 14:01:34 sam Exp $
* $Id: distort.c,v 1.6 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -114,7 +114,6 @@ static void vout_getfunctions( function_list_t * p_function_list )
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* invert.c : Invert video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: invert.c,v 1.5 2002/01/04 14:01:34 sam Exp $
* $Id: invert.c,v 1.6 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -99,7 +99,6 @@ static void vout_getfunctions( function_list_t * p_function_list )
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* transform.c : transform image plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: transform.c,v 1.4 2002/01/04 14:01:34 sam Exp $
* $Id: transform.c,v 1.5 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -107,7 +107,6 @@ static void vout_getfunctions( function_list_t * p_function_list )
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* wall.c : Wall video plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: wall.c,v 1.6 2002/01/04 14:01:34 sam Exp $
* $Id: wall.c,v 1.7 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -109,7 +109,6 @@ static void vout_getfunctions( function_list_t * p_function_list )
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
......
mga_SOURCES = mga.c vout_mga.c
mga_SOURCES = mga.c
......@@ -2,9 +2,10 @@
* mga.c : Matrox Graphic Array plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: mga.c,v 1.9 2001/12/30 07:09:55 sam Exp $
* $Id: mga.c,v 1.10 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* 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
......@@ -24,37 +25,265 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include <errno.h> /* ENOMEM */
#include <unistd.h> /* close() */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <fcntl.h> /* open() */
#include <sys/ioctl.h> /* ioctl() */
#include <sys/mman.h> /* PROT_WRITE */
#include <videolan/vlc.h>
#ifdef SYS_BSD
#include <sys/types.h> /* typedef ushort */
#endif
#include "video.h"
#include "video_output.h"
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
void _M( vout_getfunctions )( function_list_t * p_function_list );
static void vout_getfunctions( function_list_t * p_function_list );
static int vout_Probe ( probedata_t *p_data );
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_Render ( vout_thread_t *, picture_t * );
static void vout_Display ( vout_thread_t *, picture_t * );
/*****************************************************************************
* Building configuration tree
*****************************************************************************/
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for MGA module" )
ADD_COMMENT( "For now, the MGA module cannot be configured" )
MODULE_CONFIG_STOP
MODULE_INIT_START
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_VOUT;
p_module->psz_longname = "Matrox Graphic Array module";
SET_DESCRIPTION( "Matrox Graphic Array video module" )
ADD_CAPABILITY( VOUT, 10 )
ADD_SHORTCUT( "mga" )
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( vout_getfunctions )( &p_module->p_functions->vout );
vout_getfunctions( &p_module->p_functions->vout );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
/*****************************************************************************
* vout_sys_t: video output MGA method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the MGA specific properties of an output thread.
*****************************************************************************/
#ifndef __LINUX_MGAVID_H
# define __LINUX_MGAVID_H
# define MGA_VID_CONFIG _IOR('J', 1, mga_vid_config_t)
# define MGA_VID_ON _IO ('J', 2)
# define MGA_VID_OFF _IO ('J', 3)
# define MGA_G200 0x1234
# define MGA_G400 0x5678
typedef struct mga_vid_config_s
{
u32 card_type;
u32 ram_size;
u32 src_width;
u32 src_height;
u32 dest_width;
u32 dest_height;
u32 x_org;
u32 y_org;
u8 colkey_on;
u8 colkey_red;
u8 colkey_green;
u8 colkey_blue;
} mga_vid_config_t;
#endif
typedef struct vout_sys_s
{
/* MGA specific variables */
int i_fd;
int i_size;
mga_vid_config_t mga;
byte_t * p_mga_vid_base;
boolean_t b_g400;
} vout_sys_t;
#define DUMMY_WIDTH 16
#define DUMMY_HEIGHT 16
#define DUMMY_BITS_PER_PLANE 16
#define DUMMY_BYTES_PER_PIXEL 2
/*****************************************************************************
* Local prototypes
*****************************************************************************/
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void 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_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
}
/*****************************************************************************
* intf_Probe: return a score
*****************************************************************************/
static int vout_Probe( probedata_t *p_data )
{
int i_fd;
i_fd = open( "/dev/mga_vid", O_RDWR );
if( i_fd == -1 )
{
return 0;
}
close( i_fd );
return 10;
}
/*****************************************************************************
* vout_Create: allocates dummy video thread output method
*****************************************************************************
* This function allocates and initializes a dummy vout method.
*****************************************************************************/
static int vout_Create( vout_thread_t *p_vout )
{
/* 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 );
}
if( (p_vout->p_sys->i_fd = open( "/dev/mga_vid", O_RDWR )) == -1 )
{
intf_ErrMsg( "vout error: can't open MGA driver /dev/mga_vid" );
free( p_vout->p_sys );
return( 1 );
}
return( 0 );
}
/*****************************************************************************
* vout_Init: initialize dummy video thread output method
*****************************************************************************/
static int vout_Init( vout_thread_t *p_vout )
{
/* create the MGA output */
p_vout->output.i_width = p_vout->render.i_width;
p_vout->output.i_height = p_vout->render.i_height;
p_vout->output.i_aspect = p_vout->render.i_aspect;
/* FIXME: we should initialize these ones according to the streams */
p_vout->p_sys->mga.src_width = p_vout->output.i_width;
p_vout->p_sys->mga.src_height = p_vout->output.i_height;
p_vout->p_sys->mga.dest_width = 900;
p_vout->p_sys->mga.dest_height = 700;
p_vout->p_sys->mga.x_org = 50;
p_vout->p_sys->mga.y_org = 50;
p_vout->p_sys->mga.colkey_on = 0;
if( ioctl(p_vout->p_sys->i_fd, MGA_VID_CONFIG, &p_vout->p_sys->mga) )
{
intf_ErrMsg( "vout error: MGA config ioctl failed" );
}
if( p_vout->p_sys->mga.card_type == MGA_G200 )
{
intf_Msg( "vout: detected MGA G200 (%d MB Ram)",
p_vout->p_sys->mga.ram_size );
p_vout->p_sys->b_g400 = 0;
}
else
{
intf_Msg( "vout: detected MGA G400 (%d MB Ram)",
p_vout->p_sys->mga.ram_size );
p_vout->p_sys->b_g400 = 1;
}
ioctl( p_vout->p_sys->i_fd, MGA_VID_ON, 0 );
p_vout->p_sys->i_size = ( (p_vout->p_sys->mga.src_width + 31) & ~31 )
* p_vout->p_sys->mga.src_height;
p_vout->p_sys->p_mga_vid_base = mmap( 0, p_vout->p_sys->i_size
+ p_vout->p_sys->i_size / 2,
PROT_WRITE, MAP_SHARED,
p_vout->p_sys->i_fd, 0 );
memset( p_vout->p_sys->p_mga_vid_base,
0x00, p_vout->p_sys->i_size );
memset( p_vout->p_sys->p_mga_vid_base + p_vout->p_sys->i_size,
0x80, p_vout->p_sys->i_size / 2 );
return( 0 );
}
/*****************************************************************************
* vout_End: terminate dummy video thread output method
*****************************************************************************/
static void vout_End( vout_thread_t *p_vout )
{
ioctl( p_vout->p_sys->i_fd, MGA_VID_OFF, 0 );
}
/*****************************************************************************
* vout_Destroy: destroy dummy video thread output method
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
static void vout_Destroy( vout_thread_t *p_vout )
{
close( p_vout->p_sys->i_fd );
free( p_vout->p_sys );
}
/*****************************************************************************
* vout_Manage: handle dummy events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
static int vout_Manage( vout_thread_t *p_vout )
{
return( 0 );
}
/*****************************************************************************
* vout_Render: displays previously calculated output
*****************************************************************************/
static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
{
;
}
/*****************************************************************************
* vout_Display: displays previously rendered output
*****************************************************************************/
static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
{
;
}
/*****************************************************************************
* vout_mga.c: MGA video output display method
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: vout_mga.c,v 1.11 2001/12/30 07:09:55 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h> /* ENOMEM */
#include <unistd.h> /* close() */
#include <stdlib.h> /* free() */
#include <string.h> /* strerror() */
#include <fcntl.h> /* open() */
#include <sys/ioctl.h> /* ioctl() */
#include <sys/mman.h> /* PROT_WRITE */
#include <videolan/vlc.h>
#ifdef SYS_BSD
#include <sys/types.h> /* typedef ushort */
#endif
#include "video.h"
#include "video_output.h"
#include "vout_mga.h"
/*****************************************************************************
* vout_sys_t: video output MGA method descriptor
*****************************************************************************
* This structure is part of the video output thread descriptor.
* It describes the MGA specific properties of an output thread.
*****************************************************************************/
#ifndef __LINUX_MGAVID_H
# define __LINUX_MGAVID_H
# define MGA_VID_CONFIG _IOR('J', 1, mga_vid_config_t)
# define MGA_VID_ON _IO ('J', 2)
# define MGA_VID_OFF _IO ('J', 3)
# define MGA_G200 0x1234
# define MGA_G400 0x5678
typedef struct mga_vid_config_s
{
u32 card_type;
u32 ram_size;
u32 src_width;
u32 src_height;
u32 dest_width;
u32 dest_height;
u32 x_org;
u32 y_org;
u8 colkey_on;
u8 colkey_red;
u8 colkey_green;
u8 colkey_blue;
} mga_vid_config_t;
#endif
typedef struct vout_sys_s
{
int i_page_size;
byte_t *p_video;
/* MGA specific variables */
int i_fd;
int i_size;
mga_vid_config_t mga;
byte_t * p_mga_vid_base;
boolean_t b_g400;
} vout_sys_t;
#define DUMMY_WIDTH 16
#define DUMMY_HEIGHT 16
#define DUMMY_BITS_PER_PLANE 16
#define DUMMY_BYTES_PER_PIXEL 2
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * );
static int vout_Init ( struct vout_thread_s * );
static void vout_End ( struct vout_thread_s * );
static void vout_Destroy ( struct vout_thread_s * );
static int vout_Manage ( struct vout_thread_s * );
static void vout_Display ( struct vout_thread_s * );
/*****************************************************************************
* 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 = NULL;
}
/*****************************************************************************
* intf_Probe: return a score
*****************************************************************************/
static int vout_Probe( probedata_t *p_data )
{
if( TestMethod( VOUT_METHOD_VAR, "mga" ) )
{
return( 999 );
}
return( 10 );
}
/*****************************************************************************
* vout_Create: allocates dummy video thread output method
*****************************************************************************
* This function allocates and initializes a dummy vout method.
*****************************************************************************/
static int vout_Create( vout_thread_t *p_vout )
{
/* 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 );
}
if( (p_vout->p_sys->i_fd = open( "/dev/mga_vid", O_RDWR )) == -1 )
{
intf_ErrMsg( "vout error: can't open MGA driver /dev/mga_vid" );
free( p_vout->p_sys );
return( 1 );
}
p_vout->i_width = DUMMY_WIDTH;
p_vout->i_height = DUMMY_HEIGHT;
p_vout->i_screen_depth = DUMMY_BITS_PER_PLANE;
p_vout->i_bytes_per_pixel = DUMMY_BYTES_PER_PIXEL;
p_vout->i_bytes_per_line = DUMMY_WIDTH * DUMMY_BYTES_PER_PIXEL;
p_vout->p_sys->i_page_size = DUMMY_WIDTH * DUMMY_HEIGHT
* DUMMY_BYTES_PER_PIXEL;
/* Map two framebuffers a the very beginning of the fb */
p_vout->p_sys->p_video = malloc( 2 * p_vout->p_sys->i_page_size );
if( p_vout->p_sys->p_video == NULL )
{
intf_ErrMsg( "vout error: can't map video memory (%s)",
strerror(errno) );
free( p_vout->p_sys );
return( 1 );
}
/* Set and initialize buffers */
p_vout->pf_setbuffers( p_vout, p_vout->p_sys->p_video,
p_vout->p_sys->p_video + p_vout->p_sys->i_page_size );
return( 0 );
}
/*****************************************************************************
* vout_Init: initialize dummy video thread output method
*****************************************************************************/
static int vout_Init( vout_thread_t *p_vout )
{
/* create the MGA output */
p_vout->p_sys->mga.src_width = p_vout->i_width;
p_vout->p_sys->mga.src_height = p_vout->i_height;
/* FIXME: we should initialize these ones according to the streams */
p_vout->p_sys->mga.dest_width = p_vout->i_width;
p_vout->p_sys->mga.dest_height = p_vout->i_height;
//p_vout->p_sys->mga?dest_width = 400;
//p_vout->p_sys->mga.dest_height = 300;
p_vout->p_sys->mga.x_org = 100;
p_vout->p_sys->mga.y_org = 100;
p_vout->p_sys->mga.colkey_on = 0;
if( ioctl(p_vout->p_sys->i_fd, MGA_VID_CONFIG, &p_vout->p_sys->mga) )
{
intf_ErrMsg("error in config ioctl");
}
if (p_vout->p_sys->mga.card_type == MGA_G200)
{
intf_Msg( "vout: detected MGA G200 (%d MB Ram)",
p_vout->p_sys->mga.ram_size );
p_vout->p_sys->b_g400 = 0;
}
else
{
intf_Msg( "vout: detected MGA G400 (%d MB Ram)",
p_vout->p_sys->mga.ram_size );
p_vout->p_sys->b_g400 = 1;
}
ioctl( p_vout->p_sys->i_fd, MGA_VID_ON, 0 );
p_vout->p_sys->i_size = ( (p_vout->p_sys->mga.src_width + 31) & ~31 )
* p_vout->p_sys->mga.src_height;
p_vout->p_sys->p_mga_vid_base = mmap( 0, p_vout->p_sys->i_size
+ p_vout->p_sys->i_size / 2,
PROT_WRITE, MAP_SHARED,
p_vout->p_sys->i_fd, 0 );
memset( p_vout->p_sys->p_mga_vid_base,
0x00, p_vout->p_sys->i_size );
memset( p_vout->p_sys->p_mga_vid_base + p_vout->p_sys->i_size,
0x80, p_vout->p_sys->i_size / 2 );
return( 0 );
}
/*****************************************************************************
* vout_End: terminate dummy video thread output method
*****************************************************************************/
static void vout_End( vout_thread_t *p_vout )
{
ioctl( p_vout->p_sys->i_fd, MGA_VID_OFF, 0 );
}
/*****************************************************************************
* vout_Destroy: destroy dummy video thread output method
*****************************************************************************
* Terminate an output method created by DummyCreateOutputMethod
*****************************************************************************/
static void vout_Destroy( vout_thread_t *p_vout )
{
close( p_vout->p_sys->i_fd );
free( p_vout->p_sys->p_video );
free( p_vout->p_sys );
}
/*****************************************************************************
* vout_Manage: handle dummy events
*****************************************************************************
* This function should be called regularly by video output thread. It manages
* console events. It returns a non null value on error.
*****************************************************************************/
static int vout_Manage( vout_thread_t *p_vout )
{
return( 0 );
}
/*****************************************************************************
* vout_Display: displays previously rendered output
*****************************************************************************
* This function send the currently rendered image to dummy image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/
static void vout_Display( vout_thread_t *p_vout )
{
;
}
/*****************************************************************************
* vout_mga.h: MGA video output display method headers
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_mga.h,v 1.3 2001/03/21 13:42:34 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* 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
* Boston, MA 02111-1307, USA.
*****************************************************************************/
#ifndef __LINUX_MGAVID_H
#define __LINUX_MGAVID_H
typedef struct mga_vid_config_s
{
u32 card_type;
u32 ram_size;
u32 src_width;
u32 src_height;
u32 dest_width;
u32 dest_height;
u32 x_org;
u32 y_org;
u8 colkey_on;
u8 colkey_red;
u8 colkey_green;
u8 colkey_blue;
} mga_vid_config_t;
#define MGA_VID_CONFIG _IOR('J', 1, mga_vid_config_t)
#define MGA_VID_ON _IO ('J', 2)
#define MGA_VID_OFF _IO ('J', 3)
#define MGA_G200 0x1234
#define MGA_G400 0x5678
#endif
......@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: vout_sdl.c,v 1.77 2002/01/05 02:22:03 sam Exp $
* $Id: vout_sdl.c,v 1.78 2002/01/05 03:49:18 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org>
......@@ -140,7 +140,6 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
......@@ -596,12 +595,9 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
SDL_LockSurface( p_vout->p_sys->p_display );
/* Choose the chroma we will try first. */
switch( p_vout->render.i_chroma )
{
case FOURCC_I420:
case FOURCC_IYUV:
p_vout->output.i_chroma = SDL_IYUV_OVERLAY;
break;
case FOURCC_YUY2:
case FOURCC_YUNV:
p_vout->output.i_chroma = SDL_YUY2_OVERLAY;
......@@ -615,6 +611,8 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
p_vout->output.i_chroma = SDL_YVYU_OVERLAY;
break;
case FOURCC_YV12:
case FOURCC_I420:
case FOURCC_IYUV:
default:
p_vout->output.i_chroma = SDL_YV12_OVERLAY;
break;
......@@ -624,6 +622,10 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
SDL_CreateYUVOverlay( 32, 32, p_vout->output.i_chroma,
p_vout->p_sys->p_display );
/* FIXME: if the first overlay we find is software, don't stop,
* because we may find a hardware one later ... */
/* If this best choice failed, fall back to other chromas */
if( p_vout->p_sys->p_overlay == NULL )
{
p_vout->output.i_chroma = SDL_IYUV_OVERLAY;
......
......@@ -2,7 +2,7 @@
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
* $Id: xcommon.c,v 1.6 2002/01/05 02:22:03 sam Exp $
* $Id: xcommon.c,v 1.7 2002/01/05 03:49:18 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -249,7 +249,6 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_render = vout_Render;
p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL;
}
/*****************************************************************************
......
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.153 2002/01/05 02:22:03 sam Exp $
* $Id: video_output.c,v 1.154 2002/01/05 03:49:18 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -132,7 +132,6 @@ vout_thread_t * vout_CreateThread ( int *pi_status,
p_vout->pf_manage = f.pf_manage;
p_vout->pf_render = f.pf_render;
p_vout->pf_display = f.pf_display;
p_vout->pf_setpalette = f.pf_setpalette;
#undef f
/* Initialize thread properties - thread id and locks will be initialized
......
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