Commit ea8c73a7 authored by Sam Hocevar's avatar Sam Hocevar

  * ./src/audio_output/aout_s16.c: fixed a segfault. It may have unexpected
    side effects because I don't know this part of the code, but at least
    it doesn't crash anymore.
  * ./plugins/beos/beos.cpp: first attempt at porting the BeOS plugin to the
    new video output and module systems. Doesn't work nor even compile yet.
  * ./configure.in: we now check the gtk-config version.
parent 569eb5e1
...@@ -6964,6 +6964,10 @@ fi ...@@ -6964,6 +6964,10 @@ fi
if test -x ${GTK_CONFIG} if test -x ${GTK_CONFIG}
then then
if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
then
{ echo "configure: error: Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk." 1>&2; exit 1; }
fi
CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`" CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`" LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
fi fi
...@@ -6975,17 +6979,17 @@ fi ...@@ -6975,17 +6979,17 @@ fi
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:6979: checking for $ac_hdr" >&5 echo "configure:6983: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 6984 "configure" #line 6988 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:6989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:6993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -7042,17 +7046,17 @@ if test x$enable_x11 != xno && ...@@ -7042,17 +7046,17 @@ if test x$enable_x11 != xno &&
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7046: checking for $ac_hdr" >&5 echo "configure:7050: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 7051 "configure" #line 7055 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7056: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:7060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -7105,17 +7109,17 @@ if test x$enable_xvideo != xno && ...@@ -7105,17 +7109,17 @@ if test x$enable_xvideo != xno &&
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:7109: checking for $ac_hdr" >&5 echo "configure:7113: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 7114 "configure" #line 7118 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:7123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -7155,17 +7159,17 @@ if test "${enable_alsa+set}" = set; then ...@@ -7155,17 +7159,17 @@ if test "${enable_alsa+set}" = set; then
then then
ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'` ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6 echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6
echo "configure:7159: checking for alsa/asoundlib.h" >&5 echo "configure:7163: checking for alsa/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 7164 "configure" #line 7168 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <alsa/asoundlib.h> #include <alsa/asoundlib.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:7169: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:7173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -7182,7 +7186,7 @@ fi ...@@ -7182,7 +7186,7 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
echo "configure:7186: checking for main in -lasound" >&5 echo "configure:7190: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -7190,14 +7194,14 @@ else ...@@ -7190,14 +7194,14 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS" LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 7194 "configure" #line 7198 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
main() main()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:7201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:7205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
......
...@@ -1164,6 +1164,10 @@ then ...@@ -1164,6 +1164,10 @@ then
AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH) AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
if test -x ${GTK_CONFIG} if test -x ${GTK_CONFIG}
then then
if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
then
AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk.])
fi
CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`" CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`" LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
fi fi
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* beos.cpp : BeOS plugin for vlc * beos.cpp : BeOS plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: beos.cpp,v 1.15 2001/12/30 07:09:54 sam Exp $ * $Id: beos.cpp,v 1.16 2002/01/05 18:25:48 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>
...@@ -48,11 +48,11 @@ ADD_WINDOW( "Configuration for BeOS module" ) ...@@ -48,11 +48,11 @@ ADD_WINDOW( "Configuration for BeOS module" )
MODULE_CONFIG_STOP MODULE_CONFIG_STOP
MODULE_INIT_START MODULE_INIT_START
p_module->i_capabilities = MODULE_CAPABILITY_NULL SET_DESCRIPTION( "BeOS standard API module" )
| MODULE_CAPABILITY_AOUT ADD_CAPABILITY( INTF, 100 )
| MODULE_CAPABILITY_VOUT ADD_CAPABILITY( VOUT, 100 )
| MODULE_CAPABILITY_INTF; ADD_CAPABILITY( AOUT, 100 )
p_module->psz_longname = "BeOS standard API module"; ADD_SHORTCUT( "beos" )
MODULE_INIT_STOP MODULE_INIT_STOP
MODULE_ACTIVATE_START MODULE_ACTIVATE_START
......
...@@ -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.36 2001/12/30 07:09:54 sam Exp $ * $Id: vout_beos.cpp,v 1.37 2002/01/05 18:25:48 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>
...@@ -48,8 +48,8 @@ extern "C" ...@@ -48,8 +48,8 @@ extern "C"
#include "VideoWindow.h" #include "VideoWindow.h"
#define BITS_PER_PLANE 32 #define BITS_PER_PLANE 16
#define BYTES_PER_PIXEL 4 #define BYTES_PER_PIXEL 2
/***************************************************************************** /*****************************************************************************
* vout_sys_t: BeOS video output method descriptor * vout_sys_t: BeOS video output method descriptor
...@@ -59,11 +59,10 @@ extern "C" ...@@ -59,11 +59,10 @@ extern "C"
*****************************************************************************/ *****************************************************************************/
typedef struct vout_sys_s typedef struct vout_sys_s
{ {
VideoWindow * p_window; VideoWindow * p_window;
byte_t * pp_buffer[2]; s32 i_width;
s32 i_width; s32 i_height;
s32 i_height;
} vout_sys_t; } vout_sys_t;
...@@ -94,10 +93,8 @@ BWindow *beos_GetAppWindow(char *name) ...@@ -94,10 +93,8 @@ BWindow *beos_GetAppWindow(char *name)
} }
/**************************************************************************** /****************************************************************************
*
* DrawingThread : thread that really does the drawing * DrawingThread : thread that really does the drawing
**************************************************************************** ****************************************************************************/
*/
int32 Draw(void *data) int32 Draw(void *data)
{ {
//rudolf: sync init: //rudolf: sync init:
...@@ -161,16 +158,16 @@ bitmapWindow::~bitmapWindow() ...@@ -161,16 +158,16 @@ bitmapWindow::~bitmapWindow()
void bitmapWindow::FrameResized( float width, float height ) void bitmapWindow::FrameResized( float width, float height )
{ {
if (is_zoomed) if (is_zoomed)
{ {
return; return;
} }
float width_scale; float width_scale;
float height_scale; float height_scale;
width_scale = width / origRect.Width(); width_scale = width / origRect.Width();
height_scale = height / origRect.Height(); height_scale = height / origRect.Height();
/* if the width is proportionally smaller */ /* if the width is proportionally smaller */
if (width_scale <= height_scale) if (width_scale <= height_scale)
{ {
...@@ -184,23 +181,23 @@ void bitmapWindow::FrameResized( float width, float height ) ...@@ -184,23 +181,23 @@ void bitmapWindow::FrameResized( float width, float height )
void bitmapWindow::Zoom(BPoint origin, float width, float height ) void bitmapWindow::Zoom(BPoint origin, float width, float height )
{ {
if(is_zoomed) if(is_zoomed)
{ {
MoveTo(origRect.left, origRect.top); MoveTo(origRect.left, origRect.top);
ResizeTo(origRect.IntegerWidth(), origRect.IntegerHeight()); ResizeTo(origRect.IntegerWidth(), origRect.IntegerHeight());
be_app->ShowCursor(); be_app->ShowCursor();
} }
else else
{ {
BScreen *screen; BScreen *screen;
screen = new BScreen(this); screen = new BScreen(this);
BRect rect = screen->Frame(); BRect rect = screen->Frame();
delete screen; delete screen;
MoveTo(0,0); MoveTo(0,0);
ResizeTo(rect.IntegerWidth(), rect.IntegerHeight()); ResizeTo(rect.IntegerWidth(), rect.IntegerHeight());
be_app->HideCursor(); be_app->HideCursor();
} }
is_zoomed = !is_zoomed; is_zoomed = !is_zoomed;
} }
/***************************************************************************** /*****************************************************************************
...@@ -226,16 +223,16 @@ void directWindow::DirectConnected(direct_buffer_info *info) ...@@ -226,16 +223,16 @@ void directWindow::DirectConnected(direct_buffer_info *info)
void directWindow::FrameResized( float width, float height ) void directWindow::FrameResized( float width, float height )
{ {
if (is_zoomed) if (is_zoomed)
{ {
return; return;
} }
float width_scale; float width_scale;
float height_scale; float height_scale;
width_scale = width / origRect.Width(); width_scale = width / origRect.Width();
height_scale = height / origRect.Height(); height_scale = height / origRect.Height();
/* if the width is proportionally smaller */ /* if the width is proportionally smaller */
if (width_scale <= height_scale) if (width_scale <= height_scale)
{ {
...@@ -249,25 +246,25 @@ void directWindow::FrameResized( float width, float height ) ...@@ -249,25 +246,25 @@ void directWindow::FrameResized( float width, float height )
void directWindow::Zoom(BPoint origin, float width, float height ) void directWindow::Zoom(BPoint origin, float width, float height )
{ {
if(is_zoomed) if(is_zoomed)
{ {
SetFullScreen(false); SetFullScreen(false);
MoveTo(origRect.left, origRect.top); MoveTo(origRect.left, origRect.top);
ResizeTo(origRect.IntegerWidth(), origRect.IntegerHeight()); ResizeTo(origRect.IntegerWidth(), origRect.IntegerHeight());
be_app->ShowCursor(); be_app->ShowCursor();
} }
else else
{ {
SetFullScreen(true); SetFullScreen(true);
BScreen *screen; BScreen *screen;
screen = new BScreen(this); screen = new BScreen(this);
BRect rect = screen->Frame(); BRect rect = screen->Frame();
delete screen; delete screen;
MoveTo(0,0); MoveTo(0,0);
ResizeTo(rect.IntegerWidth(), rect.IntegerHeight()); ResizeTo(rect.IntegerWidth(), rect.IntegerHeight());
be_app->HideCursor(); be_app->HideCursor();
} }
is_zoomed = !is_zoomed; is_zoomed = !is_zoomed;
} }
/***************************************************************************** /*****************************************************************************
...@@ -279,29 +276,34 @@ VideoWindow::VideoWindow( int width, int height, ...@@ -279,29 +276,34 @@ VideoWindow::VideoWindow( int width, int height,
if ( BDirectWindow::SupportsWindowMode() ) if ( BDirectWindow::SupportsWindowMode() )
{ {
voutWindow = new directWindow( BRect( 80, 50, voutWindow = new directWindow( BRect( 80, 50,
80 + width, 50 + height ), this ); 80 + width, 50 + height ), this );
} }
else else
{ {
voutWindow = new bitmapWindow( BRect( 80, 50, voutWindow = new bitmapWindow( BRect( 80, 50,
80 + width, 50 + height ), this ); 80 + width, 50 + height ), this );
} }
/* set the VideoWindow variables */ /* set the VideoWindow variables */
teardownwindow = false; teardownwindow = false;
/* create the view to do the display */ /* create the view to do the display */
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 */
bitmap[0] = new BBitmap( voutWindow->Bounds(), B_RGB32); #if BITS_PER_PLANE == 32
bitmap[1] = new BBitmap( voutWindow->Bounds(), B_RGB32); bitmap[0] = new BBitmap( voutWindow->Bounds(), B_RGB32);
memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength()); bitmap[1] = new BBitmap( voutWindow->Bounds(), B_RGB32);
memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength()); #else
bitmap[0] = new BBitmap( voutWindow->Bounds(), B_RGB32);
i_width = bitmap[0]->Bounds().IntegerWidth(); bitmap[1] = new BBitmap( voutWindow->Bounds(), B_RGB32);
i_height = bitmap[0]->Bounds().IntegerHeight(); #endif
memset(bitmap[0]->Bits(), 0, bitmap[0]->BitsLength());
memset(bitmap[1]->Bits(), 0, bitmap[1]->BitsLength());
i_width = bitmap[0]->Bounds().IntegerWidth();
i_height = bitmap[0]->Bounds().IntegerHeight();
voutWindow->Show(); voutWindow->Show();
} }
...@@ -316,8 +318,8 @@ VideoWindow::~VideoWindow() ...@@ -316,8 +318,8 @@ VideoWindow::~VideoWindow()
voutWindow->Quit(); voutWindow->Quit();
teardownwindow = true; teardownwindow = true;
wait_for_thread(fDrawThreadID, &result); wait_for_thread(fDrawThreadID, &result);
delete bitmap[0]; delete bitmap[0];
delete bitmap[1]; delete bitmap[1];
} }
void VideoWindow::resizeIfRequired( int newWidth, int newHeight ) void VideoWindow::resizeIfRequired( int newWidth, int newHeight )
...@@ -339,10 +341,10 @@ void VideoWindow::resizeIfRequired( int newWidth, int newHeight ) ...@@ -339,10 +341,10 @@ void VideoWindow::resizeIfRequired( int newWidth, int newHeight )
void VideoWindow::drawBuffer(int bufferIndex) void VideoWindow::drawBuffer(int bufferIndex)
{ {
status_t status; status_t status;
i_buffer = bufferIndex; i_buffer = bufferIndex;
fDrawThreadID = spawn_thread(Draw, "drawing_thread", fDrawThreadID = spawn_thread(Draw, "drawing_thread",
B_DISPLAY_PRIORITY, (void*) this); B_DISPLAY_PRIORITY, (void*) this);
wait_for_thread(fDrawThreadID, &status); wait_for_thread(fDrawThreadID, &status);
...@@ -353,7 +355,11 @@ void VideoWindow::drawBuffer(int bufferIndex) ...@@ -353,7 +355,11 @@ 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)
{ {
SetViewColor(B_TRANSPARENT_32_BIT); #if BITS_PER_PLANE == 32
SetViewColor(B_TRANSPARENT_32_BIT);
#else
SetViewColor(B_TRANSPARENT_16_BIT);
#endif
} }
/***************************************************************************** /*****************************************************************************
...@@ -368,8 +374,8 @@ VLCView::~VLCView() ...@@ -368,8 +374,8 @@ VLCView::~VLCView()
*****************************************************************************/ *****************************************************************************/
void VLCView::MouseDown(BPoint point) void VLCView::MouseDown(BPoint point)
{ {
BWindow *win = Window(); BWindow *win = Window();
win->Zoom(); win->Zoom();
} }
extern "C" extern "C"
...@@ -379,12 +385,13 @@ extern "C" ...@@ -379,12 +385,13 @@ extern "C"
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int vout_Probe ( probedata_t *p_data ); static int vout_Probe ( probedata_t *p_data );
static int vout_Create ( struct vout_thread_s * ); static int vout_Create ( vout_thread_t * );
static int vout_Init ( struct vout_thread_s * ); static int vout_Init ( vout_thread_t * );
static void vout_End ( struct vout_thread_s * ); static void vout_End ( vout_thread_t * );
static void vout_Destroy ( struct vout_thread_s * ); static void vout_Destroy ( vout_thread_t * );
static int vout_Manage ( struct vout_thread_s * ); static int vout_Manage ( vout_thread_t * );
static void vout_Display ( struct vout_thread_s * ); static void vout_Display ( vout_thread_t *, picture_t * );
static void vout_Render ( vout_thread_t *, picture_t * );
static int BeosOpenDisplay ( vout_thread_t *p_vout ); static int BeosOpenDisplay ( vout_thread_t *p_vout );
static void BeosCloseDisplay( vout_thread_t *p_vout ); static void BeosCloseDisplay( vout_thread_t *p_vout );
...@@ -402,7 +409,7 @@ void _M( vout_getfunctions )( function_list_t * p_function_list ) ...@@ -402,7 +409,7 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
p_function_list->functions.vout.pf_destroy = vout_Destroy; p_function_list->functions.vout.pf_destroy = vout_Destroy;
p_function_list->functions.vout.pf_manage = vout_Manage; p_function_list->functions.vout.pf_manage = vout_Manage;
p_function_list->functions.vout.pf_display = vout_Display; p_function_list->functions.vout.pf_display = vout_Display;
p_function_list->functions.vout.pf_setpalette = NULL; p_function_list->functions.vout.pf_render = vout_Render;
} }
/***************************************************************************** /*****************************************************************************
...@@ -434,9 +441,20 @@ int vout_Create( vout_thread_t *p_vout ) ...@@ -434,9 +441,20 @@ int vout_Create( vout_thread_t *p_vout )
intf_ErrMsg( "error: %s", strerror(ENOMEM) ); intf_ErrMsg( "error: %s", strerror(ENOMEM) );
return( 1 ); return( 1 );
} }
/* force scaling off */ if( p_vout->render.i_height * p_vout->render.i_aspect
p_vout->b_scale = false; >= p_vout->render.i_width * VOUT_ASPECT_FACTOR )
{
p_vout->p_sys->i_width = p_vout->render.i_height
* p_vout->render.i_aspect / VOUT_ASPECT_FACTOR;
p_vout->p_sys->i_height = p_vout->render.i_height;
}
else
{
p_vout->p_sys->i_width = p_vout->render.i_width;
p_vout->p_sys->i_height = p_vout->render.i_width
* VOUT_ASPECT_FACTOR / p_vout->render.i_aspect;
}
/* Open and initialize device */ /* Open and initialize device */
if( BeosOpenDisplay( p_vout ) ) if( BeosOpenDisplay( p_vout ) )
...@@ -457,8 +475,8 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -457,8 +475,8 @@ 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;
if((p_win->bitmap[0] != NULL) && (p_win->bitmap[1] != NULL)) if((p_win->bitmap[0] != NULL) && (p_win->bitmap[1] != NULL))
{ {
p_vout->pf_setbuffers( p_vout, p_vout->pf_setbuffers( p_vout,
(byte_t *)p_win->bitmap[0]->Bits(), (byte_t *)p_win->bitmap[0]->Bits(),
(byte_t *)p_win->bitmap[1]->Bits()); (byte_t *)p_win->bitmap[1]->Bits());
} }
...@@ -470,7 +488,7 @@ int vout_Init( vout_thread_t *p_vout ) ...@@ -470,7 +488,7 @@ int vout_Init( vout_thread_t *p_vout )
*****************************************************************************/ *****************************************************************************/
void vout_End( vout_thread_t *p_vout ) void vout_End( vout_thread_t *p_vout )
{ {
/* place code here to end the video */ /* place code here to end the video */
} }
/***************************************************************************** /*****************************************************************************
...@@ -497,7 +515,15 @@ int vout_Manage( vout_thread_t *p_vout ) ...@@ -497,7 +515,15 @@ int vout_Manage( vout_thread_t *p_vout )
p_win->resizeIfRequired(p_vout->p_buffer[p_vout->i_buffer_index].i_pic_width, 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_vout->p_buffer[p_vout->i_buffer_index].i_pic_height);
return( 0 ); return( 0 );
}
/*****************************************************************************
* vout_Render: render previously calculated output
*****************************************************************************/
void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
{
;
} }
/***************************************************************************** /*****************************************************************************
...@@ -506,17 +532,17 @@ int vout_Manage( vout_thread_t *p_vout ) ...@@ -506,17 +532,17 @@ int vout_Manage( vout_thread_t *p_vout )
* This function send the currently rendered image to BeOS image, waits until * This function send the currently rendered image to BeOS image, waits until
* it is displayed and switch the two rendering buffers, preparing next frame. * it is displayed and switch the two rendering buffers, preparing next frame.
*****************************************************************************/ *****************************************************************************/
void vout_Display( vout_thread_t *p_vout ) 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->i_buffer_index);
} }
/* change buffer */ /* change buffer */
p_vout->i_buffer_index = ++p_vout->i_buffer_index & 1; p_vout->i_buffer_index = ++p_vout->i_buffer_index & 1;
} }
/* following functions are local */ /* following functions are local */
...@@ -541,16 +567,17 @@ static int BeosOpenDisplay( vout_thread_t *p_vout ) ...@@ -541,16 +567,17 @@ static int BeosOpenDisplay( vout_thread_t *p_vout )
p_vout->p_sys->p_window = p_win; p_vout->p_sys->p_window = p_win;
/* set the system to 32bits always /* set the system to 32bits always
let BeOS do all the work */ let BeOS do all the work */
p_vout->b_YCbr = false; 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_screen_depth = BITS_PER_PLANE;
p_vout->i_bytes_per_pixel = BYTES_PER_PIXEL; p_vout->i_bytes_per_pixel = BYTES_PER_PIXEL;
p_vout->i_width = p_win->i_width + 1; p_vout->i_bytes_per_line = p_vout->p_sys->i_width * BYTES_PER_PIXEL;
p_vout->i_height = p_win->i_height + 1;
p_vout->i_bytes_per_line = p_vout->i_width * BYTES_PER_PIXEL;
p_vout->i_red_mask = 0xff0000; p_vout->i_red_mask = 0xff0000;
p_vout->i_green_mask = 0x00ff00; p_vout->i_green_mask = 0x00ff00;
p_vout->i_blue_mask = 0x0000ff; p_vout->i_blue_mask = 0x0000ff;
#endif
return( 0 ); return( 0 );
} }
......
...@@ -133,7 +133,7 @@ static void S16StereoPlay( aout_thread_t * p_aout, aout_fifo_t * p_fifo ) ...@@ -133,7 +133,7 @@ static void S16StereoPlay( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
} }
p_fifo->l_units -= p_aout->l_units; p_fifo->l_units -= p_aout->l_units;
} }
else else /* p_fifo->l_units <= p_aout->l_units */
{ {
/* p_aout->b_stereo == 1 */ /* p_aout->b_stereo == 1 */
while ( l_buffer < (p_fifo->l_units << 1) ) while ( l_buffer < (p_fifo->l_units << 1) )
...@@ -164,7 +164,7 @@ static void S16StereoPlay( aout_thread_t * p_aout, aout_fifo_t * p_fifo ) ...@@ -164,7 +164,7 @@ static void S16StereoPlay( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
} }
p_fifo->l_units -= p_aout->l_units; p_fifo->l_units -= p_aout->l_units;
} }
else else /* p_fifo->l_units <= p_aout->l_units */
{ {
/* p_aout->b_stereo == 1 */ /* p_aout->b_stereo == 1 */
while ( l_buffer < (p_fifo->l_units << 1) ) while ( l_buffer < (p_fifo->l_units << 1) )
...@@ -216,10 +216,10 @@ static void S16StereoPlay( aout_thread_t * p_aout, aout_fifo_t * p_fifo ) ...@@ -216,10 +216,10 @@ static void S16StereoPlay( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
p_fifo->l_units -= l_units; p_fifo->l_units -= l_units;
break; break;
} }
else else /* p_fifo->l_units <= l_units */
{ {
/* p_aout->b_stereo == 1 */ /* p_aout->b_stereo == 1 */
l_buffer_limit = l_buffer + (p_fifo->l_units << 1); l_buffer_limit = p_fifo->l_units << 1;
while ( l_buffer < l_buffer_limit ) while ( l_buffer < l_buffer_limit )
{ {
...@@ -287,10 +287,10 @@ static void S16StereoPlay( aout_thread_t * p_aout, aout_fifo_t * p_fifo ) ...@@ -287,10 +287,10 @@ static void S16StereoPlay( aout_thread_t * p_aout, aout_fifo_t * p_fifo )
p_fifo->l_units -= l_units; p_fifo->l_units -= l_units;
break; break;
} }
else else /* p_fifo->l_units <= l_units */
{ {
/* p_aout->b_stereo == 1 */ /* p_aout->b_stereo == 1 */
l_buffer_limit = l_buffer + (p_fifo->l_units << 1); l_buffer_limit = p_fifo->l_units << 1;
while ( l_buffer < l_buffer_limit ) while ( l_buffer < l_buffer_limit )
{ {
......
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