Commit 3f421de7 authored by Sam Hocevar's avatar Sam Hocevar

  * ./plugins/beos/vout_beos.cpp: ported the BeOS RGB video output to
    vout4. The overlay video output still needs to be written though.
parent 622b4400
...@@ -6654,7 +6654,7 @@ fi ...@@ -6654,7 +6654,7 @@ fi
if test x$SYS = xbeos if test x$SYS = xbeos
then then
BUILTINS="${BUILTINS} beos" PLUGINS="${PLUGINS} beos"
else else
......
...@@ -976,7 +976,7 @@ AC_ARG_WITH(mad, ...@@ -976,7 +976,7 @@ AC_ARG_WITH(mad,
dnl special case for BeOS dnl special case for BeOS
if test x$SYS = xbeos if test x$SYS = xbeos
then then
BUILTINS="${BUILTINS} beos" PLUGINS="${PLUGINS} beos"
dnl default case dnl default case
else else
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* includes all common video types and constants. * includes all common video types and constants.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -143,6 +143,7 @@ typedef struct picture_heap_s ...@@ -143,6 +143,7 @@ typedef struct picture_heap_s
#define FOURCC_BI_BITFIELDS 0x00000003 /* RGB, for 16, 24, 32bpp */ #define FOURCC_BI_BITFIELDS 0x00000003 /* RGB, for 16, 24, 32bpp */
#define FOURCC_RV15 0x35315652 /* RGB 15bpp, 0x1f, 0x7e0, 0xf800 */ #define FOURCC_RV15 0x35315652 /* RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
#define FOURCC_RV16 0x36315652 /* RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */ #define FOURCC_RV16 0x36315652 /* RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */
#define FOURCC_RV32 0x32335652 /* RGB 32bpp, 0xff, 0xff00, 0xff0000 */
/* Planar YUV formats */ /* Planar YUV formats */
#define FOURCC_I420 0x30323449 /* Planar 4:2:0, Y:U:V */ #define FOURCC_I420 0x30323449 /* Planar 4:2:0, Y:U:V */
......
This diff is collapsed.
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
...@@ -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.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> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -63,6 +63,10 @@ typedef struct vout_sys_s ...@@ -63,6 +63,10 @@ typedef struct vout_sys_s
s32 i_width; s32 i_width;
s32 i_height; s32 i_height;
u8 *pp_buffer[2];
int i_index;
} vout_sys_t; } vout_sys_t;
...@@ -109,15 +113,15 @@ int32 Draw(void *data) ...@@ -109,15 +113,15 @@ int32 Draw(void *data)
(disp_mode.timing.v_total)); (disp_mode.timing.v_total));
if (!(refresh == oldrefresh)) if (!(refresh == oldrefresh))
{ {
printf("\nNew refreshrate is %d:Hz\n",refresh); intf_WarnMsg( 1, "vout info: new refreshrate is %ld:Hz", refresh );
oldrefresh = refresh; oldrefresh = refresh;
if (refresh < 61) if (refresh < 61 )
{ {
printf("Enabling retrace sync.\n"); intf_WarnMsg( 1, "vout info: enabling retrace sync" );
} }
else else
{ {
printf("Disabling retrace sync.\n"); intf_WarnMsg( 1, "vout info: disabling retrace sync" );
} }
} }
...@@ -291,14 +295,10 @@ VideoWindow::VideoWindow( int width, int height, ...@@ -291,14 +295,10 @@ VideoWindow::VideoWindow( int width, int height,
view = new VLCView( voutWindow->Bounds() ); view = new VLCView( voutWindow->Bounds() );
voutWindow->AddChild(view); voutWindow->AddChild(view);
/* Bitmap mode overlay not available */ /* Bitmap mode overlay not available, set the system to 32bits
#if BITS_PER_PLANE == 32 * and let BeOS do all the work */
bitmap[0] = new BBitmap( voutWindow->Bounds(), B_RGB32); bitmap[0] = new BBitmap( voutWindow->Bounds(), B_RGB32);
bitmap[1] = 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[0]->Bits(), 0, bitmap[0]->BitsLength());
memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength()); memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength());
...@@ -355,11 +355,7 @@ void VideoWindow::drawBuffer(int bufferIndex) ...@@ -355,11 +355,7 @@ void VideoWindow::drawBuffer(int bufferIndex)
*****************************************************************************/ *****************************************************************************/
VLCView::VLCView(BRect bounds) : BView(bounds, "", B_FOLLOW_ALL, B_WILL_DRAW) VLCView::VLCView(BRect bounds) : BView(bounds, "", B_FOLLOW_ALL, B_WILL_DRAW)
{ {
#if BITS_PER_PLANE == 32
SetViewColor(B_TRANSPARENT_32_BIT); SetViewColor(B_TRANSPARENT_32_BIT);
#else
SetViewColor(B_TRANSPARENT_16_BIT);
#endif
} }
/***************************************************************************** /*****************************************************************************
...@@ -468,14 +464,57 @@ int vout_Create( vout_thread_t *p_vout ) ...@@ -468,14 +464,57 @@ int vout_Create( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
int vout_Init( 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, return 0;
(byte_t *)p_win->bitmap[0]->Bits(),
(byte_t *)p_win->bitmap[1]->Bits());
} }
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 ); return( 0 );
} }
...@@ -508,8 +547,8 @@ int vout_Manage( vout_thread_t *p_vout ) ...@@ -508,8 +547,8 @@ 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_buffer[p_vout->i_buffer_index].i_pic_width, // p_win->resizeIfRequired(p_vout->p_sys->pp_buffer[p_vout->p_sys->i_index].i_pic_width,
p_vout->p_buffer[p_vout->i_buffer_index].i_pic_height); // p_vout->p_sys->pp_buffer[p_vout->p_sys->i_index].i_pic_height);
return( 0 ); return( 0 );
} }
...@@ -530,15 +569,16 @@ void vout_Render( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -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 ) void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
{ {
VideoWindow * p_win = p_vout->p_sys->p_window; VideoWindow * p_win = p_vout->p_sys->p_window;
/* draw buffer if required */ /* draw buffer if required */
if (!p_win->teardownwindow) if (!p_win->teardownwindow)
{ {
p_win->drawBuffer(p_vout->i_buffer_index); p_win->drawBuffer(p_vout->p_sys->i_index);
} }
/* change buffer */ /* 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 */ /* following functions are local */
...@@ -548,32 +588,22 @@ void vout_Display( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -548,32 +588,22 @@ void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
*****************************************************************************/ *****************************************************************************/
static int BeosOpenDisplay( vout_thread_t *p_vout ) static int BeosOpenDisplay( vout_thread_t *p_vout )
{ {
p_vout->p_sys->p_window = new VideoWindow(
VideoWindow * p_win = new VideoWindow( p_vout->i_width - 1, main_GetIntVariable( VOUT_WIDTH_VAR, VOUT_WIDTH_DEFAULT ) + 1,
p_vout->i_height - 1, main_GetIntVariable( VOUT_HEIGHT_VAR, VOUT_HEIGHT_DEFAULT ) + 1,
p_vout ); 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" ); intf_ErrMsg( "error: cannot allocate memory for VideoWindow" );
return( 1 ); return( 1 );
} }
p_vout->p_sys->p_window = p_win; p_vout->p_sys->i_width = p_vout->p_sys->p_window->i_width + 1;
/* set the system to 32bits always p_vout->p_sys->i_height = p_vout->p_sys->p_window->i_height + 1;
let BeOS do all the work */
p_vout->p_sys->i_width = p_win->i_width + 1; p_vout->p_sys->pp_buffer[0] = (u8*)p_vout->p_sys->p_window->bitmap[0]->Bits();
p_vout->p_sys->i_height = p_win->i_height + 1; p_vout->p_sys->pp_buffer[1] = (u8*)p_vout->p_sys->p_window->bitmap[1]->Bits();
#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
return( 0 ); return( 0 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* i420_rgb.c : YUV to bitmap RGB conversion module for vlc * i420_rgb.c : YUV to bitmap RGB conversion module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -106,7 +106,7 @@ static int chroma_Probe( probedata_t *p_data ) ...@@ -106,7 +106,7 @@ static int chroma_Probe( probedata_t *p_data )
#endif #endif
case FOURCC_RV15: case FOURCC_RV15:
case FOURCC_RV16: case FOURCC_RV16:
case FOURCC_BI_BITFIELDS: case FOURCC_RV32:
break; break;
default: default:
...@@ -153,7 +153,7 @@ static int chroma_Init( vout_thread_t *p_vout ) ...@@ -153,7 +153,7 @@ static int chroma_Init( vout_thread_t *p_vout )
p_vout->chroma.pf_convert = _M( I420_RGB16 ); p_vout->chroma.pf_convert = _M( I420_RGB16 );
break; break;
case FOURCC_BI_BITFIELDS: case FOURCC_RV32:
p_vout->chroma.pf_convert = _M( I420_RGB32 ); p_vout->chroma.pf_convert = _M( I420_RGB32 );
break; break;
...@@ -185,7 +185,7 @@ static int chroma_Init( vout_thread_t *p_vout ) ...@@ -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 ); p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 2 );
break; break;
case FOURCC_BI_BITFIELDS: case FOURCC_RV32:
p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 4 ); p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 4 );
break; break;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* beos_init.cpp: Initialization for BeOS specific features * beos_init.cpp: Initialization for BeOS specific features
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * 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> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* *
...@@ -31,10 +31,6 @@ ...@@ -31,10 +31,6 @@
extern "C" extern "C"
{ {
#include <videolan/vlc.h> #include <videolan/vlc.h>
#include "intf_msg.h"
/*#include "threads.h"*/
#include "mtime.h"
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_pictures.c : picture management functions * vout_pictures.c : picture management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * 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> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -519,6 +519,16 @@ void vout_AllocatePicture( picture_t *p_pic, ...@@ -519,6 +519,16 @@ void vout_AllocatePicture( picture_t *p_pic,
p_pic->i_planes = 1; p_pic->i_planes = 1;
break; 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: default:
intf_ErrMsg( "vout error: unknown chroma type 0x%.8x (%4.4s)", intf_ErrMsg( "vout error: unknown chroma type 0x%.8x (%4.4s)",
i_chroma, (char*)&i_chroma ); i_chroma, (char*)&i_chroma );
......
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