* ./modules/video_output/wingdi.c: the GDI video output now properly sets
authorSam Hocevar <sam@videolan.org>
Sat, 23 Nov 2002 02:40:30 +0000 (02:40 +0000)
committerSam Hocevar <sam@videolan.org>
Sat, 23 Nov 2002 02:40:30 +0000 (02:40 +0000)
    the bitmasks; we're not limited to 8bpp and 16/24 works.
  * ./modules/video_filter/*: the video filters now work under WinCE.

evc/vlc.vcw
modules/video_filter/clone.c
modules/video_filter/crop.c
modules/video_filter/distort.c
modules/video_filter/invert.c
modules/video_filter/motionblur.c
modules/video_filter/transform.c
modules/video_filter/wall.c
modules/video_output/wingdi.c

index 450597d..57e37ee 100644 (file)
@@ -63,6 +63,30 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
+Project: "plugin_clone"=.\plugin_clone.vcp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
+Project: "plugin_distort"=.\plugin_distort.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
@@ -171,6 +195,18 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
+Project: "plugin_invert"=.\plugin_invert.vcp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
 Project: "plugin_ipv4"=.\plugin_ipv4.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
@@ -219,6 +255,18 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
+Project: "plugin_motionblur"=.\plugin_motionblur.vcp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
 Project: "plugin_mpeg_audio"=.\plugin_mpeg_audio.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
@@ -267,6 +315,18 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
+Project: "plugin_transform"=.\plugin_transform.vcp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
 Project: "plugin_trivial_channel_mixer"=.\plugin_trivial_channel_mixer.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
@@ -339,6 +399,18 @@ Package=<4>
 \r
 ###############################################################################\r
 \r
+Project: "plugin_wall"=.\plugin_wall.vcp - Package Owner=<4>\r
+\r
+Package=<5>\r
+{{{\r
+}}}\r
+\r
+Package=<4>\r
+{{{\r
+}}}\r
+\r
+###############################################################################\r
+\r
 Project: "plugin_wav"=.\plugin_wav.vcp - Package Owner=<4>\r
 \r
 Package=<5>\r
index 0607658..9210b04 100644 (file)
@@ -2,7 +2,7 @@
  * clone.c : Clone video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: clone.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: clone.c,v 1.2 2002/11/23 02:40:30 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -24,7 +24,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
index 7e67482..56b0fca 100644 (file)
@@ -2,7 +2,7 @@
  * crop.c : Crop video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: crop.c,v 1.2 2002/08/26 09:12:46 sam Exp $
+ * $Id: crop.c,v 1.3 2002/11/23 02:40:30 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -24,7 +24,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
index dbc830b..05f5b7c 100644 (file)
@@ -2,7 +2,7 @@
  * distort.c : Misc video effects plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: distort.c,v 1.2 2002/08/26 09:12:46 sam Exp $
+ * $Id: distort.c,v 1.3 2002/11/23 02:40:30 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -24,7 +24,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
@@ -306,10 +305,10 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
         for( i_line = 0 ; i_line < i_num_lines ; i_line++ )
         {
             /* Calculate today's offset, don't go above 1/20th of the screen */
