Commit 4416b2cb authored by Gildas Bazin's avatar Gildas Bazin

* major rewrite of the directx video plugin to adapt it to the new vout4
    architecture. This plugin has also been through a major clean-up
    and it is now much more robust and optimized.

* Fixed a few problems with the win32 build.

* Replaced the "overlay" command line option with "nooverlay". The
    former was confusing and useless because overlays were used by
    default anyway.
parent 338b73f4
...@@ -354,8 +354,8 @@ ...@@ -354,8 +354,8 @@
#define VOUT_FULLSCREEN_DEFAULT 0 #define VOUT_FULLSCREEN_DEFAULT 0
/* Environment variable for overlay mode, and default value */ /* Environment variable for overlay mode, and default value */
#define VOUT_OVERLAY_VAR "vlc_overlay" #define VOUT_NOOVERLAY_VAR "vlc_nooverlay"
#define VOUT_OVERLAY_DEFAULT 0 #define VOUT_NOOVERLAY_DEFAULT 0
/* Default gamma */ /* Default gamma */
#define VOUT_GAMMA_VAR "vlc_gamma" #define VOUT_GAMMA_VAR "vlc_gamma"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_directx.c: Windows DirectX audio output method * aout_directx.c: Windows DirectX audio output method
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: aout_directx.c,v 1.14 2001/12/30 07:09:54 sam Exp $ * $Id: aout_directx.c,v 1.15 2002/01/17 23:02:45 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -41,6 +41,14 @@ ...@@ -41,6 +41,14 @@
#include "audio_output.h" /* aout_thread_t */ #include "audio_output.h" /* aout_thread_t */
/*****************************************************************************
* DirectSound GUIDs.
* Defining them here allows us to get rid of the dxguid library during
* the linking stage.
*****************************************************************************/
#include <initguid.h>
DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
/***************************************************************************** /*****************************************************************************
* aout_sys_t: directx audio output method descriptor * aout_sys_t: directx audio output method descriptor
***************************************************************************** *****************************************************************************
...@@ -120,10 +128,6 @@ void _M( aout_getfunctions )( function_list_t * p_function_list ) ...@@ -120,10 +128,6 @@ void _M( aout_getfunctions )( function_list_t * p_function_list )
static int aout_Probe( probedata_t *p_data ) static int aout_Probe( probedata_t *p_data )
{ {
/* For now just assume the computer has a sound device */ /* For now just assume the computer has a sound device */
if( TestMethod( AOUT_METHOD_VAR, "directx" ) )
{
return( 999 );
}
return( 1 ); return( 1 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* directx.c : Windows DirectX plugin for vlc * directx.c : Windows DirectX plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: directx.c,v 1.4 2001/12/30 07:09:54 sam Exp $ * $Id: directx.c,v 1.5 2002/01/17 23:02:45 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -44,15 +44,15 @@ void _M( vout_getfunctions )( function_list_t * p_function_list ); ...@@ -44,15 +44,15 @@ void _M( vout_getfunctions )( function_list_t * p_function_list );
* Building configuration tree * Building configuration tree
*****************************************************************************/ *****************************************************************************/
MODULE_CONFIG_START MODULE_CONFIG_START
ADD_WINDOW( "Configuration for Windows DirectX module" ) ADD_WINDOW( "Configuration for Windows DirectX module" )
ADD_COMMENT( "For now, the Windows DirectX module cannot be configured" ) ADD_COMMENT( "For now, the Windows DirectX module cannot be configured" )
MODULE_CONFIG_STOP MODULE_CONFIG_STOP
MODULE_INIT_START MODULE_INIT_START
p_module->i_capabilities = MODULE_CAPABILITY_NULL SET_DESCRIPTION( "DirectX extension module" )
| MODULE_CAPABILITY_VOUT ADD_CAPABILITY( AOUT, 150 )
| MODULE_CAPABILITY_AOUT; ADD_CAPABILITY( VOUT, 150 )
p_module->psz_longname = "DirectX module"; ADD_SHORTCUT( "directx" )
MODULE_INIT_STOP MODULE_INIT_STOP
MODULE_ACTIVATE_START MODULE_ACTIVATE_START
...@@ -62,4 +62,3 @@ MODULE_ACTIVATE_STOP ...@@ -62,4 +62,3 @@ MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP MODULE_DEACTIVATE_STOP
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_directx.h: Windows DirectX video output header file * vout_directx.h: Windows DirectX video output header file
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_directx.h,v 1.1 2001/07/11 14:26:19 gbazin Exp $ * $Id: vout_directx.h,v 1.2 2002/01/17 23:02:45 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -32,28 +32,42 @@ typedef struct vout_sys_s ...@@ -32,28 +32,42 @@ typedef struct vout_sys_s
LPDIRECTDRAW2 p_ddobject; /* DirectDraw object */ LPDIRECTDRAW2 p_ddobject; /* DirectDraw object */
LPDIRECTDRAWSURFACE3 p_display; /* Display device */ LPDIRECTDRAWSURFACE3 p_display; /* Display device */
LPDIRECTDRAWSURFACE3 p_surface; /* surface where we display the video */ LPDIRECTDRAWSURFACE3 p_current_surface; /* surface currently displayed */
LPDIRECTDRAWCLIPPER p_clipper; /* clipper used for blitting */ LPDIRECTDRAWCLIPPER p_clipper; /* clipper used for blitting */
HINSTANCE hddraw_dll; /* handle of the opened ddraw dll */ HINSTANCE hddraw_dll; /* handle of the opened ddraw dll */
HBRUSH hbrush; /* window backgound brush (color) */ HBRUSH hbrush; /* window backgound brush (color) */
HWND hwnd; /* Handle of the main window */ HWND hwnd; /* Handle of the main window */
int i_image_width; /* size of the decoded image */ boolean_t b_using_overlay; /* Are we using an overlay surface */
int i_image_height;
int i_window_width; /* size of the displayed image */
int i_window_height;
int i_colorkey; /* colorkey used to display the overlay */ /* size of the display */
RECT rect_display;
boolean_t b_display_enabled; int i_display_depth;
boolean_t b_cursor;
/* Window position and size */
int i_window_x;
int i_window_y;
int i_window_width;
int i_window_height;
/* Coordinates of src and dest images (used when blitting to display) */
RECT rect_src;
RECT rect_src_clipped;
RECT rect_dest;
RECT rect_dest_clipped;
u16 i_changes; /* changes made to the video display */ /* DDraw capabilities */
int b_caps_overlay_clipping;
boolean_t b_cursor_autohidden; int i_rgb_colorkey; /* colorkey in RGB used by the overlay */
mtime_t i_lastmoved; int i_colorkey; /* colorkey used by the overlay */
boolean_t b_cursor;
u16 i_changes; /* changes made to the video display */
char *p_directx_buf[2]; /* Buffer information */ boolean_t b_cursor_autohidden;
mtime_t i_lastmoved;
vlc_thread_t event_thread_id; /* event thread */ vlc_thread_t event_thread_id; /* event thread */
vlc_mutex_t event_thread_lock; /* lock for the event thread */ vlc_mutex_t event_thread_lock; /* lock for the event thread */
...@@ -64,6 +78,19 @@ typedef struct vout_sys_s ...@@ -64,6 +78,19 @@ typedef struct vout_sys_s
} vout_sys_t; } vout_sys_t;
/*****************************************************************************
* picture_sys_t: direct buffer method descriptor
*****************************************************************************
* This structure is part of the picture descriptor, it describes the
* DirectX specific properties of a direct buffer.
*****************************************************************************/
typedef struct picture_sys_s
{
LPDIRECTDRAWSURFACE3 p_surface;
DDSURFACEDESC ddsd;
} picture_sys_t;
/***************************************************************************** /*****************************************************************************
* Prototypes from vout_directx.c * Prototypes from vout_directx.c
*****************************************************************************/ *****************************************************************************/
...@@ -72,3 +99,4 @@ typedef struct vout_sys_s ...@@ -72,3 +99,4 @@ typedef struct vout_sys_s
* Prototypes from vout_events.c * Prototypes from vout_events.c
*****************************************************************************/ *****************************************************************************/
void DirectXEventThread ( vout_thread_t *p_vout ); void DirectXEventThread ( vout_thread_t *p_vout );
void DirectXUpdateOverlay( vout_thread_t *p_vout );
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_playlist.c : Interface for the playlist dialog * gtk_playlist.c : Interface for the playlist dialog
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: gtk_playlist.c,v 1.26 2002/01/07 02:12:29 sam Exp $ * $Id: gtk_playlist.c,v 1.27 2002/01/17 23:02:45 gbazin Exp $
* *
* Authors: Pierre Baillet <oct@zoy.org> * Authors: Pierre Baillet <oct@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <sys/types.h> /* for readdir and stat stuff */ #include <sys/types.h> /* for readdir and stat stuff */
#ifndef WIN32 #if !defined( _MSC_VER )
# include <dirent.h> # include <dirent.h>
#endif #endif
......
...@@ -162,8 +162,8 @@ static int vout_Create( vout_thread_t *p_vout ) ...@@ -162,8 +162,8 @@ static int vout_Create( vout_thread_t *p_vout )
p_vout->b_fullscreen = p_vout->b_fullscreen =
main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT ); main_GetIntVariable( VOUT_FULLSCREEN_VAR, VOUT_FULLSCREEN_DEFAULT );
p_vout->p_sys->i_mode = p_vout->p_sys->i_mode =
main_GetIntVariable( VOUT_OVERLAY_VAR, VOUT_OVERLAY_DEFAULT ) ? main_GetIntVariable( VOUT_NOOVERLAY_VAR, VOUT_NOOVERLAY_DEFAULT ) ?
MODE_VIDEO_OVERLAY : MODE_NORMAL_MEM; MODE_NORMAL_MEM : MODE_VIDEO_OVERLAY;
p_vout->p_sys->dim.w = p_vout->p_sys->dim.w =
main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT ); main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT );
p_vout->p_sys->dim.h = p_vout->p_sys->dim.h =
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* and spawn threads. * and spawn threads.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: main.c,v 1.144 2002/01/09 10:22:37 sam Exp $ * $Id: main.c,v 1.145 2002/01/17 23:02:45 gbazin Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
#define OPT_HEIGHT 163 #define OPT_HEIGHT 163
#define OPT_COLOR 164 #define OPT_COLOR 164
#define OPT_FULLSCREEN 165 #define OPT_FULLSCREEN 165
#define OPT_OVERLAY 166 #define OPT_NOOVERLAY 166
#define OPT_XVADAPTOR 167 #define OPT_XVADAPTOR 167
#define OPT_SMP 168 #define OPT_SMP 168
#define OPT_FILTER 169 #define OPT_FILTER 169
...@@ -182,7 +182,7 @@ static const struct option longopts[] = ...@@ -182,7 +182,7 @@ static const struct option longopts[] =
{ "idct", 1, 0, OPT_IDCT }, { "idct", 1, 0, OPT_IDCT },
{ "yuv", 1, 0, OPT_YUV }, { "yuv", 1, 0, OPT_YUV },
{ "fullscreen", 0, 0, OPT_FULLSCREEN }, { "fullscreen", 0, 0, OPT_FULLSCREEN },
{ "overlay", 0, 0, OPT_OVERLAY }, { "nooverlay", 0, 0, OPT_NOOVERLAY },
{ "xvadaptor", 1, 0, OPT_XVADAPTOR }, { "xvadaptor", 1, 0, OPT_XVADAPTOR },
{ "smp", 1, 0, OPT_SMP }, { "smp", 1, 0, OPT_SMP },
{ "filter", 1, 0, OPT_FILTER }, { "filter", 1, 0, OPT_FILTER },
...@@ -777,8 +777,8 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -777,8 +777,8 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
case OPT_FULLSCREEN: /* --fullscreen */ case OPT_FULLSCREEN: /* --fullscreen */
main_PutIntVariable( VOUT_FULLSCREEN_VAR, 1 ); main_PutIntVariable( VOUT_FULLSCREEN_VAR, 1 );
break; break;
case OPT_OVERLAY: /* --overlay */ case OPT_NOOVERLAY: /* --nooverlay */
main_PutIntVariable( VOUT_OVERLAY_VAR, 1 ); main_PutIntVariable( VOUT_NOOVERLAY_VAR, 1 );
break; break;
case OPT_XVADAPTOR: /* --xvadaptor */ case OPT_XVADAPTOR: /* --xvadaptor */
main_PutIntVariable( VOUT_XVADAPTOR_VAR, atoi(optarg) ); main_PutIntVariable( VOUT_XVADAPTOR_VAR, atoi(optarg) );
...@@ -966,7 +966,7 @@ static void Usage( int i_fashion ) ...@@ -966,7 +966,7 @@ static void Usage( int i_fashion )
"\n --width <w>, --height <h> \tdisplay dimensions" "\n --width <w>, --height <h> \tdisplay dimensions"
"\n -g, --grayscale \tgrayscale output" "\n -g, --grayscale \tgrayscale output"
"\n --fullscreen \tfullscreen output" "\n --fullscreen \tfullscreen output"
"\n --overlay \taccelerated display" "\n --nooverlay \tdisable accelerated display"
"\n --xvadaptor <adaptor> \tXVideo adaptor" "\n --xvadaptor <adaptor> \tXVideo adaptor"
"\n --color \tcolor output" "\n --color \tcolor output"
"\n --motion <module> \tmotion compensation method" "\n --motion <module> \tmotion compensation method"
...@@ -1041,7 +1041,7 @@ static void Usage( int i_fashion ) ...@@ -1041,7 +1041,7 @@ static void Usage( int i_fashion )
"\n " VOUT_FB_DEV_VAR "=<filename> \tframebuffer device path" "\n " VOUT_FB_DEV_VAR "=<filename> \tframebuffer device path"
"\n " VOUT_GRAYSCALE_VAR "={1|0} \tgrayscale or color output" "\n " VOUT_GRAYSCALE_VAR "={1|0} \tgrayscale or color output"
"\n " VOUT_FULLSCREEN_VAR "={1|0} \tfullscreen" "\n " VOUT_FULLSCREEN_VAR "={1|0} \tfullscreen"
"\n " VOUT_OVERLAY_VAR "={1|0} \toverlay" "\n " VOUT_NOOVERLAY_VAR "={1|0} \tnooverlay"
"\n " VOUT_XVADAPTOR_VAR "=<adaptor> \tXVideo adaptor" "\n " VOUT_XVADAPTOR_VAR "=<adaptor> \tXVideo adaptor"
"\n " MOTION_METHOD_VAR "=<method name> \tmotion compensation method" "\n " MOTION_METHOD_VAR "=<method name> \tmotion compensation method"
"\n " IDCT_METHOD_VAR "=<method name> \tIDCT method" "\n " IDCT_METHOD_VAR "=<method name> \tIDCT method"
...@@ -1445,4 +1445,3 @@ static void ShowConsole( void ) ...@@ -1445,4 +1445,3 @@ static void ShowConsole( void )
#endif #endif
return; return;
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_pictures.c : picture management functions * vout_pictures.c : picture management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: vout_pictures.c,v 1.10 2002/01/12 01:25:57 sam Exp $ * $Id: vout_pictures.c,v 1.11 2002/01/17 23:02:45 gbazin Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -394,6 +394,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -394,6 +394,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
void vout_PlacePicture( vout_thread_t *p_vout, int i_width, int i_height, void vout_PlacePicture( vout_thread_t *p_vout, int i_width, int i_height,
int *pi_x, int *pi_y, int *pi_width, int *pi_height ) int *pi_x, int *pi_y, int *pi_width, int *pi_height )
{ {
if( (i_width <= 0) || (i_height <=0) )
return;
if( p_vout->b_scale ) if( p_vout->b_scale )
{ {
*pi_width = i_width; *pi_width = i_width;
......
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