]> git.sesse.net Git - vlc/commitdiff
* ./plugins/beos/vout_beos.cpp: ported the BeOS RGB video output to
authorSam Hocevar <sam@videolan.org>
Fri, 8 Feb 2002 15:57:29 +0000 (15:57 +0000)
committerSam Hocevar <sam@videolan.org>
Fri, 8 Feb 2002 15:57:29 +0000 (15:57 +0000)
    vout4. The overlay video output still needs to be written though.

configure
configure.in
include/video.h
plugins/beos/InterfaceWindow.cpp
plugins/beos/Makefile
plugins/beos/vout_beos.cpp
plugins/chroma/i420_rgb.c
src/misc/beos_specific.cpp
src/video_output/vout_pictures.c

index dd90ab180f79fcb69ce3aa52fff27c9252cd1730..b57bd6a6bc03293f91fd774010c32e885cc70cce 100755 (executable)
--- a/configure
+++ b/configure
@@ -6654,7 +6654,7 @@ fi
 
 if test x$SYS = xbeos
 then
-    BUILTINS="${BUILTINS} beos"
+    PLUGINS="${PLUGINS} beos"
 
 else
 
index 846e11cd16a4edb73cc85d9e49e9e0f627cbfd78..af905d6eddb14b9efb591a64d27b0dc6cc8c7bdd 100644 (file)
@@ -976,7 +976,7 @@ AC_ARG_WITH(mad,
 dnl special case for BeOS
 if test x$SYS = xbeos
 then
-    BUILTINS="${BUILTINS} beos"
+    PLUGINS="${PLUGINS} beos"
 
 dnl default case
 else
index c38f0e923f6426eedf2e333e20a5e41a81b5e397..52797e5d30f1db0e86facf433847d91ebcb5d35c 100644 (file)
@@ -4,7 +4,7 @@
  * includes all common video types and constants.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video.h,v 1.41 2002/01/07 02:12:29 sam Exp $
+ * $Id: video.h,v 1.42 2002/02/08 15:57:29 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -143,6 +143,7 @@ typedef struct picture_heap_s
 #define FOURCC_BI_BITFIELDS  0x00000003            /* RGB, for 16, 24, 32bpp */
 #define FOURCC_RV15          0x35315652    /* RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
 #define FOURCC_RV16          0x36315652    /* RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */
+#define FOURCC_RV32          0x32335652 /* RGB 32bpp, 0xff, 0xff00, 0xff0000 */
 
 /* Planar YUV formats */
 #define FOURCC_I420          0x30323449               /* Planar 4:2:0, Y:U:V */
index a083eee7d2c9007ec74e5dca1cb5ab16ea0fae43..bf4d064f0bdaa1f08a2d88bcac6568ccd0a295d3 100644 (file)
@@ -2,7 +2,7 @@
  * InterfaceWindow.cpp: beos interface
  *****************************************************************************
  * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: InterfaceWindow.cpp,v 1.11 2001/12/30 07:09:54 sam Exp $
+ * $Id: InterfaceWindow.cpp,v 1.12 2002/02/08 15:57:29 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -153,9 +153,9 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
     BAlert *alert;
 
     Activate();
-    if (p_intf->p_input)
+    if (p_input_bank->pp_input[0])
     {
-           playback_status = p_intf->p_input->stream.control.i_status;
+           playback_status = p_input_bank->pp_input[0]->stream.control.i_status;
        }
        else
        {
@@ -197,9 +197,9 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                       "dvd:%s", psz_device );
             psz_source[ strlen(psz_source) ] = '\0';
             intf_PlaylistAdd( p_main->p_playlist, PLAYLIST_END, (char*)psz_source );
-            if( p_intf->p_input != NULL )
+            if( p_input_bank->pp_input[0] != NULL )
             {
-                p_intf->p_input->b_eof = 1;
+                p_input_bank->pp_input[0]->b_eof = 1;
             }
             intf_PlaylistJumpto( p_main->p_playlist, 
                                  p_main->p_playlist->i_size - 1 );
@@ -208,7 +208,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
 
     case STOP_PLAYBACK:
         // this currently stops playback not nicely
-        if( p_intf->p_input != NULL )
+        if( p_input_bank->pp_input[0] != NULL )
         {
             // silence the sound, otherwise very horrible
             vlc_mutex_lock( &p_aout_bank->lock );
@@ -221,7 +221,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
             snooze( 400000 );
 
             /* end playing item */
-            p_intf->p_input->b_eof = 1;
+            p_input_bank->pp_input[0]->b_eof = 1;
             
             /* update playlist */
             vlc_mutex_lock( &p_main->p_playlist->change_lock );
@@ -237,7 +237,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
 
     case PAUSE_PLAYBACK:
         /* toggle between pause and play */
-        if( p_intf->p_input != NULL )
+        if( p_input_bank->pp_input[0] != NULL )
         {
             /* pause if currently playing */
             if( playback_status == PLAYING_S )
@@ -254,7 +254,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                 snooze( 400000 );
                 
                 /* pause the movie */
-                input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE );
+                input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PAUSE );
                 vlc_mutex_lock( &p_main->p_playlist->change_lock );
                 p_main->p_playlist->b_stopped = 0;
                 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
@@ -274,7 +274,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                 snooze( 400000 );
                 
                 /* Start playing */
-                input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+                input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
                 p_main->p_playlist->b_stopped = 0;
             }
         }
