]> git.sesse.net Git - vlc/commitdiff
* ./modules/video_output/wingdi.c: skeleton of a Windows GDI video output.
authorSam Hocevar <sam@videolan.org>
Thu, 21 Nov 2002 13:53:32 +0000 (13:53 +0000)
committerSam Hocevar <sam@videolan.org>
Thu, 21 Nov 2002 13:53:32 +0000 (13:53 +0000)
  * ./modules/access/file.c: the file access plugin gets the real file size
    under WinCE.
  * ./modules/audio_filter/converter/u8tofixed32.c: added this conversion
    filter to play some WAV files without an FPU.
  * ./bootstrap: bootstrap --update-vc doesn't rely on the Makefile's presence.

bootstrap
configure.ac.in
evc/vlc.c
evc/vlc.vcw
modules/access/file.c
modules/audio_filter/converter/Modules.am
modules/audio_filter/converter/u8tofixed32.c [new file with mode: 0644]
modules/demux/wav/wav.c
modules/video_output/Modules.am
modules/video_output/wingdi.c [new file with mode: 0755]

index d34dfa6c3786a94c34f491a910d89ae6419de023..34bbae6c1862645c27b3505013a7958126eabc11 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 ##  bootstrap file for vlc, the VideoLAN Client
-##  $Id: bootstrap,v 1.32 2002/11/20 19:07:26 sam Exp $
+##  $Id: bootstrap,v 1.33 2002/11/21 13:53:31 sam Exp $
 ##
 ##  Authors: Samuel Hocevar <sam@zoy.org>
 
@@ -79,10 +79,12 @@ then
   #  The evil ^M
   M='\r'
 
-  #  Sources that get built under Win32
-  LIBVLC_SOURCES=`make show-libvlc-sources | grep '^X: ' | cut -b3-`
-  LIBVLC_HEADERS=`make show-libvlc-headers | grep '^X: ' | cut -b3-`
-  LIBVLC_PKG_HEADERS=`make show-libvlc-pkg-headers | grep '^X: ' | cut -b3-`
+  #  Sources that get built under Win32 - FIXME: anyone wanna deuglify this? :)
+  LIBVLC_SOURCES=`awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_common'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | tr '\\ ' '\n\n' | sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p';  awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_win32'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | tr '\\ ' '\n\n' | sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'; awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_dirent'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | tr '\\ ' '\n\n' | sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'; awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_getopt'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | tr '\\ ' '\n\n' | sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'; awk 'BEGIN{a=0}{if(!a&&/^'SOURCES_libvlc_libc'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | tr '\\ ' '\n\n' | sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'`
+
+  LIBVLC_HEADERS=`awk 'BEGIN{a=0}{if(!a&&/^'HEADERS_include'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | tr '\\ ' '\n\n' | sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'; awk 'BEGIN{a=0}{if(!a&&/^'HEADERS_include_built'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | tr '\\ ' '\n\n' | sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'`
+
+  LIBVLC_PKG_HEADERS=`awk 'BEGIN{a=0}{if(!a&&/^'dist_pkginclude_HEADERS'[^-_a-zA-Z0-9]*=/){a=1;print$0;next;}if(a){if(/^[a-zA-Z]/){exit;}print $0}}' < Makefile.am | tr '\\ ' '\n\n' | sed -ne 's/[^$-_a-zA-Z0-9][^$-_a-zA-Z0-9]*\([a-zA-Z]\)/\1/p'`
 
   # Clean up
   rm -f evc/*.vcp msvc/*.dsp
index 11498d1cff95e236885442a93d3bbfbc2ea688fd..b51bb3607f3fddf76a66d06c54213c93a4c36f56 100644 (file)
@@ -597,7 +597,7 @@ PLUGINS="${PLUGINS} idct idctclassic motion mpeg_video spudec mpeg_audio"
 #PLUGINS="${PLUGINS} a52old imdct downmix"
 PLUGINS="${PLUGINS} lpcm a52"
 PLUGINS="${PLUGINS} deinterlace invert yuv wall transform distort clone crop motionblur"
-PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofloat32"
+PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32"
 PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler"
 PLUGINS="${PLUGINS} trivial_channel_mixer"
 PLUGINS="${PLUGINS} trivial_mixer spdif_mixer float32_mixer"
index e9c0bbb544c21cd753fef470248b8c58cd38fb68..12cd02b7be4f8085f094dfd9e16acf7222ee0606 100644 (file)
--- a/evc/vlc.c
+++ b/evc/vlc.c
@@ -2,7 +2,7 @@
  * vlc.c: the vlc player, WinCE version
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: vlc.c,v 1.4 2002/11/20 16:43:32 sam Exp $
+ * $Id: vlc.c,v 1.5 2002/11/21 13:53:31 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -52,8 +52,8 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
                     LPTSTR lpCmdLine, int nCmdShow )
 {
     int    i_ret;
-    int    i_argc = 5;
-    char * ppsz_argv[] = { lpCmdLine, "-vv", "--intf", "dummy", "shovel.mpeg", /*"washington.mpeg",*/ NULL };
+    int    i_argc = 4;
+    char * ppsz_argv[] = { lpCmdLine, "-vv", "--intf", "dummy", NULL, NULL };
     HWND   window;
     MSG    message;
 
