Commit 922a7a8e authored by Gildas Bazin's avatar Gildas Bazin

* modules/audio_output/waveout.c: compilation fix for --disable-plugins build.
* src/video_output/*, include/video.h: added a pf_lock/unlock fonction
   pointer that's used to lock the memory of a picture in vout_RenderPicture
   when required by the video output plugin.
* modules/video_output/directx/*: implemented pf_lock/unlock. That will fix
   the crash when pressing ctrl+alt+del.
parent f2de4386
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* includes all common video types and constants. * includes all common video types and constants.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video.h,v 1.61 2002/11/25 19:29:10 sam Exp $ * $Id: video.h,v 1.62 2003/03/28 17:02:25 gbazin Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -80,6 +80,10 @@ struct picture_t ...@@ -80,6 +80,10 @@ struct picture_t
/* The picture heap we are attached to */ /* The picture heap we are attached to */
picture_heap_t* p_heap; picture_heap_t* p_heap;
/* Some vouts require the picture to be locked before it can be modified */
int (* pf_lock) ( vout_thread_t *, picture_t * );
int (* pf_unlock) ( vout_thread_t *, picture_t * );
/* Private data - the video output plugin might want to put stuff here to /* Private data - the video output plugin might want to put stuff here to
* keep track of the picture */ * keep track of the picture */
picture_sys_t * p_sys; picture_sys_t * p_sys;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* waveout.c : Windows waveOut plugin for vlc * waveout.c : Windows waveOut plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2001 VideoLAN * Copyright (C) 2001 VideoLAN
* $Id: waveout.c,v 1.19 2003/02/20 16:07:38 gbazin Exp $ * $Id: waveout.c,v 1.20 2003/03/28 17:02:25 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -93,14 +93,14 @@ typedef struct { ...@@ -93,14 +93,14 @@ typedef struct {
#endif #endif
#include <initguid.h> #include <initguid.h>
#ifndef KSDATAFORMAT_SUBTYPE_IEEE_FLOAT #ifndef KKSDATAFORMAT_SUBTYPE_IEEE_FLOAT
DEFINE_GUID( KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, WAVE_FORMAT_IEEE_FLOAT, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); DEFINE_GUID( KKSDATAFORMAT_SUBTYPE_IEEE_FLOAT, WAVE_FORMAT_IEEE_FLOAT, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
#endif #endif
#ifndef KSDATAFORMAT_SUBTYPE_PCM #ifndef KKSDATAFORMAT_SUBTYPE_PCM
DEFINE_GUID( KSDATAFORMAT_SUBTYPE_PCM, WAVE_FORMAT_PCM, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); DEFINE_GUID( KKSDATAFORMAT_SUBTYPE_PCM, WAVE_FORMAT_PCM, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
#endif #endif
#ifndef KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF #ifndef KKSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF
DEFINE_GUID( KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF, WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 ); DEFINE_GUID( KKSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF, WAVE_FORMAT_DOLBY_AC3_SPDIF, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 );
#endif #endif
/***************************************************************************** /*****************************************************************************
...@@ -480,7 +480,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, int i_format, ...@@ -480,7 +480,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, int i_format,
waveformat.Samples.wValidBitsPerSample = waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample; waveformat.Format.wBitsPerSample;
waveformat.Format.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF; waveformat.Format.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF;
waveformat.SubFormat = KSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF; waveformat.SubFormat = KKSDATAFORMAT_SUBTYPE_DOLBY_AC3_SPDIF;
break; break;
case VLC_FOURCC('f','l','3','2'): case VLC_FOURCC('f','l','3','2'):
...@@ -488,7 +488,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, int i_format, ...@@ -488,7 +488,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, int i_format,
waveformat.Samples.wValidBitsPerSample = waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample; waveformat.Format.wBitsPerSample;
waveformat.Format.wFormatTag = WAVE_FORMAT_IEEE_FLOAT; waveformat.Format.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
waveformat.SubFormat = KSDATAFORMAT_SUBTYPE_IEEE_FLOAT; waveformat.SubFormat = KKSDATAFORMAT_SUBTYPE_IEEE_FLOAT;
break; break;
case VLC_FOURCC('s','1','6','l'): case VLC_FOURCC('s','1','6','l'):
...@@ -496,7 +496,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, int i_format, ...@@ -496,7 +496,7 @@ static int OpenWaveOut( aout_instance_t *p_aout, int i_format,
waveformat.Samples.wValidBitsPerSample = waveformat.Samples.wValidBitsPerSample =
waveformat.Format.wBitsPerSample; waveformat.Format.wBitsPerSample;
waveformat.Format.wFormatTag = WAVE_FORMAT_PCM; waveformat.Format.wFormatTag = WAVE_FORMAT_PCM;
waveformat.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; waveformat.SubFormat = KKSDATAFORMAT_SUBTYPE_PCM;
break; break;
} }
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout.h: Windows DirectX video output header file * vout.h: Windows DirectX video output header file
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout.h,v 1.3 2002/10/25 18:17:59 sam Exp $ * $Id: vout.h,v 1.4 2003/03/28 17:02:25 gbazin Exp $
* *
* Authors: Gildas Bazin <gbazin@netcourrier.com> * Authors: Gildas Bazin <gbazin@netcourrier.com>
* *
...@@ -54,6 +54,7 @@ struct vout_sys_t ...@@ -54,6 +54,7 @@ struct vout_sys_t
vlc_bool_t b_using_overlay; /* Are we using an overlay surface */ vlc_bool_t b_using_overlay; /* Are we using an overlay surface */
vlc_bool_t b_use_sysmem; /* Should we use system memory for surfaces */ vlc_bool_t b_use_sysmem; /* Should we use system memory for surfaces */
vlc_bool_t b_hw_yuv; /* Should we use hardware YUV->RGB conversions */ vlc_bool_t b_hw_yuv; /* Should we use hardware YUV->RGB conversions */
vlc_bool_t b_3buf_overlay; /* Should we use triple buffered overlays */
/* size of the display */ /* size of the display */
RECT rect_display; RECT rect_display;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.216 2003/03/25 17:07:45 gbazin Exp $ * $Id: video_output.c,v 1.217 2003/03/28 17:02:25 gbazin Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -288,6 +288,8 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, ...@@ -288,6 +288,8 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
* will be initialized later in InitThread */ * will be initialized later in InitThread */
for( i_index = 0; i_index < 2 * VOUT_MAX_PICTURES; i_index++) for( i_index = 0; i_index < 2 * VOUT_MAX_PICTURES; i_index++)
{ {
p_vout->p_picture[i_index].pf_lock = NULL;
p_vout->p_picture[i_index].pf_unlock = NULL;
p_vout->p_picture[i_index].i_status = FREE_PICTURE; p_vout->p_picture[i_index].i_status = FREE_PICTURE;
p_vout->p_picture[i_index].i_type = EMPTY_PICTURE; p_vout->p_picture[i_index].i_type = EMPTY_PICTURE;
} }
...@@ -796,7 +798,7 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -796,7 +798,7 @@ static void RunThread( vout_thread_t *p_vout)
/* /*
* Call the plugin-specific rendering method if there is one * Call the plugin-specific rendering method if there is one
*/ */
if( p_picture != NULL && p_vout->pf_render ) if( p_picture != NULL && p_directbuffer != NULL && p_vout->pf_render )
{ {
/* Render the direct buffer returned by vout_RenderPicture */ /* Render the direct buffer returned by vout_RenderPicture */
p_vout->pf_render( p_vout, p_directbuffer ); p_vout->pf_render( p_vout, p_directbuffer );
...@@ -805,7 +807,7 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -805,7 +807,7 @@ static void RunThread( vout_thread_t *p_vout)
/* /*
* Sleep, wake up * Sleep, wake up
*/ */
if( display_date != 0 ) if( display_date != 0 && p_directbuffer != NULL )
{ {
/* Store render time using a sliding mean */ /* Store render time using a sliding mean */
p_vout->render_time += mdate() - current_date; p_vout->render_time += mdate() - current_date;
...@@ -832,7 +834,7 @@ static void RunThread( vout_thread_t *p_vout) ...@@ -832,7 +834,7 @@ static void RunThread( vout_thread_t *p_vout)
/* /*
* Display the previously rendered picture * Display the previously rendered picture
*/ */
if( p_picture != NULL ) if( p_picture != NULL && p_directbuffer != NULL )
{ {
/* Display the direct buffer returned by vout_RenderPicture */ /* Display the direct buffer returned by vout_RenderPicture */
if( p_vout->pf_display ) if( p_vout->pf_display )
......
...@@ -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.35 2003/03/10 18:26:33 gbazin Exp $ * $Id: vout_pictures.c,v 1.36 2003/03/28 17:02:25 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>
...@@ -330,10 +330,23 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -330,10 +330,23 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
/* Picture is not in a direct buffer, but is exactly the /* Picture is not in a direct buffer, but is exactly the
* same size as the direct buffers. A memcpy() is enough, * same size as the direct buffers. A memcpy() is enough,
* then render the subtitles. */ * then render the subtitles. */
if( PP_OUTPUTPICTURE[0]->pf_lock )
if( PP_OUTPUTPICTURE[0]->pf_lock( p_vout, PP_OUTPUTPICTURE[0] ) )
{
if( PP_OUTPUTPICTURE[0]->pf_unlock )
PP_OUTPUTPICTURE[0]->pf_unlock( p_vout, PP_OUTPUTPICTURE[0] );
return NULL;
}
CopyPicture( p_vout, p_pic, PP_OUTPUTPICTURE[0] ); CopyPicture( p_vout, p_pic, PP_OUTPUTPICTURE[0] );
vout_RenderSubPictures( p_vout, PP_OUTPUTPICTURE[0], p_subpic ); vout_RenderSubPictures( p_vout, PP_OUTPUTPICTURE[0], p_subpic );
if( PP_OUTPUTPICTURE[0]->pf_unlock )
PP_OUTPUTPICTURE[0]->pf_unlock( p_vout, PP_OUTPUTPICTURE[0] );
return PP_OUTPUTPICTURE[0]; return PP_OUTPUTPICTURE[0];
} }
...@@ -342,12 +355,19 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, ...@@ -342,12 +355,19 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
* well. This usually means software YUV, or hardware YUV with a * well. This usually means software YUV, or hardware YUV with a
* different chroma. */ * different chroma. */
if( p_vout->p_picture[0].pf_lock )
if( p_vout->p_picture[0].pf_lock( p_vout, &p_vout->p_picture[0] ) )
return NULL;
/* Convert image to the first direct buffer */ /* Convert image to the first direct buffer */
p_vout->chroma.pf_convert( p_vout, p_pic, &p_vout->p_picture[0] ); p_vout->chroma.pf_convert( p_vout, p_pic, &p_vout->p_picture[0] );
/* Render subpictures on the first direct buffer */ /* Render subpictures on the first direct buffer */
vout_RenderSubPictures( p_vout, &p_vout->p_picture[0], p_subpic ); vout_RenderSubPictures( p_vout, &p_vout->p_picture[0], p_subpic );
if( p_vout->p_picture[0].pf_unlock )
p_vout->p_picture[0].pf_unlock( p_vout, &p_vout->p_picture[0] );
return &p_vout->p_picture[0]; return &p_vout->p_picture[0];
} }
......
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