-            i_offset = (double)(p_inpic->p[i_index].i_pitch)
+            i_offset = (int)( (double)(p_inpic->p[i_index].i_pitch)
                          * sin( f_angle + 10.0 * (double)i_line
                                                / (double)i_num_lines )
-                         / 20.0;
+                         / 20.0 );
 
             if( i_offset )
             {
@@ -381,13 +380,13 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
         for( i_line = i_first_line ; i_line < i_num_lines ; i_line++ )
         {
             /* Calculate today's offset, don't go above 1/20th of the screen */
-            i_offset = (double)(p_inpic->p[i_index].i_pitch)
+            i_offset = (int)( (double)(p_inpic->p[i_index].i_pitch)
                          * sin( f_angle + 2.0 * (double)i_line
                                               / (double)( 1 + i_line
                                                             - i_first_line) )
                          * (double)(i_line - i_first_line)
                          / (double)i_num_lines
-                         / 8.0;
+                         / 8.0 );
 
             if( i_offset )
             {
index 1cbe350..1d9e62d 100644 (file)
@@ -2,7 +2,7 @@
  * invert.c : Invert video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: invert.c,v 1.1 2002/08/04 17:23:43 sam Exp $
+ * $Id: invert.c,v 1.2 2002/11/23 02:40:30 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -24,7 +24,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
index 9120cdd..c4ede3b 100644 (file)
@@ -2,7 +2,7 @@
  * motion_blur.c : motion blur filter for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: motionblur.c,v 1.2 2002/08/27 21:53:54 sigmunau Exp $
+ * $Id: motionblur.c,v 1.3 2002/11/23 02:40:30 sam Exp $
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
  *
@@ -24,7 +24,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
index 7a8891c..76d1e1e 100644 (file)
@@ -2,7 +2,7 @@
  * transform.c : transform image plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: transform.c,v 1.2 2002/08/26 09:12:46 sam Exp $
+ * $Id: transform.c,v 1.3 2002/11/23 02:40:30 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -24,7 +24,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
index f3a79e2..19d8343 100644 (file)
@@ -2,7 +2,7 @@
  * wall.c : Wall video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: wall.c,v 1.2 2002/08/26 09:12:46 sam Exp $
+ * $Id: wall.c,v 1.3 2002/11/23 02:40:30 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -24,7 +24,6 @@
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
-#include <errno.h>
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
index 66bee45..6176d08 100755 (executable)
@@ -2,7 +2,7 @@
  * wingdi.c : Win32 / WinCE GDI video output plugin for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: wingdi.c,v 1.3 2002/11/22 20:27:19 sam Exp $
+ * $Id: wingdi.c,v 1.4 2002/11/23 02:40:30 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -67,8 +67,12 @@ struct vout_sys_t
     /* Our offscreen bitmap and its framebuffer */
     HDC        off_dc;
     HBITMAP    off_bitmap;
-    BITMAPINFO bitmapinfo;
     uint8_t *  p_buffer;
+
+    BITMAPINFO bitmapinfo;
+    RGBQUAD    red;
+    RGBQUAD    green;
+    RGBQUAD    blue;
 };
 
 /*****************************************************************************
@@ -255,18 +259,24 @@ 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 */
     HDC hdc;
-    int y;
+    int i_src_bytes, i_dest_bytes;
 
     hdc = GetDC( p_vout->p_sys->window );
     SelectObject( p_vout->p_sys->off_dc, p_vout->p_sys->off_bitmap );
 
     /* Stupid GDI is upside-down */
-    for( y = p_pic->p->i_lines ; y-- ; )
+    i_src_bytes = p_pic->p->i_lines * p_pic->p->i_pitch;
+    i_dest_bytes = 0;
+
+    while( i_src_bytes )
     {
-        memcpy( p_vout->p_sys->p_buffer
-                         + p_pic->p->i_pitch * (p_pic->p->i_lines-y),
-                p_pic->p->p_pixels + p_pic->p->i_pitch * y,
-                p_pic->p->i_pitch );
+        i_src_bytes -= p_pic->p->i_pitch;
+
+        p_vout->p_vlc->pf_memcpy( p_vout->p_sys->p_buffer + i_dest_bytes,
+                                  p_pic->p->p_pixels + i_src_bytes,
+                                  p_pic->p->i_visible_pitch );
+
+        i_dest_bytes += p_pic->p->i_pitch;
     }
 
     BitBlt( hdc, 0, 0, p_vout->output.i_width, p_vout->output.i_height,
@@ -433,7 +443,8 @@ static long FAR PASCAL WndProc ( HWND hWnd, UINT message,
  *****************************************************************************/
 static void InitBuffers( vout_thread_t *p_vout )
 {
-    BITMAPINFOHEADER *p_header = &p_vout->p_sys->bitmapinfo.bmiHeader;
+    BITMAPINFOHEADER * p_header = &p_vout->p_sys->bitmapinfo.bmiHeader;
+    BITMAPINFO *       p_info = &p_vout->p_sys->bitmapinfo;
     int   i_pixels = p_vout->render.i_height * p_vout->render.i_width;
     HDC   window_dc;
 
@@ -445,23 +456,35 @@ static void InitBuffers( vout_thread_t *p_vout )
     msg_Dbg( p_vout, "GDI depth is %i", p_vout->p_sys->i_depth );
 
     /* Initialize offscreen bitmap */
+    memset( p_info, 0, sizeof( BITMAPINFO ) + 3 * sizeof( RGBQUAD ) );
+
     p_header->biSize = sizeof( BITMAPINFOHEADER );
     p_header->biPlanes = 1;
-    p_header->biCompression = BI_RGB;
     switch( p_vout->p_sys->i_depth )
     {
         case 8:
             p_header->biBitCount = 8;
             p_header->biSizeImage = i_pixels;
+            p_header->biCompression = BI_RGB;
+            /* FIXME: we need a palette here */
             break;
         case 24:
+        case 32:
             p_header->biBitCount = 32;
             p_header->biSizeImage = i_pixels * 4;
+            p_header->biCompression = BI_BITFIELDS;
+            ((DWORD*)p_info->bmiColors)[0] = 0x00ff0000;
+            ((DWORD*)p_info->bmiColors)[1] = 0x0000ff00;
+            ((DWORD*)p_info->bmiColors)[2] = 0x000000ff;
             break;
         case 16:
         default:
             p_header->biBitCount = 16;
             p_header->biSizeImage = i_pixels * 2;
+            p_header->biCompression = BI_BITFIELDS;
+            ((DWORD*)p_info->bmiColors)[0] = 0x00007c00;
+            ((DWORD*)p_info->bmiColors)[1] = 0x000003e0;
+            ((DWORD*)p_info->bmiColors)[2] = 0x0000001f;
             break;
     }
     p_header->biWidth = p_vout->render.i_width;