@@ -301,7 +301,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
 
     case FASTER_PLAY:
         /* cycle the fast playback modes */
-        if( p_intf->p_input != NULL )
+        if( p_input_bank->pp_input[0] != NULL )
         {
             /* mute the sound */
             vlc_mutex_lock( &p_aout_bank->lock );
@@ -315,7 +315,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
             snooze( 400000 );
 
             /* change the fast play mode */
-            input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER );
+            input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_FASTER );
             vlc_mutex_lock( &p_main->p_playlist->change_lock );
             p_main->p_playlist->b_stopped = 0;
             vlc_mutex_unlock( &p_main->p_playlist->change_lock );
@@ -324,7 +324,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
 
     case SLOWER_PLAY:
         /*  cycle the slow playback modes */
-        if (p_intf->p_input != NULL )
+        if (p_input_bank->pp_input[0] != NULL )
         {
             /* mute the sound */
             vlc_mutex_lock( &p_aout_bank->lock );
@@ -338,7 +338,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
             snooze( 400000 );
 
             /* change the slower play */
-            input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER );
+            input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_SLOWER );
             vlc_mutex_lock( &p_main->p_playlist->change_lock );
             p_main->p_playlist->b_stopped = 0;
             vlc_mutex_unlock( &p_main->p_playlist->change_lock );
@@ -392,12 +392,12 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
             int32 i = p_message->FindInt32( "channel" );
             if ( i == -1 )
             {
-                input_ChangeES( p_intf->p_input, NULL, AUDIO_ES );
+                input_ChangeES( p_input_bank->pp_input[0], NULL, AUDIO_ES );
             }
             else
             {
-                input_ChangeES( p_intf->p_input,
-                        p_intf->p_input->stream.pp_es[i], AUDIO_ES );
+                input_ChangeES( p_input_bank->pp_input[0],
+                        p_input_bank->pp_input[0]->stream.pp_es[i], AUDIO_ES );
             }
         }
         break;
@@ -407,12 +407,12 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
             int32 i = p_message->FindInt32( "subtitle" );
             if ( i == -1 )
             {
-                input_ChangeES( p_intf->p_input, NULL, SPU_ES);
+                input_ChangeES( p_input_bank->pp_input[0], NULL, SPU_ES);
             }
             else
             {
-                input_ChangeES( p_intf->p_input,
-                        p_intf->p_input->stream.pp_es[i], SPU_ES );
+                input_ChangeES( p_input_bank->pp_input[0],
+                        p_input_bank->pp_input[0]->stream.pp_es[i], SPU_ES );
             }
         }
         break;
@@ -421,14 +421,14 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
             input_area_t *  p_area;
             int             i_id;
 
-            i_id = p_intf->p_input->stream.p_selected_area->i_id - 1;
+            i_id = p_input_bank->pp_input[0]->stream.p_selected_area->i_id - 1;
 
             /* Disallow area 0 since it is used for video_ts.vob */
             if( i_id > 0 )
             {
-                p_area = p_intf->p_input->stream.pp_areas[i_id];
-                input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
-                input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+                p_area = p_input_bank->pp_input[0]->stream.pp_areas[i_id];
+                input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );
+                input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
             }
             break;
         }
