Commit d1f89a0c authored by Eric Petit's avatar Eric Petit

+ configure.ac: don't build OpenGL support on BeOS although it has gl.h

 + extras/contrib/src/*: build libmpeg2 w/o mmxext and 3dnow on BeOS
   (buggy compiler)
 + modules/gui/beos/*: quick compile fixes
 + modules/video_filter/deinterlace.c: require mmxext instead of mmx
 + Makefile.am: on BeOS, build a VLC bundle a la OS X
parent 40a45dc8
......@@ -405,14 +405,28 @@ vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
esac
if HAVE_BEOS
xres -o $@ $(srcdir)/share/vlc_beos.rsrc
mimeset -f $@
rm -Rf $(srcdir)/locale ; mkdir -p "$(srcdir)/locale"
vlc-bundle: vlc
rm -rf $(srcdir)/vlc-bundle ; mkdir -p $(srcdir)/vlc-bundle
cp $(srcdir)/vlc $(srcdir)/vlc-bundle/
xres -o $(srcdir)/vlc-bundle/vlc $(srcdir)/share/vlc_beos.rsrc
for i in "" `$(VLC_CONFIG) --target plugin` ; do \
if test -n "$$i" ; then \
mkdir -p $(srcdir)/vlc-bundle/plugins ; \
cp "$$i$(LIBEXT)" $(srcdir)/vlc-bundle/plugins/ ; \
fi ; \
done
if test -d $(srcdir)/extras/contrib/vlc-lib ; then \
mkdir -p $(srcdir)/vlc-bundle/lib ; \
for i in $(srcdir)/extras/contrib/vlc-lib/*.so ; do \
cp $$i $(srcdir)/vlc-bundle/lib/ ; \
done ; \
fi
for i in $(ALL_LINGUAS); do \
mkdir -p "$(srcdir)/locale/$${i}/LC_MESSAGES" ; \
cp "$(srcdir)/po/$${i}.gmo" \
"$(srcdir)/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \
mkdir -p "$(srcdir)/vlc-bundle/locale/$$i/LC_MESSAGES" ; \
cp "$(srcdir)/po/$$i.gmo" \
"$(srcdir)/vlc-bundle/locale/$$i/LC_MESSAGES/vlc.mo" || true ; \
done
find $(srcdir)/vlc-bundle -type f $(srcdir)/vlc-bundle -exec mimeset -f "{}" \;
endif
# Install the modules and the symlinks
......
......@@ -2468,7 +2468,7 @@ dnl (enabled by default except on win32)
dnl
AC_ARG_ENABLE(opengl,
[ --enable-opengl OpenGL support (default enabled)])
if test "${enable_opengl}" != "no"; then
if test "${enable_opengl}" != "no" && test "${SYS}" != "beos"; then
AC_CHECK_HEADERS(GL/gl.h, [
VLC_ADD_PLUGINS([opengl])
VLC_ADD_LDFLAGS([opengl],[-L${x_libraries} -lGL -lGLU])
......
......@@ -58,10 +58,7 @@ all: .autoconf .libtool .automake .iconv .intl .pkgcfg .freetype .fribidi \
endif
ifeq ($(SYS),BEOS)
all: .perl .autoconf .libtool .automake .iconv .intl .freetype .fribidi \
.a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \
.FLAC .speex .faad .faac .lame .ffmpeg .openslp \
.dvdcss .dvdread .dvdnav .dvbpsi .live .goom .caca .dts .mod \
.cddb .cdio .vcdimager
.a52 .mpeg2 .id3tag .mad
endif
FORCE:
......@@ -354,6 +351,7 @@ mpeg2dec-$(MPEG2DEC_VERSION).tar.gz:
mpeg2dec: mpeg2dec-$(MPEG2DEC_VERSION).tar.gz
$(EXTRACT_GZ)
patch -p 0 < Patches/mpeg2dec.patch
.mpeg2: mpeg2dec
(cd $<; ./configure --prefix=$(PREFIX) --without-x --disable-dsl && make && make install)
......@@ -376,7 +374,9 @@ libid3tag: libid3tag-$(LIBID3TAG_VERSION).tar.gz
.id3tag: libid3tag
(cd $<; ./configure --prefix=$(PREFIX) && make && make install)
ifeq ($(SYS),DARWIN)
$(INSTALL_NAME)
endif
touch $@
CLEAN_FILE += .id3tag
......@@ -395,7 +395,9 @@ libmad: libmad-$(LIBMAD_VERSION).tar.gz
.mad: libmad
(cd $<; ./configure --prefix=$(PREFIX) CFLAGS="-O3" && make && make install)
ifeq ($(SYS),DARWIN)
$(INSTALL_NAME)
endif
touch $@
CLEAN_FILE += .mad
......
diff -ru mpeg2dec-original/libmpeg2/convert/convert_internal.h mpeg2dec/libmpeg2/convert/convert_internal.h
--- mpeg2dec-original/libmpeg2/convert/convert_internal.h Fri Jan 23 10:07:50 2004
+++ mpeg2dec/libmpeg2/convert/convert_internal.h Thu Jul 22 23:40:41 2004
@@ -34,8 +34,10 @@
typedef void mpeg2convert_copy_t (void * id, uint8_t * const * src,
unsigned int v_offset);
+#ifndef __BEOS__
mpeg2convert_copy_t * mpeg2convert_rgb_mmxext (int bpp, int mode,
const mpeg2_sequence_t * seq);
+#endif
mpeg2convert_copy_t * mpeg2convert_rgb_mmx (int bpp, int mode,
const mpeg2_sequence_t * seq);
mpeg2convert_copy_t * mpeg2convert_rgb_vis (int bpp, int mode,
diff -ru mpeg2dec-original/libmpeg2/convert/rgb.c mpeg2dec/libmpeg2/convert/rgb.c
--- mpeg2dec-original/libmpeg2/convert/rgb.c Fri Jan 23 10:07:56 2004
+++ mpeg2dec/libmpeg2/convert/rgb.c Thu Jul 22 23:41:21 2004
@@ -500,10 +500,12 @@
int rgb_stride_min = ((bpp + 7) >> 3) * seq->width;
#ifdef ARCH_X86
+#ifndef __BEOS__
if (!copy && (accel & MPEG2_ACCEL_X86_MMXEXT)) {
convert420 = 0;
copy = mpeg2convert_rgb_mmxext (order, bpp, seq);
}
+#endif
if (!copy && (accel & MPEG2_ACCEL_X86_MMX)) {
convert420 = 0;
copy = mpeg2convert_rgb_mmx (order, bpp, seq);
diff -ru mpeg2dec-original/libmpeg2/convert/rgb_mmx.c mpeg2dec/libmpeg2/convert/rgb_mmx.c
--- mpeg2dec-original/libmpeg2/convert/rgb_mmx.c Fri Jan 23 10:07:58 2004
+++ mpeg2dec/libmpeg2/convert/rgb_mmx.c Thu Jul 22 23:39:27 2004
@@ -272,6 +272,7 @@
} while (i);
}
+#ifndef __BEOS__
static void mmxext_rgb16 (void * id, uint8_t * const * src,
unsigned int v_offset)
{
@@ -283,6 +284,7 @@
{
argb32 (id, src, v_offset, CPU_MMXEXT);
}
+#endif
static void mmx_rgb16 (void * id, uint8_t * const * src, unsigned int v_offset)
{
@@ -295,6 +297,7 @@
argb32 (id, src, v_offset, CPU_MMX);
}
+#ifndef __BEOS__
mpeg2convert_copy_t * mpeg2convert_rgb_mmxext (int order, int bpp,
const mpeg2_sequence_t * seq)
{
@@ -306,6 +309,7 @@
}
return NULL; /* Fallback to C */
}
+#endif
mpeg2convert_copy_t * mpeg2convert_rgb_mmx (int order, int bpp,
const mpeg2_sequence_t * seq)
diff -ru mpeg2dec-original/libmpeg2/idct.c mpeg2dec/libmpeg2/idct.c
--- mpeg2dec-original/libmpeg2/idct.c Fri Sep 19 09:26:42 2003
+++ mpeg2dec/libmpeg2/idct.c Thu Jul 22 19:11:53 2004
@@ -236,11 +236,15 @@
void mpeg2_idct_init (uint32_t accel)
{
#ifdef ARCH_X86
+#ifndef __BEOS__
if (accel & MPEG2_ACCEL_X86_MMXEXT) {
mpeg2_idct_copy = mpeg2_idct_copy_mmxext;
mpeg2_idct_add = mpeg2_idct_add_mmxext;
mpeg2_idct_mmx_init ();
} else if (accel & MPEG2_ACCEL_X86_MMX) {
+#else
+ if (accel & MPEG2_ACCEL_X86_MMX) {
+#endif
mpeg2_idct_copy = mpeg2_idct_copy_mmx;
mpeg2_idct_add = mpeg2_idct_add_mmx;
mpeg2_idct_mmx_init ();
diff -ru mpeg2dec-original/libmpeg2/idct_mmx.c mpeg2dec/libmpeg2/idct_mmx.c
--- mpeg2dec-original/libmpeg2/idct_mmx.c Fri Sep 19 09:26:42 2003
+++ mpeg2dec/libmpeg2/idct_mmx.c Thu Jul 22 19:11:53 2004
@@ -79,6 +79,7 @@
#endif
+#ifndef __BEOS__
/* MMXEXT row IDCT */
#define mmxext_table(c1,c2,c3,c4,c5,c6,c7) { c4, c2, -c4, -c2, \
@@ -192,6 +193,7 @@
movq_m2r (*(table+4), mm4); /* mm4 = C6 C4 C6 C4 */
pshufw_r2r (mm2, mm2, 0x4e); /* mm2 = x2 x0 x6 x4 */
}
+#endif /* __BEOS__ */
/* MMX row IDCT */
@@ -689,6 +691,7 @@
#define CPU_MMXEXT 0
#define CPU_MMX 1
+#ifndef __BEOS__
#define dup4(reg) \
do { \
if (cpu != CPU_MMXEXT) { \
@@ -697,6 +700,13 @@
} else \
pshufw_r2r (reg, reg, 0x00); \
} while (0)
+#else
+#define dup4(reg) \
+do { \
+ punpcklwd_r2r (reg, reg); \
+ punpckldq_r2r (reg, reg); \
+} while (0)
+#endif
static inline void block_add_DC (int16_t * const block, uint8_t * dest,
const int stride, const int cpu)
@@ -749,6 +759,7 @@
}
+#ifndef __BEOS__
declare_idct (mmxext_idct, mmxext_table,
mmxext_row_head, mmxext_row, mmxext_row_tail, mmxext_row_mid)
@@ -770,6 +781,7 @@
} else
block_add_DC (block, dest, stride, CPU_MMXEXT);
}
+#endif /* __BEOS__ */
declare_idct (mmx_idct, mmx_table,
diff -ru mpeg2dec-original/libmpeg2/motion_comp.c mpeg2dec/libmpeg2/motion_comp.c
--- mpeg2dec-original/libmpeg2/motion_comp.c Mon Oct 6 02:31:52 2003
+++ mpeg2dec/libmpeg2/motion_comp.c Thu Jul 22 22:57:54 2004
@@ -34,11 +34,15 @@
void mpeg2_mc_init (uint32_t accel)
{
#ifdef ARCH_X86
+#ifndef __BEOS__
if (accel & MPEG2_ACCEL_X86_MMXEXT)
mpeg2_mc = mpeg2_mc_mmxext;
else if (accel & MPEG2_ACCEL_X86_3DNOW)
mpeg2_mc = mpeg2_mc_3dnow;
else if (accel & MPEG2_ACCEL_X86_MMX)
+#else
+ if (accel & MPEG2_ACCEL_X86_MMX)
+#endif
mpeg2_mc = mpeg2_mc_mmx;
else
#endif
diff -ru mpeg2dec-original/libmpeg2/motion_comp_mmx.c mpeg2dec/libmpeg2/motion_comp_mmx.c
--- mpeg2dec-original/libmpeg2/motion_comp_mmx.c Thu Aug 21 08:00:58 2003
+++ mpeg2dec/libmpeg2/motion_comp_mmx.c Thu Jul 22 22:57:14 2004
@@ -500,7 +500,7 @@
-
+#ifndef __BEOS__
/* CPU_MMXEXT/CPU_3DNOW adaptation layer */
@@ -1001,5 +1001,7 @@
MPEG2_MC_EXTERN (3dnow)
+
+#endif /* __BEOS__ */
#endif
diff -ru mpeg2dec-original/libmpeg2/mpeg2_internal.h mpeg2dec/libmpeg2/mpeg2_internal.h
--- mpeg2dec-original/libmpeg2/mpeg2_internal.h Tue Feb 10 05:43:54 2004
+++ mpeg2dec/libmpeg2/mpeg2_internal.h Thu Jul 22 23:43:36 2004
@@ -255,9 +255,11 @@
void mpeg2_idct_init (uint32_t accel);
/* idct_mmx.c */
+#ifndef __BEOS__
void mpeg2_idct_copy_mmxext (int16_t * block, uint8_t * dest, int stride);
void mpeg2_idct_add_mmxext (int last, int16_t * block,
uint8_t * dest, int stride);
+#endif
void mpeg2_idct_copy_mmx (int16_t * block, uint8_t * dest, int stride);
void mpeg2_idct_add_mmx (int last, int16_t * block,
uint8_t * dest, int stride);
@@ -295,8 +297,10 @@
extern mpeg2_mc_t mpeg2_mc_c;
extern mpeg2_mc_t mpeg2_mc_mmx;
+#ifndef __BEOS__
extern mpeg2_mc_t mpeg2_mc_mmxext;
extern mpeg2_mc_t mpeg2_mc_3dnow;
+#endif
extern mpeg2_mc_t mpeg2_mc_altivec;
extern mpeg2_mc_t mpeg2_mc_alpha;
extern mpeg2_mc_t mpeg2_mc_vis;
......@@ -41,6 +41,7 @@
#include <vlc/vlc.h>
#include <vlc/aout.h>
#include <vlc/intf.h>
#include <vlc/input.h>
/* BeOS interface headers */
#include "VlcWrapper.h"
......@@ -417,10 +418,10 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
case STOP_PLAYBACK:
// this currently stops playback not nicely
if (playback_status > UNDEF_S)
if (playback_status != -1)
{
p_wrapper->PlaylistStop();
p_mediaControl->SetStatus(UNDEF_S, DEFAULT_RATE);
p_mediaControl->SetStatus(-1, INPUT_RATE_DEFAULT);
}
break;
......@@ -429,7 +430,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
case PAUSE_PLAYBACK:
/* toggle between pause and play */
if (playback_status > UNDEF_S)
if (playback_status > -1)
{
/* pause if currently playing */
if ( playback_status == PLAYING_S )
......@@ -449,31 +450,31 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break;
case HEIGHTH_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE * 8 );
p_wrapper->InputSetRate( INPUT_RATE_DEFAULT * 8 );
break;
case QUARTER_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE * 4 );
p_wrapper->InputSetRate( INPUT_RATE_DEFAULT * 4 );
break;
case HALF_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE * 2 );
p_wrapper->InputSetRate( INPUT_RATE_DEFAULT * 2 );
break;
case NORMAL_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE );
p_wrapper->InputSetRate( INPUT_RATE_DEFAULT );
break;
case TWICE_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE / 2 );
p_wrapper->InputSetRate( INPUT_RATE_DEFAULT / 2 );
break;
case FOUR_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE / 4 );
p_wrapper->InputSetRate( INPUT_RATE_DEFAULT / 4 );
break;
case HEIGHT_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE / 8 );
p_wrapper->InputSetRate( INPUT_RATE_DEFAULT / 8 );
break;
case SEEK_PLAYBACK:
......@@ -482,7 +483,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
// volume related messages
case VOLUME_CHG:
/* adjust the volume */
if (playback_status > UNDEF_S)
if (playback_status > -1)
{
p_wrapper->SetVolume( p_mediaControl->GetVolume() );
p_mediaControl->SetMuted( p_wrapper->IsMuted() );
......@@ -499,7 +500,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break;
case SELECT_CHANNEL:
if ( playback_status > UNDEF_S )
if ( playback_status > -1 )
{
int32 channel;
if ( p_message->FindInt32( "channel", &channel ) == B_OK )
......@@ -510,7 +511,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break;
case SELECT_SUBTITLE:
if ( playback_status > UNDEF_S )
if ( playback_status > -1 )
{
int32 subtitle;
if ( p_message->FindInt32( "subtitle", &subtitle ) == B_OK )
......@@ -533,7 +534,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
p_wrapper->ToggleTitle( 0 );
break;
case TOGGLE_TITLE:
if ( playback_status > UNDEF_S )
if ( playback_status > -1 )
{
int32 index;
if( p_message->FindInt32( "index", &index ) == B_OK )
......@@ -551,7 +552,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break;
}
case TOGGLE_CHAPTER:
if ( playback_status > UNDEF_S )
if ( playback_status > -1 )
{
int32 index;
if( p_message->FindInt32( "index", &index ) == B_OK )
......@@ -726,7 +727,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
bool InterfaceWindow::QuitRequested()
{
p_wrapper->PlaylistStop();
p_mediaControl->SetStatus(UNDEF_S, DEFAULT_RATE);
p_mediaControl->SetStatus(-1, INPUT_RATE_DEFAULT);
_StoreSettings();
......@@ -879,31 +880,31 @@ InterfaceWindow::_UpdateSpeedMenu( int rate )
switch( rate )
{
case ( DEFAULT_RATE * 8 ):
case ( INPUT_RATE_DEFAULT * 8 ):
toMark = fHeighthMI;
break;
case ( DEFAULT_RATE * 4 ):
case ( INPUT_RATE_DEFAULT * 4 ):
toMark = fQuarterMI;
break;
case ( DEFAULT_RATE * 2 ):
case ( INPUT_RATE_DEFAULT * 2 ):
toMark = fHalfMI;
break;
case ( DEFAULT_RATE ):
case ( INPUT_RATE_DEFAULT ):
toMark = fNormalMI;
break;
case ( DEFAULT_RATE / 2 ):
case ( INPUT_RATE_DEFAULT / 2 ):
toMark = fTwiceMI;
break;
case ( DEFAULT_RATE / 4 ):
case ( INPUT_RATE_DEFAULT / 4 ):
toMark = fFourMI;
break;
case ( DEFAULT_RATE / 8 ):
case ( INPUT_RATE_DEFAULT / 8 ):
toMark = fHeightMI;
break;
}
......
......@@ -31,6 +31,7 @@
/* VLC headers */
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/input.h>
extern "C"
{
#include <audio_output.h>
......@@ -80,8 +81,8 @@ MediaControlView::MediaControlView(BRect frame, intf_thread_t *p_interface)
: BBox(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS | B_PULSE_NEEDED,
B_PLAIN_BORDER),
fScrubSem(B_ERROR),
fCurrentRate(DEFAULT_RATE),
fCurrentStatus(UNDEF_S),
fCurrentRate(INPUT_RATE_DEFAULT),
fCurrentStatus(-1),
fBottomControlHeight(0.0),
fIsEnabled( true )
{
......@@ -316,14 +317,11 @@ MediaControlView::SetStatus(int status, int rate)
switch( status )
{
case PLAYING_S:
case FORWARD_S:
case BACKWARD_S:
fPlayPause->SetPlaying();
break;
case PAUSE_S:
fPlayPause->SetPaused();
break;
case UNDEF_S:
default:
fPlayPause->SetStopped();
break;
......@@ -331,7 +329,7 @@ MediaControlView::SetStatus(int status, int rate)
if (rate != fCurrentRate)
{
fCurrentRate = rate;
if ( rate < DEFAULT_RATE )
if ( rate < INPUT_RATE_DEFAULT )
{
// TODO: ...
}
......
......@@ -31,9 +31,9 @@
#include <vlc/vlc.h>
#include <vlc/intf.h>
#include <vlc/vout.h>
#include <vlc/input.h>
extern "C"
{
#include <input_ext-plugins.h> // needed here when compiling without plugins
#include <audio_output.h>
#include <aout_internal.h>
}
......@@ -97,22 +97,20 @@ int VlcWrapper::InputStatus()
{
if( !p_input )
{
return UNDEF_S;
return -1;
}
vlc_value_t state;
var_Get( p_input, "state", &state );
return state.i_int;
return var_GetInteger( p_input, "state" );
}
int VlcWrapper::InputRate()
{
if( !p_input )
{
return DEFAULT_RATE;
return INPUT_RATE_DEFAULT;
}
return p_input->stream.control.i_rate;
return var_GetInteger( p_input, "rate" );
}
void VlcWrapper::InputSetRate( int rate )
......@@ -150,6 +148,8 @@ BList * VlcWrapper::GetChannels( int i_cat )
return NULL;
}
BList *list = new BList();
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
/* find which track is currently playing */
......@@ -161,7 +161,6 @@ BList * VlcWrapper::GetChannels( int i_cat )
}
/* build a list of all tracks */
BList *list = new BList( p_input->stream.i_es_number );
BMenuItem *menuItem;
BMessage *message;
char *trackName;
......@@ -193,6 +192,7 @@ BList * VlcWrapper::GetChannels( int i_cat )
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
return list;
}
......@@ -209,7 +209,7 @@ void VlcWrapper::ToggleLanguage( int i_language )
void VlcWrapper::ToggleSubtitle( int i_subtitle )
{
if( i_language < 0 )
if( i_subtitle < 0 )
var_SetInteger( p_input, "spu-es", -1 ); /* Disable SPU */
else
var_SetInteger( p_input, "spu-es", i_subtitle );
......@@ -262,24 +262,20 @@ void VlcWrapper::SetTimeAsFloat( float f_position )
bool VlcWrapper::IsPlaying()
{
bool playing = false;
if( p_input )
{
switch( p_input->stream.control.i_status )
{
case PLAYING_S:
case FORWARD_S:
case BACKWARD_S:
playing = true;
break;
case PAUSE_S:
case UNDEF_S:
default:
break;
}
}
return playing;
bool playing = false;
if( p_input )
{
switch( var_GetInteger( p_input, "state" ) )
{
case INIT_S:
case PLAYING_S:
playing = true;
break;
default:
break;
}
}
return playing;
}
/************
......@@ -288,45 +284,45 @@ bool VlcWrapper::IsPlaying()
void VlcWrapper::OpenFiles( BList* o_files, bool replace, int32 index )
{
if ( o_files && o_files->CountItems() > 0)
{
int size = PlaylistSize();
bool wasEmpty = ( size < 1 );
if ( index == -1 )
index = PLAYLIST_END;
int mode = index == PLAYLIST_END ? PLAYLIST_APPEND : PLAYLIST_INSERT;
/* delete current playlist */
if( replace )
{
for( int i = 0; i < size; i++ )
{
playlist_Delete( p_playlist, 0 );
}
}
/* insert files */
int32 count = o_files->CountItems();
for ( int32 i = count - 1; i >= 0; i-- )
{
if ( BString* o_file = (BString *)o_files->RemoveItem( i ) )
{
playlist_Add( p_playlist, o_file->String(),
o_file->String(), mode, index );
if ( mode == PLAYLIST_INSERT )
index++;
delete o_file;
}
}
// TODO: implement a user setting