Commit 551607d3 authored by Jean-Marc Dressler's avatar Jean-Marc Dressler

Portage du client sous BeOS. Il manque encore l'audio mais �a marche.

En cadeau bonux un nouvel input_file qui permet de lire les vob. Il
faur rajouter la ligne suivante dans vlc.init:
spawn-input method=10 filename=braindead
parent 9a726693
...@@ -29,7 +29,7 @@ default: ...@@ -29,7 +29,7 @@ default:
$(dependancies): .dep/%.d: %.c $(dependancies): .dep/%.d: %.c
@test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*) @test -d .dep/$(dir $*) || mkdir -p .dep/$(dir $*)
@echo "generating dependancies for $*.c" @echo "generating dependancies for $*.c"
@$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $< \ @$(SHELL) -ec '$(CC) $(DCFLAGS) $(CFLAGS) $(DEFINE) $< \
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \ | sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/$(subst /,\/,$*).o \
.dep\/$(subst /,\/,$*).d : /g'\'' > $@; \ .dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
[ -s $@ ] || rm -f $@' [ -s $@ ] || rm -f $@'
# Generated automatically from Makefile.in by configure. # Generated automatically from Makefile.in by configure.
# Generated automatically from Makefile.in by configure.
################################################################################ ################################################################################
# vlc (VideoLAN Client) main makefile # vlc (VideoLAN Client) main makefile
# (c)1998 VideoLAN # (c)1998 VideoLAN
...@@ -19,7 +20,7 @@ AOUT += dsp ...@@ -19,7 +20,7 @@ AOUT += dsp
AOUT += dummy AOUT += dummy
# Video output settings # Video output settings
VOUT += x11 #VOUT += x11
#VOUT += fb #VOUT += fb
#VOUT += ggi #VOUT += ggi
#VOUT += glide #VOUT += glide
...@@ -68,8 +69,8 @@ DEBUG=0 ...@@ -68,8 +69,8 @@ DEBUG=0
#----------------- do not change anything below this line ---------------------- #----------------- do not change anything below this line ----------------------
prefix=@prefix@ prefix=/usr/local
INSTALL=@INSTALL@ INSTALL=/bin/install -c
################################################################################ ################################################################################
# Configuration pre-processing # Configuration pre-processing
...@@ -127,11 +128,11 @@ ifeq ($(SYS),LINUX) ...@@ -127,11 +128,11 @@ ifeq ($(SYS),LINUX)
LIB += -lpthread -ldl LIB += -lpthread -ldl
endif endif
ifeq ($SYS),BEOS) ifeq ($(SYS),BEOS)
LIB += -llibroot -llibgame -llibbe LIB += -lbe -lroot -lgame
endif else
LIB += -lm LIB += -lm
endif
# #
# C compiler flags: compilation # C compiler flags: compilation
...@@ -141,6 +142,9 @@ CCFLAGS += -Wall ...@@ -141,6 +142,9 @@ CCFLAGS += -Wall
CCFLAGS += -D_REENTRANT CCFLAGS += -D_REENTRANT
CCFLAGS += -D_GNU_SOURCE CCFLAGS += -D_GNU_SOURCE
# flags needed for clean beos compilation
CCFLAGS += -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual
# Optimizations : don't compile debug versions with them # Optimizations : don't compile debug versions with them
CCFLAGS += -O6 CCFLAGS += -O6
CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global CCFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
...@@ -192,7 +196,7 @@ LCFLAGS += -Wall ...@@ -192,7 +196,7 @@ LCFLAGS += -Wall
# Debugging support # Debugging support
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
CFLAGS += -g CFLAGS += -g
#CFLAGS += -pg CFLAGS += -pg
endif endif
################################################################################# #################################################################################
...@@ -276,6 +280,7 @@ misc_obj = misc/mtime.o \ ...@@ -276,6 +280,7 @@ misc_obj = misc/mtime.o \
misc/plugins.o \ misc/plugins.o \
misc/decoder_fifo.o misc/decoder_fifo.o
C_OBJ = $(interface_obj) \ C_OBJ = $(interface_obj) \
$(input_obj) \ $(input_obj) \
$(audio_output_obj) \ $(audio_output_obj) \
...@@ -289,6 +294,10 @@ C_OBJ = $(interface_obj) \ ...@@ -289,6 +294,10 @@ C_OBJ = $(interface_obj) \
$(vlan_obj) \ $(vlan_obj) \
$(misc_obj) $(misc_obj)
ifeq ($(SYS), BEOS)
CPP_OBJ = misc/beos_specific.o
endif
# #
# Assembler Objects # Assembler Objects
# #
...@@ -317,9 +326,10 @@ PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin) ...@@ -317,9 +326,10 @@ PLUGIN_OBJ = $(intf_plugin) $(aout_plugin) $(vout_plugin)
# Other lists of files # Other lists of files
# #
C_OBJ := $(C_OBJ:%.o=src/%.o) C_OBJ := $(C_OBJ:%.o=src/%.o)
CPP_OBJ := $(CPP_OBJ:%.o=src/%.o)
ASM_OBJ := $(ASM_OBJ:%.o=src/%.o) ASM_OBJ := $(ASM_OBJ:%.o=src/%.o)
sources := $(C_OBJ:%.o=%.c) $(PLUGIN_OBJ:%.so=%.c) sources_c := $(C_OBJ:%.o=%.c)
dependancies := $(sources:%.c=.dep/%.d) dependancies := $(sources_c:%.c=.dep/%.d)
# All symbols must be exported # All symbols must be exported
export export
...@@ -331,10 +341,10 @@ export ...@@ -331,10 +341,10 @@ export
# #
# Virtual targets # Virtual targets
# #
all: vlc all: vlc plugins
clean: clean:
rm -f $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ) rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ)
distclean: clean distclean: clean
rm -f **/*.o **/*.so **/*~ *.log rm -f **/*.o **/*.so **/*~ *.log
...@@ -376,8 +386,15 @@ FORCE: ...@@ -376,8 +386,15 @@ FORCE:
# #
# Real targets # Real targets
# #
vlc: $(C_OBJ) $(ASM_OBJ) $(PLUGIN_OBJ) vlc: $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
$(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(ASM_OBJ) ifeq ($(SYS), BEOS)
$(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) -Xlinker -soname=_APP_ -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
# ln -s ../vlc ./plugins/_APP_
else
$(CC) $(CCFLAGS) $(LCFLAGS) $(CFLAGS) --export-dynamic -rdynamic -o $@ $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ)
endif
plugins: $(PLUGIN_OBJ)
# #
# Generic rules (see below) # Generic rules (see below)
...@@ -391,19 +408,23 @@ $(C_OBJ): %.o: %.c ...@@ -391,19 +408,23 @@ $(C_OBJ): %.o: %.c
@echo "compiling $*.o from $*.c" @echo "compiling $*.o from $*.c"
@$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $< @$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
$(CPP_OBJ): %.o: %.cpp
@echo "compiling $*.o from $*.cpp"
@$(CC) $(CCFLAGS) $(CFLAGS) -c -o $@ $<
$(ASM_OBJ): %.o: Makefile.dep $(ASM_OBJ): %.o: Makefile.dep
$(ASM_OBJ): %.o: %.S $(ASM_OBJ): %.o: %.S
@echo "assembling $*.o from $*.S" @echo "assembling $*.o from $*.S"
@$(CC) $(CFLAGS) -c -o $@ $< @$(CC) $(CFLAGS) -c -o $@ $<
$(PLUGIN_OBJ): %.so: Makefile.dep #$(PLUGIN_OBJ): %.so: Makefile.dep
$(PLUGIN_OBJ): %.so: .dep/%.d #$(PLUGIN_OBJ): %.so: .dep/%.d
# audio plugins # audio plugins
plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c plugins/aout/aout_dummy.so plugins/aout/aout_dsp.so: %.so: %.c
@echo "compiling $*.so from $*.c" @echo "compiling $*.so from $*.c"
ifeq ($(SYS), BEOS) ifeq ($(SYS), BEOS)
@$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $< @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
else else
@$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $< @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
endif endif
...@@ -421,7 +442,7 @@ plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \ ...@@ -421,7 +442,7 @@ plugins/intf/intf_dummy.so plugins/vout/vout_dummy.so \
plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c plugins/intf/intf_fb.so plugins/vout/vout_fb.so: %.so: %.c
@echo "compiling $*.so from $*.c" @echo "compiling $*.so from $*.c"
ifeq ($(SYS), BEOS) ifeq ($(SYS), BEOS)
@$(CC) $(CCFLAGS) $(CFLAGS) -nostart -o $@ $< @$(CC) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
else else
@$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $< @$(CC) $(CCFLAGS) $(CFLAGS) -shared -o $@ $<
endif endif
...@@ -446,6 +467,14 @@ plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c ...@@ -446,6 +467,14 @@ plugins/intf/intf_ggi.so plugins/vout/vout_ggi.so: %.so: %.c
@echo "compiling $*.so from $*.c" @echo "compiling $*.so from $*.c"
@$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $< @$(CC) $(CCFLAGS) $(CFLAGS) -lggi -shared -o $@ $<
plugins/intf/intf_beos.so: %.so: %.cpp
@echo "compiling $*.so from $*.cpp"
@$(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
plugins/vout/vout_beos.so: %.so: %.cpp
@echo "compiling $*.so from $*.cpp"
@$(CC) $(LCFLAGS) $(CCFLAGS) $(CFLAGS) -nostart -Xlinker -soname=$@ -o $@ $< plugins/_APP_
################################################################################ ################################################################################
# Note on generic rules and dependancies # Note on generic rules and dependancies
......
/*****************************************************************************
* beos_init.h: Initialization for BeOS specific features
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
* Jean-Marc Dressler
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*****************************************************************************/
/*****************************************************************************
* Prototypes
*****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
void beos_Init( void );
void beos_Clean( void );
char * beos_GetProgramPath( void );
#ifdef __cplusplus
}
#endif
\ No newline at end of file
/*****************************************************************************
* beos_window.h: beos window class prototype
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
* Jean-Marc Dressler
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*****************************************************************************/
class VideoWindow : public BDirectWindow
{
public:
// standard constructor and destructor
VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_output);
~VideoWindow();
// standard window member
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
// this is the hook controling direct screen connection
virtual void DirectConnected(direct_buffer_info *info);
int32 i_bytes_per_pixel;
int32 i_screen_depth;
vout_thread_t *p_vout;
uint8 *fBits;
int32 fRowBytes;
color_space fFormat;
clipping_rect fBounds;
uint32 fNumClipRects;
clipping_rect *fClipList;
bool fDirty;
bool fReady;
bool fConnected;
bool fConnectionDisabled;
BLocker *locker;
thread_id fDrawThreadID;
};
class InterfaceWindow : public BWindow
{
public:
InterfaceWindow( BRect frame, const char *name, intf_thread_t *p_intf );
~InterfaceWindow();
// standard window member
virtual bool QuitRequested();
virtual void MessageReceived(BMessage *message);
intf_thread_t *p_interface;
};
class InterfaceView : public BView
{
public:
InterfaceView();
~InterfaceView();
virtual void MessageReceived(BMessage *message);
};
\ No newline at end of file
...@@ -103,12 +103,14 @@ typedef struct video_parser_s * p_video_parser_t; ...@@ -103,12 +103,14 @@ typedef struct video_parser_s * p_video_parser_t;
#define PAD(n, d) ( ((n) % (d)) ? ((((n) / (d)) + 1) * (d)) : (n) ) #define PAD(n, d) ( ((n) % (d)) ? ((((n) / (d)) + 1) * (d)) : (n) )
/* MAX and MIN: self explanatory */ /* MAX and MIN: self explanatory */
//#ifndef SYS_BEOS
#ifndef MAX #ifndef MAX
#define MAX(a, b) ( ((a) > (b)) ? (a) : (b) ) #define MAX(a, b) ( ((a) > (b)) ? (a) : (b) )
#endif #endif
#ifndef MIN #ifndef MIN
#define MIN(a, b) ( ((a) < (b)) ? (a) : (b) ) #define MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
#endif #endif
//#endif
/* MSB (big endian)/LSB (little endian) convertions - network order is always /* MSB (big endian)/LSB (little endian) convertions - network order is always
* MSB, and should be used for both network communications and files. Note that * MSB, and should be used for both network communications and files. Note that
......
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*****************************************************************************/ *****************************************************************************/
#include <stdio.h>
#if defined(HAVE_PTHREAD_H) /* pthreads (Linux & BSD for example) */ #if defined(HAVE_PTHREAD_H) /* pthreads (Linux & BSD for example) */
#include <pthread.h> #include <pthread.h>
...@@ -30,9 +32,10 @@ ...@@ -30,9 +32,10 @@
#include <cthreads.h> #include <cthreads.h>
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) /* BeOS */ #elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) /* BeOS */
#undef MAX
#undef MIN
#include <kernel/OS.h> #include <kernel/OS.h>
#include <kernel/scheduler.h> #include <kernel/scheduler.h>
#else #else
#error no threads available on your system ! #error no threads available on your system !
#endif #endif
...@@ -228,12 +231,11 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex ) ...@@ -228,12 +231,11 @@ static __inline__ int vlc_mutex_init( vlc_mutex_t *p_mutex )
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
/*
// check the arguments and whether it's already been initialized // check the arguments and whether it's already been initialized
if( !p_mutex ) if( !p_mutex ) return B_BAD_VALUE;
return B_BAD_VALUE; if( p_mutex->init == 9999 ) return EALREADY;
*/
if( p_mutex->init == 9999 )
return EALREADY;
p_mutex->lock = create_sem( 1, "BeMutex" ); p_mutex->lock = create_sem( 1, "BeMutex" );
p_mutex->owner = -1; p_mutex->owner = -1;
...@@ -257,18 +259,16 @@ static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex ) ...@@ -257,18 +259,16 @@ static __inline__ int vlc_mutex_lock( vlc_mutex_t *p_mutex )
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
status_t err; status_t err;
/*
if( !p_mutex ) if( !p_mutex ) return B_BAD_VALUE;
return B_BAD_VALUE; if( p_mutex->init < 2000 ) return B_NO_INIT;
if( p_mutex->init < 2000 )
return B_NO_INIT;
lazy_init_mutex( p_mutex ); lazy_init_mutex( p_mutex );
*/
err = acquire_sem( p_mutex->lock ); err = acquire_sem( p_mutex->lock );
if( !err ) /*
p_mutex->owner = find_thread( NULL ); if( !err ) p_mutex->owner = find_thread( NULL );
*/
return err; return err;
...@@ -288,11 +288,9 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex ) ...@@ -288,11 +288,9 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
return 0; return 0;
#elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H) #elif defined(HAVE_KERNEL_SCHEDULER_H) && defined(HAVE_KERNEL_OS_H)
if(! p_mutex) /*
return B_BAD_VALUE; if(! p_mutex) return B_BAD_VALUE;
if( p_mutex->init < 2000 ) return B_NO_INIT;
if( p_mutex->init < 2000 )
return B_NO_INIT;
lazy_init_mutex( p_mutex ); lazy_init_mutex( p_mutex );
...@@ -300,6 +298,7 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex ) ...@@ -300,6 +298,7 @@ static __inline__ int vlc_mutex_unlock( vlc_mutex_t *p_mutex )
return ENOLCK; return ENOLCK;
p_mutex->owner = -1; p_mutex->owner = -1;
*/
release_sem( p_mutex->lock ); release_sem( p_mutex->lock );
return B_OK; return B_OK;
......
...@@ -95,7 +95,6 @@ aout_thread_t *aout_CreateThread( int *pi_status ) ...@@ -95,7 +95,6 @@ aout_thread_t *aout_CreateThread( int *pi_status )
/* Request an interface plugin */ /* Request an interface plugin */
psz_method = main_GetPszVariable( AOUT_METHOD_VAR, AOUT_DEFAULT_METHOD ); psz_method = main_GetPszVariable( AOUT_METHOD_VAR, AOUT_DEFAULT_METHOD );
if( RequestPlugin( &p_aout->aout_plugin, "aout", psz_method ) ) if( RequestPlugin( &p_aout->aout_plugin, "aout", psz_method ) )
{ {
intf_ErrMsg( "error: could not open audio plugin aout_%s.so\n", psz_method ); intf_ErrMsg( "error: could not open audio plugin aout_%s.so\n", psz_method );
......
This diff is collapsed.
...@@ -349,7 +349,7 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a ...@@ -349,7 +349,7 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a
* Convert message to string * Convert message to string
*/ */
#ifdef SYS_BEOS #ifdef SYS_BEOS
psz_str = (char*) malloc( INTF_MAX_MSG_SIZE ); psz_str = (char*) malloc( strlen(psz_format) + INTF_MAX_MSG_SIZE );
vsprintf( psz_str, psz_format, ap ); vsprintf( psz_str, psz_format, ap );
#else #else
vasprintf( &psz_str, psz_format, ap ); vasprintf( &psz_str, psz_format, ap );
......
...@@ -48,6 +48,10 @@ ...@@ -48,6 +48,10 @@
#include "audio_output.h" #include "audio_output.h"
#ifdef SYS_BEOS
#include "beos_specific.h"
#endif
#include "main.h" #include "main.h"
/***************************************************************************** /*****************************************************************************
...@@ -146,6 +150,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -146,6 +150,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
main_t main_data; /* root of all data - see main.h */ main_t main_data; /* root of all data - see main.h */
p_main = &main_data; /* set up the global variable */ p_main = &main_data; /* set up the global variable */
/*
* System specific initialization code
*/
#ifdef SYS_BEOS
beos_Init();
#endif
/* /*
* Read configuration, initialize messages interface and set up program * Read configuration, initialize messages interface and set up program
*/ */
...@@ -221,6 +232,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] ) ...@@ -221,6 +232,13 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
input_VlanDestroy(); input_VlanDestroy();
} }
/*
* System specific cleaning code
*/
#ifdef SYS_BEOS
beos_Clean();
#endif
/* /*
* Terminate messages interface and program * Terminate messages interface and program
*/ */
......
/*****************************************************************************
* beos_init.cpp: Initialization for BeOS specific features
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
*
* Authors:
* Jean-Marc Dressler
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*****************************************************************************/
#include "defs.h"
#include <Application.h>
#include <Roster.h>
#include <Path.h>
#include <stdio.h>
#include <malloc.h>
extern "C"
{
#include "common.h"
#include "threads.h"
#include "mtime.h"
}
#include "beos_specific.h"
/*****************************************************************************
* Static vars
*****************************************************************************/
static vlc_thread_t beos_app_thread;
static char * psz_beos_program_path;
extern "C"
{
void beos_AppThread( void * args )
{
BApplication * BeApp = new BApplication("application/x-VLC");
BeApp->Run();
delete BeApp;
}
void beos_Init( void )
{
int i_lenght;
BPath path;
app_info info;
vlc_thread_create( &beos_app_thread, "app thread", (vlc_thread_func_t)beos_AppThread, 0 );
msleep( 100000 );
// FIXME: we need to verify that be_app is initialized and the msleep is not enough
// but the following code does not work as it should and I have no good
// solution at the moment.
//while( be_app == NULL )
// msleep( 5000 );
be_app->GetAppInfo(&info);
BEntry entry(&info.ref);
entry.GetPath(&path);
path.GetParent(&path);
i_lenght = strlen( path.Path() );
psz_beos_program_path = (char*) malloc( i_lenght+1 ); /* XXX */
strcpy( psz_beos_program_path, path.Path() );
}
void beos_Clean( void )
{
free( psz_beos_program_path ); /* XXX */
be_app->PostMessage( B_QUIT_REQUESTED );
vlc_thread_join( beos_app_thread );
}
char * beos_GetProgramPath( void )
{
return( psz_beos_program_path );
}
} /* extern "C" */
\ No newline at end of file
...@@ -35,6 +35,10 @@ ...@@ -35,6 +35,10 @@
#error no dynamic plugins available on your system ! #error no dynamic plugins available on your system !
#endif #endif
#ifdef SYS_BEOS
#include "beos_specific.h"
#endif
#include "plugins.h" #include "plugins.h"
#define PLUGIN_PATH_COUNT 5 #define PLUGIN_PATH_COUNT 5
...@@ -54,15 +58,21 @@ int RequestPlugin ( plugin_id_t * p_plugin, char * psz_mask, char * psz_name ) ...@@ -54,15 +58,21 @@ int RequestPlugin ( plugin_id_t * p_plugin, char * psz_mask, char * psz_name )
for ( i_count = 0 ; i_count < PLUGIN_PATH_COUNT ; i_count++ ) for ( i_count = 0 ; i_count < PLUGIN_PATH_COUNT ; i_count++ )
{ {
#ifdef SYS_BEOS
char * psz_program_path;
psz_program_path = beos_GetProgramPath();
psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + strlen(psz_program_path) + i_length + 6 );
sprintf( psz_plugin, "%s/%s/%s_%s.so", psz_program_path, psz_plugin_path[i_count], psz_mask, psz_name );
#else
psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + i_length + 6 ); psz_plugin = malloc( strlen(psz_plugin_path[i_count]) + i_length + 6 );
sprintf( psz_plugin, "%s/%s_%s.so", psz_plugin_path[i_count], psz_mask, psz_name ); sprintf( psz_plugin, "%s/%s_%s.so", psz_plugin_path[i_count], psz_mask, psz_name );
#endif
#if defined(HAVE_DLFCN_H) #if defined(HAVE_DLFCN_H)
*p_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL ); *p_plugin = dlopen( psz_plugin, RTLD_NOW | RTLD_GLOBAL );
#elif defined(HAVE_IMAGE_H) #elif defined(HAVE_IMAGE_H)
*p_plugin = load_add_on( psz_plugin ); *p_plugin = load_add_on( psz_plugin );
#endif #endif
free( psz_plugin ); free( psz_plugin );
...@@ -70,11 +80,9 @@ int RequestPlugin ( plugin_id_t * p_plugin, char * psz_mask, char * psz_name ) ...@@ -70,11 +80,9 @@ int RequestPlugin ( plugin_id_t * p_plugin, char * psz_mask, char * psz_name )
#if defined(HAVE_DLFCN_H) #if defined(HAVE_DLFCN_H)
if( *p_plugin != NULL ) if( *p_plugin != NULL )
return( 0 ); return( 0 );
#elif defined(HAVE_IMAGE_H) #elif defined(HAVE_IMAGE_H)
if( *p_plugin >= 0 ) if( *p_plugin >= 0 )
return( 0 ); return( 0 );
#endif #endif
} }
...@@ -85,10 +93,8 @@ void TrashPlugin ( plugin_id_t plugin ) ...@@ -85,10 +93,8 @@ void TrashPlugin ( plugin_id_t plugin )
{ {
#if defined(HAVE_DLFCN_H) #if defined(HAVE_DLFCN_H)
dlclose( plugin ); dlclose( plugin );
#elif defined(HAVE_IMAGE_H) #elif defined(HAVE_IMAGE_H)
unload_add_on( plugin ); unload_add_on( plugin );
#endif #endif
} }
...@@ -96,15 +102,12 @@ void * GetPluginFunction ( plugin_id_t plugin, char *psz_name ) ...@@ -96,15 +102,12 @@ void * GetPluginFunction ( plugin_id_t plugin, char *psz_name )
{ {
#if defined(HAVE_DLFCN_H) #if defined(HAVE_DLFCN_H)
return( dlsym(plugin, psz_name) ); return( dlsym(plugin, psz_name) );
#elif defined(HAVE_IMAGE_H) #elif defined(HAVE_IMAGE_H)
void * p_func; void * p_func;
if( get_image_symbol( plugin, psz_name, B_SYMBOL_TYPE_TEXT, &p_func ) ) if( get_image_symbol( plugin, psz_name, B_SYMBOL_TYPE_TEXT, &p_func ) )
return( NULL ); return( NULL );
else else
return( p_func ); return( p_func );
#endif #endif
} }
...@@ -1191,7 +1191,9 @@ last_display_date = display_date; ...@@ -1191,7 +1191,9 @@ last_display_date = display_date;
if( b_display && !(p_vout->i_changes & VOUT_NODISPLAY_CHANGE) ) if( b_display && !(p_vout->i_changes & VOUT_NODISPLAY_CHANGE) )
{ {
p_vout->p_sys_display( p_vout ); p_vout->p_sys_display( p_vout );
#ifndef SYS_BEOS
p_vout->i_buffer_index = ++p_vout->i_buffer_index & 1; p_vout->i_buffer_index = ++p_vout->i_buffer_index & 1;
#endif
} }
/* /*
......
This diff is collapsed.
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