@@ -437,13 +437,13 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
             input_area_t *  p_area;
             int             i_id;
 
-            i_id = p_intf->p_input->stream.p_selected_area->i_id + 1;
+            i_id = p_input_bank->pp_input[0]->stream.p_selected_area->i_id + 1;
 
-            if( i_id < p_intf->p_input->stream.i_area_nb )
+            if( i_id < p_input_bank->pp_input[0]->stream.i_area_nb )
             {
-                p_area = p_intf->p_input->stream.pp_areas[i_id];
-                input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
-                input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+                p_area = p_input_bank->pp_input[0]->stream.pp_areas[i_id];
+                input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );
+                input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
             }
         }
         break;
@@ -451,13 +451,13 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
         {
             input_area_t *  p_area;
 
-            p_area = p_intf->p_input->stream.p_selected_area;
+            p_area = p_input_bank->pp_input[0]->stream.p_selected_area;
 
             if( p_area->i_part > 0 )
             {
                 p_area->i_part--;
-                input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
-                input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+                input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );
+                input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
             }
         }
         break;
@@ -465,13 +465,13 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
         {
             input_area_t *  p_area;
 
-            p_area = p_intf->p_input->stream.p_selected_area;
+            p_area = p_input_bank->pp_input[0]->stream.p_selected_area;
 
             if( p_area->i_part > 0 )
             {
                 p_area->i_part++;
-                input_ChangeArea( p_intf->p_input, (input_area_t*)p_area );
-                input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
+                input_ChangeArea( p_input_bank->pp_input[0], (input_area_t*)p_area );
+                input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
             }
         }
         break;
@@ -484,9 +484,9 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
                 BPath path( &ref );
                 intf_PlaylistAdd( p_main->p_playlist,
                                   PLAYLIST_END, (char*)path.Path() );
-                if( p_intf->p_input != NULL )
+                if( p_input_bank->pp_input[0] != NULL )
                 {
-                    p_intf->p_input->b_eof = 1;
+                    p_input_bank->pp_input[0]->b_eof = 1;
                 }
                 intf_PlaylistJumpto( p_main->p_playlist, 
                                      p_main->p_playlist->i_size - 1 );
@@ -507,20 +507,20 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
  *****************************************************************************/
 void InterfaceWindow::updateInterface()
 {
-       if ( p_intf->p_input )
+       if ( p_input_bank->pp_input[0] )
        {
         if ( acquire_sem(p_mediaControl->fScrubSem) == B_OK )
         {
             uint64 seekTo = (p_mediaControl->GetSeekTo() *
-                        p_intf->p_input->stream.p_selected_area->i_size) / 100;
-            input_Seek( p_intf->p_input, seekTo);
+                        p_input_bank->pp_input[0]->stream.p_selected_area->i_size) / 100;
+            input_Seek( p_input_bank->pp_input[0], seekTo);
         }
         else if( Lock() )
         {
-            p_mediaControl->SetStatus(p_intf->p_input->stream.control.i_status, 
-                                      p_intf->p_input->stream.control.i_rate);
-            p_mediaControl->SetProgress(p_intf->p_input->stream.p_selected_area->i_tell,
-                                        p_intf->p_input->stream.p_selected_area->i_size);
+            p_mediaControl->SetStatus(p_input_bank->pp_input[0]->stream.control.i_status, 
+                                      p_input_bank->pp_input[0]->stream.control.i_rate);
+            p_mediaControl->SetProgress(p_input_bank->pp_input[0]->stream.p_selected_area->i_tell,
+                                        p_input_bank->pp_input[0]->stream.p_selected_area->i_size);
             Unlock();
         }
     }
@@ -684,26 +684,26 @@ int LanguageMenu::GetChannels()
     AddItem(menu_item);
     menu_item->SetMarked(TRUE);
 
-    if( p_intf->p_input == NULL )
+    if( p_input_bank->pp_input[0] == NULL )
     {
         return 1;
     }
 
 
-    vlc_mutex_lock( &p_intf->p_input->stream.stream_lock );
-    for( i = 0; i < p_intf->p_input->stream.i_selected_es_number; i++ )
+    vlc_mutex_lock( &p_input_bank->pp_input[0]->stream.stream_lock );
+    for( i = 0; i < p_input_bank->pp_input[0]->stream.i_selected_es_number; i++ )
     {
-        if( kind == p_intf->p_input->stream.pp_selected_es[i]->i_cat )
+        if( kind == p_input_bank->pp_input[0]->stream.pp_selected_es[i]->i_cat )
         {
-            p_es = p_intf->p_input->stream.pp_selected_es[i];
+            p_es = p_input_bank->pp_input[0]->stream.pp_selected_es[i];
         }
     }
 