@@ -63,10 +63,17 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
     char     psz_title[100];
     wchar_t  pwz_title[100];
 
+    i_argc = 5;
+    ppsz_argv[4] = "washington.mpeg";
+    ppsz_argv[4] = "shovel.mpeg";
+    ppsz_argv[4] = "11h50.wav";
+    ppsz_argv[4] = "apple_promouse.mpeg";
+
     /* Store our instance for future reference */
     hInst = hInstance;
 
     /* Register window class */
+    memset( &wc, 0, sizeof(wc) );
     wc.style          = CS_HREDRAW | CS_VREDRAW;
     wc.lpfnWndProc    = (WNDPROC) WndProc;
     wc.cbClsExtra     = 0;
@@ -86,10 +93,10 @@ int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
 
     /* Create our nice window */
     window = CreateWindow( L"VLC", pwz_title,
-                           WS_VISIBLE | WS_SIZEBOX | WS_CAPTION,
+                           WS_VISIBLE /*| WS_SIZEBOX | WS_CAPTION*/,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            //CW_USEDEFAULT, CW_USEDEFAULT, 
-                           200,100,
+                           200,200,
                            NULL, NULL, hInst, NULL );
 
     ShowWindow( window, nCmdShow );
@@ -192,10 +199,18 @@ static long FAR PASCAL WndProc ( HWND hWnd, UINT message,
 {
     HDC hdc;
     int wmId, wmEvent;
+    int x, y;
     PAINTSTRUCT ps;
 
     switch( message )
     {
+        case WM_LBUTTONDOWN:
+            x = LOWORD(lParam);
+            y = HIWORD(lParam);
+            hdc = GetDC(hWnd);
+            Rectangle(hdc, x-4, y-4, x+4, y+4);
+            ReleaseDC(hWnd, hdc);
+            break;
         case WM_COMMAND:
             wmId    = LOWORD(wParam);
             wmEvent = HIWORD(wParam);
index 48f020c3f8535377da50d9febfe921eb27431d2c..450597d25c381481396566f9de824286d373896a 100644 (file)
@@ -51,6 +51,18 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
+Project: "plugin_araw"=.\plugin_araw.vcp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
 Project: "plugin_dummy"=.\plugin_dummy.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
@@ -255,7 +267,7 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
-Project: "plugin_spudec"=.\plugin_spudec.vcp - Package Owner=<4>\r
+Project: "plugin_trivial_channel_mixer"=.\plugin_trivial_channel_mixer.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
 {{{\r
@@ -267,7 +279,7 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
-Project: "plugin_trivial_channel_mixer"=.\plugin_trivial_channel_mixer.vcp - Package Owner=<4>\r
+Project: "plugin_trivial_mixer"=.\plugin_trivial_mixer.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
 {{{\r
@@ -279,7 +291,7 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
-Project: "plugin_trivial_mixer"=.\plugin_trivial_mixer.vcp - Package Owner=<4>\r
+Project: "plugin_trivial_resampler"=.\plugin_trivial_resampler.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
 {{{\r
@@ -291,7 +303,7 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
-Project: "plugin_trivial_resampler"=.\plugin_trivial_resampler.vcp - Package Owner=<4>\r
+Project: "plugin_ts"=.\plugin_ts.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
 {{{\r
@@ -303,7 +315,7 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
-Project: "plugin_ts"=.\plugin_ts.vcp - Package Owner=<4>\r
+Project: "plugin_u8tofixed32"=.\plugin_u8tofixed32.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
 {{{\r
@@ -327,6 +339,18 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
+Project: "plugin_wav"=.\plugin_wav.vcp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
 Project: "plugin_waveout"=.\plugin_waveout.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
@@ -339,6 +363,18 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
+Project: "plugin_wingdi"=.\plugin_wingdi.vcp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
 Project: "vlc"=.\vlc.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
@@ -347,75 +383,6 @@ Package=<5>
 \r
 Package=<4>\r
 {{{\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_a52tospdif\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_access_file\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_dummy\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_es\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_fixed32tofloat32\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_fixed32tos16\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_i420_rgb\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_i420_yuy2\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_i422_yuy2\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_idct\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_idctclassic\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_linear_resampler\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_memcpy\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_motion\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_mpeg_audio\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_mpeg_system\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_mpeg_video\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_ps\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_trivial_channel_mixer\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_trivial_mixer\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_trivial_resampler\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_ts\r
-    End Project Dependency\r
-    Begin Project Dependency\r
-    Project_Dep_Name plugin_waveout\r
-    End Project Dependency\r
     Begin Project Dependency\r
     Project_Dep_Name libvlc\r
     End Project Dependency\r
index 1714b79971c00274518bab546f6c6b4b38317919..bb54cdcf919f557412307abc34630506e3d64f90 100644 (file)
@@ -2,7 +2,7 @@
  * file.c: file input (file: access plug-in)
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: file.c,v 1.4 2002/11/20 13:37:35 sam Exp $
+ * $Id: file.c,v 1.5 2002/11/21 13:53:32 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -123,7 +123,13 @@ static int Open( vlc_object_t *p_this )
             p_input->stream.b_seekable = 0;
             p_input->stream.p_selected_area->i_size = 0;
         }
-#ifdef HAVE_SYS_STAT_H
+#ifdef UNDER_CE
+        else if( VLC_TRUE )
+        {
+            /* We'll update i_size after it's been opened */
+            p_input->stream.b_seekable = 1;
+        }
+#elif defined( HAVE_SYS_STAT_H )
         else if( S_ISREG(stat_info.st_mode) || S_ISCHR(stat_info.st_mode)
                   || S_ISBLK(stat_info.st_mode) )
         {
@@ -139,13 +145,13 @@ static int Open( vlc_object_t *p_this )
             p_input->stream.b_seekable = 0;
             p_input->stream.p_selected_area->i_size = 0;
         }
+#endif
         else
         {
             vlc_mutex_unlock( &p_input->stream.stream_lock );
             msg_Err( p_input, "unknown file type for `%s'", psz_name );
             return VLC_EGENERIC;
         }
-#endif
     }
  
     p_input->stream.p_selected_area->i_tell = 0;
@@ -181,6 +187,8 @@ static int Open( vlc_object_t *p_this )
             free( p_access_data );
             return VLC_EGENERIC;
         }
+        p_input->stream.p_selected_area->i_size =
+                        GetFileSize( (HANDLE)p_access_data->i_handle, NULL );
 #else
         p_access_data->i_handle = open( psz_name,
                                         /*O_NONBLOCK | O_LARGEFILE*/ 0 );
index 4f8d0aecd9f02d126fa527e40c8534da25dc5834..664d9ae8a057d7d6b18bc5f529ebbb3fdb1ae329 100644 (file)
@@ -9,4 +9,5 @@ SOURCES_fixed32tofloat32 = modules/audio_filter/converter/fixed32tofloat32.c
 SOURCES_s16tofloat32 = modules/audio_filter/converter/s16tofloat32.c
 SOURCES_s16tofloat32swab = modules/audio_filter/converter/s16tofloat32swab.c
 SOURCES_s8tofloat32 = modules/audio_filter/converter/s8tofloat32.c
+SOURCES_u8tofixed32 = modules/audio_filter/converter/u8tofixed32.c
 SOURCES_u8tofloat32 = modules/audio_filter/converter/u8tofloat32.c
diff --git a/modules/audio_filter/converter/u8tofixed32.c b/modules/audio_filter/converter/u8tofixed32.c
new file mode 100644 (file)
index 0000000..e76c515
--- /dev/null
@@ -0,0 +1,95 @@
+/*****************************************************************************
+ * u8tofixed32.c : converter from unsigned 8 bits integer to fixed32.
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: u8tofixed32.c,v 1.1 2002/11/21 13:53:32 sam Exp $
+ *
+ * Authors: 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 <stdlib.h>                                      /* malloc(), free() */
+#include <string.h>
+
+#include <vlc/vlc.h>
+#include "audio_output.h"
+#include "aout_internal.h"
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int  Create    ( vlc_object_t * );
+
+static void DoWork    ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
+                        aout_buffer_t * );
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+    set_description( _("audio filter for u8->fixed32 conversion") );
+    set_capability( "audio filter", 1 );
+    set_callbacks( Create, NULL );
+vlc_module_end();
+
+/*****************************************************************************
+ * Create: create and initialize converter
+ *****************************************************************************/
+static int Create( vlc_object_t *p_this )
+{
+    aout_filter_t * p_filter = (aout_filter_t *)p_this;
+
+    if ( p_filter->input.i_format != VLC_FOURCC('u','8',' ',' ')
+          || p_filter->output.i_format != VLC_FOURCC('f','i','3','2') )
+    {
+        return -1;
+    }
+
+    if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
+    {
+        return -1;
+    }
+
+    p_filter->pf_do_work = DoWork;
+    p_filter->b_in_place = VLC_TRUE;
+
+    return 0;
+}
+
+/*****************************************************************************
+ * DoWork: convert a buffer
+ *****************************************************************************/
+static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
+                    aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
+{
+    int i = p_in_buf->i_nb_samples * aout_FormatNbChannels( &p_filter->input );
+
+    /* We start from the end because b_in_place is true */
+    u8 * p_in = (u8 *)p_in_buf->p_buffer + i - 1;
+    vlc_fixed_t * p_out = (vlc_fixed_t *)p_out_buf->p_buffer + i - 1;
+
+    while( i-- )
+    {
+        *p_out = (vlc_fixed_t)( (int32_t)(*p_in - 128) * (FIXED32_ONE / 128) );
+        p_in--; p_out--;
+    }
+
+    p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
+    p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * sizeof(vlc_fixed_t);
+}
index 69dbae880a059ca3a6e541406b7c15aa038ac54f..92436a73801a2b92cbf9e119af70a8f4fc562727 100644 (file)
@@ -2,7 +2,7 @@
  * wav.c : wav file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: wav.c,v 1.2 2002/10/26 19:14:46 fenrir Exp $
+ * $Id: wav.c,v 1.3 2002/11/21 13:53:32 sam Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
  * This program is free software; you can redistribute it and/or modify
@@ -25,8 +25,6 @@
  *****************************************************************************/
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>                                              /* strdup() */
-#include <errno.h>
-#include <sys/types.h>
 
 #include <vlc/vlc.h>
 #include <vlc/input.h>
index ee01bb89f1ebc4b6c04f54162edec025fdbf4e08..a384a24d2f238084a081efe5808ea6b6c1d3a7ca 100644 (file)
@@ -4,3 +4,4 @@ SOURCES_ggi = modules/video_output/ggi.c
 SOURCES_glide = modules/video_output/glide.c
 SOURCES_vout_sdl = modules/video_output/sdl.c
 SOURCES_svgalib = modules/video_output/svgalib.c
+SOURCES_wingdi = modules/video_output/wingdi.c
diff --git a/modules/video_output/wingdi.c b/modules/video_output/wingdi.c
new file mode 100755 (executable)
index 0000000..c300e95
--- /dev/null
@@ -0,0 +1,181 @@
+/*****************************************************************************
+ * wingdi.c : Win32 / WinCE GDI video output plugin for vlc
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: wingdi.c,v 1.1 2002/11/21 13:53:32 sam Exp $
+ *
+ * Authors: 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 <stdlib.h>                                      /* malloc(), free() */
+#include <string.h>
+
+#include <vlc/vlc.h>
+#include <vlc/vout.h>
+
+#define MAX_DIRECTBUFFERS 10
+
+/*****************************************************************************
+ * Local prototypes
+ *****************************************************************************/
+static int  OpenVideo  ( vlc_object_t * );
+static void CloseVideo ( vlc_object_t * );
+
+static int  Init      ( vout_thread_t * );
+static void End       ( vout_thread_t * );
+static int  Manage    ( vout_thread_t * );
+static void Render    ( vout_thread_t *, picture_t * );
+static void Display   ( vout_thread_t *, picture_t * );
+
+/*****************************************************************************
+ * Module descriptor
+ *****************************************************************************/
+vlc_module_begin();
+    set_description( _("Windows GDI video output module") );
+    set_capability( "video output", 10 );
+    set_callbacks( OpenVideo, CloseVideo );
+vlc_module_end();
+
+/*****************************************************************************
+ * OpenVideo: activate GDI video thread output method
+ *****************************************************************************/
+static int OpenVideo ( vlc_object_t *p_this )
+{
+    vout_thread_t * p_vout = (vout_thread_t *)p_this;
+
+    p_vout->pf_init = Init;
+    p_vout->pf_end = End;
+    p_vout->pf_manage = Manage;
+    p_vout->pf_render = Render;
+    p_vout->pf_display = Display;
+
+    return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * CloseVideo: deactivate the GDI video output
+ *****************************************************************************/
+static void CloseVideo ( vlc_object_t *p_this )
+{
+    ;
+}
+
+/*****************************************************************************
+ * Init: initialize video thread output method
+ *****************************************************************************/
+static int Init( vout_thread_t *p_vout )
+{
+    int i_index;
+    picture_t *p_pic;
+
+    I_OUTPUTPICTURES = 0;
+
+    /* Initialize the output structure */
+    p_vout->output.i_chroma = VLC_FOURCC('R','V','1','6');
+    p_vout->output.i_rmask  = 0xf800;
+    p_vout->output.i_gmask  = 0x07e0;
+    p_vout->output.i_bmask  = 0x001f;
+    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;
+
+    /* Try to initialize MAX_DIRECTBUFFERS direct buffers */
+    while( I_OUTPUTPICTURES < MAX_DIRECTBUFFERS )
+    {
+        p_pic = NULL;
+
+        /* Find an empty picture slot */
+        for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
+        {
+            if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
+            {
+                p_pic = p_vout->p_picture + i_index;
+                break;
+            }
+        }
+
+        /* Allocate the picture */
+        if( p_pic == NULL )
+        {
+            break;
+        }
+
+        vout_AllocatePicture( p_vout, p_pic, p_vout->output.i_width,
+                              p_vout->output.i_height,
+                              p_vout->output.i_chroma );
+
+        if( p_pic->i_planes == 0 )
+        {
+            break;
+        }
+
+        p_pic->i_status = DESTROYED_PICTURE;
+        p_pic->i_type   = DIRECT_PICTURE;
+
+        PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
+
+        I_OUTPUTPICTURES++;
+    }
+
+    return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * End: terminate video thread output method
+ *****************************************************************************/
+static void End( vout_thread_t *p_vout )
+{
+    int i_index;
+
+    /* Free the fake output buffers we allocated */
+    for( i_index = I_OUTPUTPICTURES ; i_index ; )
+    {
+        i_index--;
+        free( PP_OUTPUTPICTURE[ i_index ]->p_data_orig );
+    }
+}
+
+/*****************************************************************************
+ * Manage: handle 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 Manage( vout_thread_t *p_vout )
+{
+    return VLC_SUCCESS;
+}
+
+/*****************************************************************************
+ * Render: render previously calculated output
+ *****************************************************************************/
+static void Render( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    /* No need to do anything, the fake direct buffers stay as they are */
+}
+
+/*****************************************************************************
+ * Display: displays previously rendered output
+ *****************************************************************************/
+static void Display( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    /* No need to do anything, the fake direct buffers stay as they are */
+}
+