]> git.sesse.net Git - vlc/commitdiff
* ./include/common.h: BeOS compile fixes.
authorSam Hocevar <sam@videolan.org>
Wed, 27 Feb 2002 03:47:56 +0000 (03:47 +0000)
committerSam Hocevar <sam@videolan.org>
Wed, 27 Feb 2002 03:47:56 +0000 (03:47 +0000)
  * ./plugins/beos/vout_beos.cpp: fixed BeOS video output.

include/common.h
include/threads.h
plugins/beos/vout_beos.cpp
plugins/dummy/dummy.c
plugins/dvd/input_dvd.c
plugins/filter/wall.c
src/interface/main.c
src/video_output/vout_pictures.c

index a0ff5a4e774e2b9713b9d5a7252e194bc9a9ffa2..9265e9a1786a9907f96db4710526bea13396310b 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: common.h,v 1.78 2002/02/24 22:06:50 sam Exp $
+ * $Id: common.h,v 1.79 2002/02/27 03:47:56 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -277,12 +277,12 @@ struct intf_subscription_s;
 /* PAD: PAD(n, d) = CEIL(n ,d) * d */
 #define PAD(n, d)   ( ((n) % (d)) ? ((((n) / (d)) + 1) * (d)) : (n) )
 
-/* MAX and MIN: self explanatory */
-#ifndef MAX
-#   define MAX(a, b)   ( ((a) > (b)) ? (a) : (b) )
+/* __MAX and __MIN: self explanatory */
+#ifndef __MAX
+#   define __MAX(a, b)   ( ((a) > (b)) ? (a) : (b) )
 #endif
-#ifndef MIN
-#   define MIN(a, b)   ( ((a) < (b)) ? (a) : (b) )
+#ifndef __MIN
+#   define __MIN(a, b)   ( ((a) < (b)) ? (a) : (b) )
 #endif
 
 /* MSB (big endian)/LSB (little endian) conversions - network order is always
index 706de705ed417a830435c8a1a23cb2a3214e22a5..a03da32d8955cf53b5b9241c4a01f3aa459fcb3a 100644 (file)
@@ -3,7 +3,7 @@
  * This header provides a portable threads implementation.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: threads.h,v 1.35 2002/02/25 23:59:07 sam Exp $
+ * $Id: threads.h,v 1.36 2002/02/27 03:47:56 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -44,8 +44,6 @@ int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
 #   include <cthreads.h>
 
 #elif defined( HAVE_KERNEL_SCHEDULER_H )                             /* BeOS */
-#   undef MAX
-#   undef MIN
 #   include <kernel/OS.h>
 #   include <kernel/scheduler.h>
 #   include <byteorder.h>
index 30aed8eda74e27411e9696ad0ebc76cb4db8d62e..8038ccbca3001c35c77511dfd97bfafd5fc5f787 100644 (file)
@@ -2,7 +2,7 @@
  * vout_beos.cpp: beos video output display method
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_beos.cpp,v 1.42 2002/02/24 20:51:09 gbazin Exp $
+ * $Id: vout_beos.cpp,v 1.43 2002/02/27 03:47:56 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -435,14 +435,6 @@ int vout_Create( vout_thread_t *p_vout )
             * VOUT_ASPECT_FACTOR / p_vout->render.i_aspect;
     }
 
-    /* Open and initialize device */
-    if( BeosOpenDisplay( p_vout ) )
-    {
-        intf_ErrMsg("vout error: can't open display");
-        free( p_vout->p_sys );
-        return( 1 );
-    }
-
     return( 0 );
 }
 