-    for( i = 0; i < p_intf->p_input->stream.i_es_number; i++ )
+    for( i = 0; i < p_input_bank->pp_input[0]->stream.i_es_number; i++ )
     {
-        if( kind == p_intf->p_input->stream.pp_es[i]->i_cat )
+        if( kind == p_input_bank->pp_input[0]->stream.pp_es[i]->i_cat )
         {
-            psz_name = p_intf->p_input->stream.pp_es[i]->psz_desc;
+            psz_name = p_input_bank->pp_input[0]->stream.pp_es[i]->psz_desc;
             if( kind == AUDIO_ES ) //audio
             {
                 msg = new BMessage(SELECT_CHANNEL);
@@ -717,11 +717,11 @@ int LanguageMenu::GetChannels()
             BMenuItem *menu_item;
             menu_item = new BMenuItem(psz_name, msg);
             AddItem(menu_item);
-            b_active = (p_es == p_intf->p_input->stream.pp_es[i]);
+            b_active = (p_es == p_input_bank->pp_input[0]->stream.pp_es[i]);
             menu_item->SetMarked(b_active);
         }
     }
-    vlc_mutex_unlock( &p_intf->p_input->stream.stream_lock );
+    vlc_mutex_unlock( &p_input_bank->pp_input[0]->stream.stream_lock );
 
 }
 
index d0444a6f6d283e9375377ab96d6b49c2b9445d95..fcd9d4800c3e29c217373bceb3e5659c6b61360b 100644 (file)
@@ -1 +1 @@
-beos_SRC = beos.cpp aout_beos.cpp vout_beos.cpp intf_beos.cpp InterfaceWindow.cpp DrawingTidbits.cpp TransportButton.cpp PlayListWindow.cpp MediaControlView.cpp
+beos_SOURCES = beos.cpp aout_beos.cpp vout_beos.cpp intf_beos.cpp InterfaceWindow.cpp DrawingTidbits.cpp TransportButton.cpp PlayListWindow.cpp MediaControlView.cpp
index b8e1722c2266d1282fa0f4a304668e7fedf91cfd..e35cf0887fa78676508f99ee5ea00b621d078f06 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.38 2002/01/19 19:54:01 gbazin Exp $
+ * $Id: vout_beos.cpp,v 1.39 2002/02/08 15:57:29 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -63,6 +63,10 @@ typedef struct vout_sys_s
 
     s32 i_width;
     s32 i_height;
+
+    u8 *pp_buffer[2];
+    int i_index;
+
 } vout_sys_t;
 
 
