Commit 2ead2268 authored by Tony Castley's avatar Tony Castley

Improved Overlay and Bitmap output modes.

Due to existing bug in some Chroma's the Overlay does not work for nVidia
cards.  Sorry.
parent f6d172c3
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* VideoWindow.h: BeOS video window class prototype * VideoWindow.h: BeOS video window class prototype
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: VideoWindow.h,v 1.18 2002/05/16 11:38:42 tcastley Exp $ * $Id: VideoWindow.h,v 1.19 2002/05/20 11:21:01 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Tony Castley <tcastley@mail.powerup.com.au> * Tony Castley <tcastley@mail.powerup.com.au>
...@@ -32,15 +32,16 @@ typedef struct colorcombo ...@@ -32,15 +32,16 @@ typedef struct colorcombo
const char *name; const char *name;
u32 chroma; u32 chroma;
int planes; int planes;
int pixel_bytes;
} colorcombo; } colorcombo;
colorcombo colspace[]= colorcombo colspace[]=
{ {
{B_YUV420, "B_YUV420", FOURCC_I420, 3}, {B_YCbCr420, "B_YCbCr420", FOURCC_I420, 3, 2},
{B_YUV422, "B_YUV422", FOURCC_Y422, 3}, {B_YUV422, "B_YUV422", FOURCC_Y422, 3, 2},
{B_YCbCr422, "B_YCbCr422", FOURCC_YUY2, 3}, {B_YCbCr422, "B_YCbCr422", FOURCC_YUY2, 3, 2},
{B_RGB32, "B_RGB32", FOURCC_RV32, 1}, {B_RGB32, "B_RGB32", FOURCC_RV32, 1, 4},
{B_RGB16, "B_RGB16", FOURCC_RV16, 1} {B_RGB16, "B_RGB16", FOURCC_RV16, 1, 2}
}; };
#define COLOR_COUNT 5 #define COLOR_COUNT 5
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method * vout_beos.cpp: beos video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.55 2002/05/16 12:47:59 tcastley Exp $ * $Id: vout_beos.cpp,v 1.56 2002/05/20 11:21:01 tcastley Exp $
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -488,63 +488,58 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -488,63 +488,58 @@ int vout_Init( vout_thread_t *p_vout )
/* Assume we have square pixels */ /* Assume we have square pixels */
p_vout->output.i_aspect = p_vout->p_sys->i_width 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 = colspace[p_vout->p_sys->p_window->colspace_index].chroma; p_vout->output.i_chroma = colspace[p_vout->p_sys->p_window->colspace_index].chroma;
p_vout->p_sys->i_index = 0;
p_vout->output.i_rmask = 0x00ff0000; p_vout->output.i_rmask = 0x00ff0000;
p_vout->output.i_gmask = 0x0000ff00; p_vout->output.i_gmask = 0x0000ff00;
p_vout->output.i_bmask = 0x000000ff; p_vout->output.i_bmask = 0x000000ff;
p_pic = NULL; for (int buffer_index = 0 ; buffer_index < 3; buffer_index++)
/* 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 = NULL;
{ /* Find an empty picture slot */
p_pic = p_vout->p_picture + i_index; for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ )
break; {
} p_pic = NULL;
} if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE )
{
if( p_pic == NULL ) p_pic = p_vout->p_picture + i_index;
{ break;
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_lines = p_vout->p_sys->i_height;
p_pic->p->i_pixel_bytes = p_vout->p_sys->p_window->bitmap[0]->BytesPerRow() / if( p_pic == NULL )
p_vout->p_sys->p_window->bitmap[0]->Bounds().IntegerWidth(); {
if (p_vout->p_sys->p_window->mode == OVERLAY) return 0;
{ }
/* Get the overlay Restrictions */ p_pic->p->p_pixels = p_vout->p_sys->pp_buffer[0];
overlay_restrictions r; p_pic->p->i_lines = p_vout->p_sys->i_height;
p_vout->p_sys->p_window->bitmap[0]->GetOverlayRestrictions(&r);
p_pic->p->i_pitch = r.source.max_width * p_pic->p->i_pixel_bytes;
p_pic->p->b_margin = 1;
p_pic->p->i_visible_bytes =p_vout->p_sys->p_window->bitmap[0]->BytesPerRow();
p_pic->p->b_hidden = 0;
intf_Msg("i_pitch : %d", p_pic->p->i_pitch);
}
else
{
p_pic->p->i_pitch = p_vout->p_sys->p_window->bitmap[0]->BytesPerRow();
intf_Msg("i_pitch : %d", p_pic->p->i_pitch);
}
p_pic->p->b_margin = 0;
p_pic->i_planes = colspace[p_vout->p_sys->p_window->colspace_index].planes; p_pic->p->i_pixel_bytes = colspace[p_vout->p_sys->p_window->colspace_index].pixel_bytes;
p_pic->i_planes = colspace[p_vout->p_sys->p_window->colspace_index].planes;
p_pic->p->i_pitch = p_vout->p_sys->p_window->bitmap[0]->BytesPerRow();
p_pic->i_status = DESTROYED_PICTURE; if (p_vout->p_sys->p_window->mode == OVERLAY)
p_pic->i_type = DIRECT_PICTURE; {
p_pic->p->i_visible_bytes = (p_vout->p_sys->p_window->bitmap[0]->Bounds().IntegerWidth()+1)
* p_pic->p->i_pixel_bytes;
p_pic->p->b_margin = 1;
p_pic->p->b_hidden = 0;
}
else
{
p_pic->p->b_margin = 0;
p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
}
PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic; p_pic->i_status = DESTROYED_PICTURE;
p_pic->i_type = DIRECT_PICTURE;
PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
I_OUTPUTPICTURES++; I_OUTPUTPICTURES++;
}
return( 0 ); return( 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