@@ -451,18 +443,22 @@ int vout_Create( vout_thread_t *p_vout )
  *****************************************************************************/
 int vout_Init( vout_thread_t *p_vout )
 {
-    VideoWindow *p_win = p_vout->p_sys->p_window;
-
     int i_index;
     picture_t *p_pic;
 
     I_OUTPUTPICTURES = 0;
 
+    /* Open and initialize device */
+    if( BeosOpenDisplay( p_vout ) )
+    {
+        intf_ErrMsg("vout error: can't open display");
+        return 0;
+    }
+
     p_vout->output.i_width  = p_vout->p_sys->i_width;
     p_vout->output.i_height = p_vout->p_sys->i_height;
     p_vout->output.i_aspect = p_vout->p_sys->i_width
-                               * VOUT_ASPECT_FACTOR
-                               / p_vout->p_sys->i_height;
+                               * VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
     p_vout->output.i_chroma = FOURCC_RV32;
 
     p_pic = NULL;
@@ -510,7 +506,7 @@ int vout_Init( vout_thread_t *p_vout )
  *****************************************************************************/
 void vout_End( vout_thread_t *p_vout )
 {
-    /* place code here to end the video */
+    BeosCloseDisplay( p_vout );
 }
 
 /*****************************************************************************
@@ -520,7 +516,6 @@ void vout_End( vout_thread_t *p_vout )
  *****************************************************************************/
 void vout_Destroy( vout_thread_t *p_vout )
 {
-    BeosCloseDisplay( p_vout );
     free( p_vout->p_sys );
 }
 
@@ -532,7 +527,7 @@ void vout_Destroy( vout_thread_t *p_vout )
  *****************************************************************************/
 int vout_Manage( vout_thread_t *p_vout )
 {
-    VideoWindow * p_win = p_vout->p_sys->p_window;
+//    VideoWindow * p_win = p_vout->p_sys->p_window;
     
 //    p_win->resizeIfRequired(p_vout->p_sys->pp_buffer[p_vout->p_sys->i_index].i_pic_width,
 //                            p_vout->p_sys->pp_buffer[p_vout->p_sys->i_index].i_pic_height);
@@ -575,10 +570,9 @@ void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
  *****************************************************************************/
 static int BeosOpenDisplay( vout_thread_t *p_vout )
 { 
-    p_vout->p_sys->p_window = new VideoWindow(
-            config_GetIntVariable( VOUT_WIDTH_VAR ) - 1,
-            config_GetIntVariable( VOUT_HEIGHT_VAR ) - 1,
-            p_vout );
+    p_vout->p_sys->p_window = new VideoWindow( p_vout->p_sys->i_width - 1,
+                                               p_vout->p_sys->i_height - 1,
+                                               p_vout );
 
     if( p_vout->p_sys->p_window == NULL )
     {
index 1eebbc0e71a21769953c92b29a22c6e680a27dd7..34a54943c9dbbe1a2c766e1b0c266dc6d7548f42 100644 (file)
@@ -2,7 +2,7 @@
  * dummy.c : dummy plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: dummy.c,v 1.15 2002/02/24 20:51:09 gbazin Exp $
+ * $Id: dummy.c,v 1.16 2002/02/27 03:47:56 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -48,9 +48,9 @@ MODULE_INIT_START
     SET_DESCRIPTION( "dummy functions module" )
     /* Capability score set to 0 because we don't want to be spawned
      * unless explicitly requested to */
-    ADD_CAPABILITY( AOUT, 0 )
-    ADD_CAPABILITY( VOUT, 0 )
-    ADD_CAPABILITY( INTF, 0 )
+    ADD_CAPABILITY( AOUT, 1 )
+    ADD_CAPABILITY( VOUT, 1 )
+    ADD_CAPABILITY( INTF, 1 )
     /* This one is ok. */
     ADD_CAPABILITY( INPUT, 100 )
     ADD_SHORTCUT( "dummy" )
index 8bd3061c2d0be4b20f650483867d284deb2fb174..0d0e7f0fbeb314591a228a302d3540c47921614a 100644 (file)
@@ -9,7 +9,7 @@
  *  -dvd_udf to find files
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.121 2002/02/24 20:51:09 gbazin Exp $
+ * $Id: input_dvd.c,v 1.122 2002/02/27 03:47:56 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -1072,12 +1072,12 @@ static void DVDSeek( input_thread_t * p_input, off_t i_off )
      * can be very wide out of such zones */
     if( title.p_cell_play[p_dvd->i_prg_cell].i_category & 0xf000 )
     {
-        p_dvd->i_sector = MAX(
+        p_dvd->i_sector = __MAX(
                 cell.i_start_sector,
                 title.p_cell_play[p_dvd->i_prg_cell].i_start_sector );
     }
 
-    p_dvd->i_end_sector = MIN(
+    p_dvd->i_end_sector = __MIN(
             cell.i_end_sector,
             title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
 #undef cell
@@ -1193,10 +1193,10 @@ static int DVDFindSector( thread_dvd_data_t * p_dvd )
     
     /* Find start and end sectors of new cell */
 #if 1
-    p_dvd->i_sector = MAX(
+    p_dvd->i_sector = __MAX(
          p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_start_sector,
          title.p_cell_play[p_dvd->i_prg_cell].i_start_sector );
-    p_dvd->i_end_sector = MIN(
+    p_dvd->i_end_sector = __MIN(
          p_dvd->p_ifo->vts.cell_inf.p_cell_map[p_dvd->i_cell].i_end_sector,
          title.p_cell_play[p_dvd->i_prg_cell].i_end_sector );
 #else
index 7d2d2883b6076ece221f56b15c234c5193370255..edcd1e80629c1c66ed795f607ca07a455fe9837b 100644 (file)
@@ -2,7 +2,7 @@
  * wall.c : Wall video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: wall.c,v 1.13 2002/02/24 20:51:09 gbazin Exp $
+ * $Id: wall.c,v 1.14 2002/02/27 03:47:56 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -197,8 +197,8 @@ static int vout_Create( vout_thread_t *p_vout )
         psz_method = NULL;
     }
 
-    p_vout->p_sys->i_col = MAX( 1, MIN( 15, p_vout->p_sys->i_col ) );
-    p_vout->p_sys->i_row = MAX( 1, MIN( 15, p_vout->p_sys->i_row ) );
+    p_vout->p_sys->i_col = __MAX( 1, __MIN( 15, p_vout->p_sys->i_col ) );
+    p_vout->p_sys->i_row = __MAX( 1, __MIN( 15, p_vout->p_sys->i_row ) );
 
     intf_WarnMsg( 3, "filter info: opening a %i x %i wall",
                   p_vout->p_sys->i_col, p_vout->p_sys->i_row );
index 12f3302fe4f9864c31ebd81d829992f060107d5a..a067d45572affa48272cb273312056d22f94e748 100644 (file)
@@ -4,7 +4,7 @@
  * and spawn threads.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.156 2002/02/26 18:25:40 gbazin Exp $
+ * $Id: main.c,v 1.157 2002/02/27 03:47:56 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -278,7 +278,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
 
     p_main->i_warning_level = 0;
 
-
 #if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
     /*
      * Support for getext
@@ -377,7 +376,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     intf_WarnMsg( 2, "module: module bank initialized, found %i modules",
                   p_module_bank->i_count );
 
-
     /* Check for help on plugins */
     if( (p_tmp = config_GetPszVariable( "pluginhelp" )) )
     {
@@ -712,12 +710,12 @@ static int GetConfigurationFromCmdLine( int *pi_argc, char *ppsz_argv[],
         {
             /* A long option has been recognized */
 
-            module_config_t *p_config;
+            module_config_t *p_conf;
 
             /* Store the configuration option */
-            p_config = config_FindConfig( p_longopts[i_index].name );
+            p_conf = config_FindConfig( p_longopts[i_index].name );
 
-            switch( p_config->i_type )
+            switch( p_conf->i_type )
             {
             case MODULE_CONFIG_ITEM_STRING:
             case MODULE_CONFIG_ITEM_FILE:
index fde53fd6c79afbb84a5194c86fcac3fbc3b376bf..fb0851e021af6dee4c0830f46007b485eeca2de4 100644 (file)
@@ -2,7 +2,7 @@
  * vout_pictures.c : picture management functions
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: vout_pictures.c,v 1.16 2002/02/19 00:50:20 sam Exp $
+ * $Id: vout_pictures.c,v 1.17 2002/02/27 03:47:56 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -376,8 +376,8 @@ void vout_PlacePicture( vout_thread_t *p_vout, int i_width, int i_height,
     }
     else
     {
-        *pi_width = MIN( i_width, p_vout->render.i_width );
-        *pi_height = MIN( i_height, p_vout->render.i_height );
+        *pi_width = __MIN( i_width, p_vout->render.i_width );
+        *pi_height = __MIN( i_height, p_vout->render.i_height );
     }
 
     if( VOUT_ASPECT_FACTOR * *pi_width / *pi_height < p_vout->render.i_aspect )