@@ -109,15 +113,15 @@ int32 Draw(void *data)
          (disp_mode.timing.v_total)); 
     if (!(refresh == oldrefresh)) 
     { 
-        printf("\nNew refreshrate is %d:Hz\n",refresh); 
+        intf_WarnMsg( 1, "vout info: new refreshrate is %ld:Hz", refresh ); 
         oldrefresh = refresh; 
-        if (refresh  < 61
+        if (refresh < 61 
         { 
-            printf("Enabling retrace sync.\n"); 
+            intf_WarnMsg( 1, "vout info: enabling retrace sync" ); 
         } 
         else 
         { 
-            printf("Disabling retrace sync.\n"); 
+            intf_WarnMsg( 1, "vout info: disabling retrace sync" ); 
         } 
     } 
 
@@ -291,14 +295,10 @@ VideoWindow::VideoWindow( int width, int height,
     view = new VLCView( voutWindow->Bounds() );
     voutWindow->AddChild(view);
     
-    /* Bitmap mode overlay not available */
-#if BITS_PER_PLANE == 32
+    /* Bitmap mode overlay not available, set the system to 32bits
+     * and let BeOS do all the work */
     bitmap[0] = new BBitmap( voutWindow->Bounds(), B_RGB32);
     bitmap[1] = new BBitmap( voutWindow->Bounds(), B_RGB32);
-#else
-    bitmap[0] = new BBitmap( voutWindow->Bounds(), B_RGB32);
-    bitmap[1] = new BBitmap( voutWindow->Bounds(), B_RGB32);
-#endif
     memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength());
     memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength());
 
@@ -355,11 +355,7 @@ void VideoWindow::drawBuffer(int bufferIndex)
  *****************************************************************************/
 VLCView::VLCView(BRect bounds) : BView(bounds, "", B_FOLLOW_ALL, B_WILL_DRAW)
 {
-#if BITS_PER_PLANE == 32
     SetViewColor(B_TRANSPARENT_32_BIT);
-#else
-    SetViewColor(B_TRANSPARENT_16_BIT);
-#endif
 }
 
 /*****************************************************************************
@@ -468,14 +464,57 @@ 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;
+    VideoWindow *p_win = p_vout->p_sys->p_window;
+
+    int i_index;
+    picture_t *p_pic;
+
+    I_OUTPUTPICTURES = 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;
+    p_vout->output.i_chroma = FOURCC_RV32;
+
+    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;
+        }
+    }
 
-    if((p_win->bitmap[0] != NULL) && (p_win->bitmap[1] != NULL))
+    if( p_pic == NULL )
     {
-        p_vout->pf_setbuffers( p_vout,
-               (byte_t *)p_win->bitmap[0]->Bits(),
-               (byte_t *)p_win->bitmap[1]->Bits());
+        return 0;
     }
+
+    p_vout->p_sys->i_index = 0;
+    p_pic->p->p_pixels = p_vout->p_sys->pp_buffer[0];
+    p_pic->p->i_pixel_bytes = 4;
+    p_pic->p->i_lines = p_vout->p_sys->i_height;
+    p_pic->p->b_margin = 0;
+    p_pic->p->i_pitch = 4 * p_vout->p_sys->i_width;
+
+    p_pic->p->i_red_mask   = 0x00ff0000;
+    p_pic->p->i_green_mask = 0x0000ff00;
+    p_pic->p->i_blue_mask  = 0x000000ff;
+
+    p_pic->i_planes = 1;
+
+    p_pic->i_status = DESTROYED_PICTURE;
+    p_pic->i_type   = DIRECT_PICTURE;
+
+    PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
+
+    I_OUTPUTPICTURES++;
+
     return( 0 );
 }
 
@@ -508,8 +547,8 @@ int vout_Manage( vout_thread_t *p_vout )
 {
     VideoWindow * p_win = p_vout->p_sys->p_window;
     
-    p_win->resizeIfRequired(p_vout->p_buffer[p_vout->i_buffer_index].i_pic_width,
-                            p_vout->p_buffer[p_vout->i_buffer_index].i_pic_height);
+//    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);
                             
     return( 0 );
 }
@@ -530,15 +569,16 @@ void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
  *****************************************************************************/
 void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
 {
-
     VideoWindow * p_win = p_vout->p_sys->p_window;
+
     /* draw buffer if required */    
     if (!p_win->teardownwindow)
     {
-       p_win->drawBuffer(p_vout->i_buffer_index);
+       p_win->drawBuffer(p_vout->p_sys->i_index);
     }
     /* change buffer */
-    p_vout->i_buffer_index = ++p_vout->i_buffer_index & 1;
+    p_vout->p_sys->i_index = ++p_vout->p_sys->i_index & 1;
+    p_pic->p->p_pixels = p_vout->p_sys->pp_buffer[p_vout->p_sys->i_index];
 }
 
 /* following functions are local */
@@ -548,32 +588,22 @@ void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
  *****************************************************************************/
 static int BeosOpenDisplay( vout_thread_t *p_vout )
 { 
-    
-    VideoWindow * p_win = new VideoWindow( p_vout->i_width - 1, 
-                                           p_vout->i_height - 1, 
-                                           p_vout );
+    p_vout->p_sys->p_window = new VideoWindow(
+            main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT ) + 1,
+            main_GetIntVariable( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT ) + 1,
+            p_vout );
 
-    if( p_win == 0 )
+    if( p_vout->p_sys->p_window == NULL )
     {
-        free( p_vout->p_sys );
         intf_ErrMsg( "error: cannot allocate memory for VideoWindow" );
         return( 1 );
     }   
     
-    p_vout->p_sys->p_window = p_win;
-    /* set the system to 32bits always
-       let BeOS do all the work */
-    p_vout->p_sys->i_width    = p_win->i_width + 1;
-    p_vout->p_sys->i_height   = p_win->i_height + 1;
-#if 0
-    p_vout->i_screen_depth    = BITS_PER_PLANE;
-    p_vout->i_bytes_per_pixel = BYTES_PER_PIXEL;
-    p_vout->i_bytes_per_line  = p_vout->p_sys->i_width * BYTES_PER_PIXEL;
-
-    p_vout->i_red_mask =        0xff0000;
-    p_vout->i_green_mask =      0x00ff00;
-    p_vout->i_blue_mask =       0x0000ff;
-#endif
+    p_vout->p_sys->i_width    = p_vout->p_sys->p_window->i_width + 1;
+    p_vout->p_sys->i_height   = p_vout->p_sys->p_window->i_height + 1;
+
+    p_vout->p_sys->pp_buffer[0] = (u8*)p_vout->p_sys->p_window->bitmap[0]->Bits();
+    p_vout->p_sys->pp_buffer[1] = (u8*)p_vout->p_sys->p_window->bitmap[1]->Bits();
 
     return( 0 );
 }
index 5cfa222c5c6f89c62c092a6b6d194ddb5369c841..119b95ccfd3535e081c351724b076520889cd539 100644 (file)
@@ -2,7 +2,7 @@
  * i420_rgb.c : YUV to bitmap RGB conversion module for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: i420_rgb.c,v 1.3 2002/01/28 16:51:22 sam Exp $
+ * $Id: i420_rgb.c,v 1.4 2002/02/08 15:57:29 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -106,7 +106,7 @@ static int chroma_Probe( probedata_t *p_data )
 #endif
                 case FOURCC_RV15:
                 case FOURCC_RV16:
-                case FOURCC_BI_BITFIELDS:
+                case FOURCC_RV32:
                     break;
 
                 default:
@@ -153,7 +153,7 @@ static int chroma_Init( vout_thread_t *p_vout )
                     p_vout->chroma.pf_convert = _M( I420_RGB16 );
                     break;
 
-                case FOURCC_BI_BITFIELDS:
+                case FOURCC_RV32:
                     p_vout->chroma.pf_convert = _M( I420_RGB32 );
                     break;
 
@@ -185,7 +185,7 @@ static int chroma_Init( vout_thread_t *p_vout )
             p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 2 );
             break;
 
-        case FOURCC_BI_BITFIELDS:
+        case FOURCC_RV32:
             p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 4 );
             break;
 
index f7e29f0de13186ab1665fd3f3adffce9223c72ee..1d4903d33079af963c4934e6163f3be591f91d8e 100644 (file)
@@ -2,7 +2,7 @@
  * beos_init.cpp: Initialization for BeOS specific features 
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: beos_specific.cpp,v 1.16 2002/01/26 01:18:27 tcastley Exp $
+ * $Id: beos_specific.cpp,v 1.17 2002/02/08 15:57:29 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *
 extern "C"
 {
 #include <videolan/vlc.h>
-
-#include "intf_msg.h"
-/*#include "threads.h"*/
-#include "mtime.h"
 }
 
 /*****************************************************************************
index 5f0fbc009a77a4cd9769a0e14df62e5a6744771d..9633728269afbc48cc271a52e3431c09f438fb5d 100644 (file)
@@ -2,7 +2,7 @@
  * vout_pictures.c : picture management functions
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: vout_pictures.c,v 1.12 2002/01/21 07:00:21 gbazin Exp $
+ * $Id: vout_pictures.c,v 1.13 2002/02/08 15:57:29 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -519,6 +519,16 @@ void vout_AllocatePicture( picture_t *p_pic,
             p_pic->i_planes = 1;
             break;
 
+        case FOURCC_RV32:
+            p_pic->p->i_lines = i_height;
+            p_pic->p->i_pitch = i_width * 4;
+            p_pic->p->i_pixel_bytes = 4;
+            p_pic->p->i_red_mask =   0xff0000;
+            p_pic->p->i_green_mask = 0x00ff00;
+            p_pic->p->i_blue_mask =  0x0000ff;
+            p_pic->i_planes = 1;
+            break;
+
         default:
             intf_ErrMsg( "vout error: unknown chroma type 0x%.8x (%4.4s)",
                          i_chroma, (char*)&i_chroma );