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
// if to start automatically
/* eventually restart playing */
if( replace || wasEmpty )
{
playlist_Stop( p_playlist );
playlist_Play( p_playlist );
}
}
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
// if to start automatically
/* eventually restart playing */
if( replace || wasEmpty )
{
playlist_Stop( p_playlist );
playlist_Play( p_playlist );
}
}
}
void VlcWrapper::OpenDisc(BString o_type, BString o_device, int i_title, int i_chapter)
......@@ -391,20 +387,20 @@ void VlcWrapper::PlaylistPrev()
void VlcWrapper::GetPlaylistInfo( int32& currentIndex, int32& maxIndex )
{
currentIndex = -1;
maxIndex = -1;
if ( p_playlist )
{
vlc_mutex_lock( &p_playlist->object_lock );
currentIndex = -1;
maxIndex = -1;
if ( p_playlist )
{
vlc_mutex_lock( &p_playlist->object_lock );
maxIndex = p_playlist->i_size;
if ( maxIndex > 0 )
currentIndex = p_playlist->i_index/* + 1 -> why?!?*/;
else
maxIndex = -1;
maxIndex = p_playlist->i_size;
if ( maxIndex > 0 )
currentIndex = p_playlist->i_index/* + 1 -> why?!?*/;
else
maxIndex = -1;
vlc_mutex_unlock( &p_playlist->object_lock );
}
vlc_mutex_unlock( &p_playlist->object_lock );
}
}
void VlcWrapper::PlaylistJumpTo( int pos )
......@@ -414,145 +410,149 @@ void VlcWrapper::PlaylistJumpTo( int pos )
void VlcWrapper::GetNavCapabilities( bool *canSkipPrev, bool *canSkipNext )
{
if ( canSkipPrev && canSkipNext )
{
// init the parameters
*canSkipPrev = false;
*canSkipNext = false;
// get playlist info
int pos = PlaylistCurrent();
int size = PlaylistSize();
// see if we have got a stream going
if ( p_input )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
bool hasTitles = p_input->stream.i_area_nb > 1;
int numChapters = p_input->stream.p_selected_area->i_part_nb;
bool hasChapters = numChapters > 1;
// first, look for chapters
if ( hasChapters )
{
*canSkipPrev = p_input->stream.p_selected_area->i_part > 0;
*canSkipNext = p_input->stream.p_selected_area->i_part <
p_input->stream.p_selected_area->i_part_nb - 1;
}
// if one of the skip capabilities is false,
// make it depend on titles instead
if ( !*canSkipPrev && hasTitles )
*canSkipPrev = p_input->stream.p_selected_area->i_id > 1;
if ( !*canSkipNext && hasTitles )
*canSkipNext = p_input->stream.p_selected_area->i_id <
p_input->stream.i_area_nb - 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
// last but not least, make capabilities depend on playlist
if ( !*canSkipPrev )
*canSkipPrev = pos > 0;
if ( !*canSkipNext )
*canSkipNext = pos < size - 1;
}
if ( canSkipPrev && canSkipNext )
{
// init the parameters
*canSkipPrev = false;
*canSkipNext = false;
// get playlist info
int pos = PlaylistCurrent();
int size = PlaylistSize();
// see if we have got a stream going
if ( p_input )
{
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
bool hasTitles = p_input->stream.i_area_nb > 1;
int numChapters = p_input->stream.p_selected_area->i_part_nb;
bool hasChapters = numChapters > 1;
// first, look for chapters
if ( hasChapters )
{
*canSkipPrev = p_input->stream.p_selected_area->i_part > 0;
*canSkipNext = p_input->stream.p_selected_area->i_part <
p_input->stream.p_selected_area->i_part_nb - 1;
}
// if one of the skip capabilities is false,
// make it depend on titles instead
if ( !*canSkipPrev && hasTitles )
*canSkipPrev = p_input->stream.p_selected_area->i_id > 1;
if ( !*canSkipNext && hasTitles )
*canSkipNext = p_input->stream.p_selected_area->i_id <
p_input->stream.i_area_nb - 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
}
// last but not least, make capabilities depend on playlist
if ( !*canSkipPrev )
*canSkipPrev = pos > 0;
if ( !*canSkipNext )
*canSkipNext = pos < size - 1;
}
}
void VlcWrapper::NavigatePrev()
{
bool hasSkiped = false;
// see if we have got a stream going
if ( p_input )
{
// get information from stream (lock it while looking at it)
vlc_mutex_lock( &p_input->stream.stream_lock );
int currentTitle = p_input->stream.p_selected_area->i_id;
int currentChapter = p_input->stream.p_selected_area->i_part;
int numTitles = p_input->stream.i_area_nb;
bool hasTitles = numTitles > 1;
int numChapters = p_input->stream.p_selected_area->i_part_nb;
bool hasChapters = numChapters > 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
// first, look for chapters
if ( hasChapters )
{
// skip to the previous chapter
currentChapter--;
if ( currentChapter >= 0 )
{
ToggleChapter( currentChapter );
hasSkiped = true;
}
}
// if we couldn't skip chapters, try titles instead
if ( !hasSkiped && hasTitles )
{
// skip to the previous title
currentTitle--;
// disallow area 0 since it is used for video_ts.vob
if( currentTitle > 0 )
{
ToggleTitle(currentTitle);
hasSkiped = true;
}
}
}
// last but not least, skip to previous file
if ( !hasSkiped )
PlaylistPrev();
bool hasSkiped = false;
// see if we have got a stream going
if ( p_input )
{
#if 0
// get information from stream (lock it while looking at it)
vlc_mutex_lock( &p_input->stream.stream_lock );
int currentTitle = p_input->stream.p_selected_area->i_id;
int currentChapter = p_input->stream.p_selected_area->i_part;
int numTitles = p_input->stream.i_area_nb;
bool hasTitles = numTitles > 1;
int numChapters = p_input->stream.p_selected_area->i_part_nb;
bool hasChapters = numChapters > 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
// first, look for chapters
if ( hasChapters )
{
// skip to the previous chapter
currentChapter--;
if ( currentChapter >= 0 )
{
ToggleChapter( currentChapter );
hasSkiped = true;
}
}
// if we couldn't skip chapters, try titles instead
if ( !hasSkiped && hasTitles )
{
// skip to the previous title
currentTitle--;
// disallow area 0 since it is used for video_ts.vob
if( currentTitle > 0 )
{
ToggleTitle(currentTitle);
hasSkiped = true;
}
}
#endif
}
// last but not least, skip to previous file
if ( !hasSkiped )
PlaylistPrev();
}
void VlcWrapper::NavigateNext()
{
bool hasSkiped = false;
// see if we have got a stream going
if ( p_input )
{
// get information from stream (lock it while looking at it)
vlc_mutex_lock( &p_input->stream.stream_lock );
int currentTitle = p_input->stream.p_selected_area->i_id;
int currentChapter = p_input->stream.p_selected_area->i_part;
int numTitles = p_input->stream.i_area_nb;
bool hasTitles = numTitles > 1;
int numChapters = p_input->stream.p_selected_area->i_part_nb;
bool hasChapters = numChapters > 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
// first, look for chapters
if ( hasChapters )
{
// skip to the next chapter
currentChapter++;
if ( currentChapter < numChapters )
{
ToggleChapter( currentChapter );
hasSkiped = true;
}
}
// if we couldn't skip chapters, try titles instead
if ( !hasSkiped && hasTitles )
{
// skip to the next title
currentTitle++;
// disallow area 0 since it is used for video_ts.vob
if ( currentTitle < numTitles - 1 )
{
ToggleTitle(currentTitle);
hasSkiped = true;
}
}
}
// last but not least, skip to next file
if ( !hasSkiped )
PlaylistNext();
bool hasSkiped = false;
// see if we have got a stream going
if ( p_input )
{
#if 0
// get information from stream (lock it while looking at it)
vlc_mutex_lock( &p_input->stream.stream_lock );
int currentTitle = p_input->stream.p_selected_area->i_id;
int currentChapter = p_input->stream.p_selected_area->i_part;
int numTitles = p_input->stream.i_area_nb;
bool hasTitles = numTitles > 1;
int numChapters = p_input->stream.p_selected_area->i_part_nb;
bool hasChapters = numChapters > 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
// first, look for chapters
if ( hasChapters )
{
// skip to the next chapter
currentChapter++;
if ( currentChapter < numChapters )
{
ToggleChapter( currentChapter );
hasSkiped = true;
}
}
// if we couldn't skip chapters, try titles instead
if ( !hasSkiped && hasTitles )
{
// skip to the next title
currentTitle++;
// disallow area 0 since it is used for video_ts.vob
if ( currentTitle < numTitles - 1 )
{
ToggleTitle(currentTitle);
hasSkiped = true;
}
}
#endif
}
// last but not least, skip to next file
if ( !hasSkiped )
PlaylistNext();
}
/*************************
......@@ -565,12 +565,12 @@ VlcWrapper::PlaylistLock() const
{
// TODO: search and destroy -> deadlock!
return true;
if ( p_playlist )
{
vlc_mutex_lock( &p_playlist->object_lock );
return true;
}
return false;
if ( p_playlist )
{
vlc_mutex_lock( &p_playlist->object_lock );
return true;
}
return false;
}
// PlaylistUnlock
......@@ -579,86 +579,86 @@ VlcWrapper::PlaylistUnlock() const
{
// TODO: search and destroy -> deadlock!
return;
vlc_mutex_unlock( &p_playlist->object_lock );
vlc_mutex_unlock( &p_playlist->object_lock );
}
// PlaylistItemAt
void*
VlcWrapper::PlaylistItemAt( int index ) const
{
playlist_item_t* item = NULL;
if ( index >= 0 && index < p_playlist->i_size )
item = p_playlist->pp_items[index];
return (void*)item;
playlist_item_t* item = NULL;
if ( index >= 0 && index < p_playlist->i_size )
item = p_playlist->pp_items[index];
return (void*)item;
}
// PlaylistRemoveItem
void*
VlcWrapper::PlaylistRemoveItem( int index ) const
{
playlist_item_t* copy = NULL;
// check if item exists at the provided index
if ( index >= 0 && index < p_playlist->i_size )
{
playlist_item_t* item = p_playlist->pp_items[index];
if ( item )
{
// make a copy of the removed item
copy = (playlist_item_t*)PlaylistCloneItem( (void*)item );
// remove item from playlist (unfortunately, this frees it)
playlist_Delete( p_playlist, index );
}
}
return (void*)copy;
playlist_item_t* copy = NULL;
// check if item exists at the provided index
if ( index >= 0 && index < p_playlist->i_size )
{
playlist_item_t* item = p_playlist->pp_items[index];
if ( item )
{
// make a copy of the removed item
copy = (playlist_item_t*)PlaylistCloneItem( (void*)item );
// remove item from playlist (unfortunately, this frees it)
playlist_Delete( p_playlist, index );
}
}
return (void*)copy;
}
// PlaylistRemoveItem
void*
VlcWrapper::PlaylistRemoveItem( void* item ) const
{
playlist_item_t* copy = NULL;
for ( int32 i = 0; i < p_playlist->i_size; i++ )
{
if ( p_playlist->pp_items[i] == item )
{
copy = (playlist_item_t*)PlaylistRemoveItem( i );
break;
}
}
return (void*)copy;
playlist_item_t* copy = NULL;
for ( int32 i = 0; i < p_playlist->i_size; i++ )
{
if ( p_playlist->pp_items[i] == item )
{
copy = (playlist_item_t*)PlaylistRemoveItem( i );
break;
}
}
return (void*)copy;
}
// PlaylistAddItem
bool
VlcWrapper::PlaylistAddItem( void* item, int index ) const
{
if ( item )
{
playlist_AddItem( p_playlist, (playlist_item_t*)item,
PLAYLIST_INSERT, index );
}
// TODO: once playlist is returning useful info, return that instead
return true;
if ( item )
{
playlist_AddItem( p_playlist, (playlist_item_t*)item,
PLAYLIST_INSERT, index );
}
// TODO: once playlist is returning useful info, return that instead
return true;
}
// PlaylistCloneItem
void*
VlcWrapper::PlaylistCloneItem( void* castToItem ) const
{
playlist_item_t* copy = NULL;
playlist_item_t* item = (playlist_item_t*)castToItem;
if ( item )
{
copy = (playlist_item_t*)malloc( sizeof( playlist_item_t ) );
if ( copy )
{
// make a copy of the item at index
playlist_item_t* copy = NULL;
playlist_item_t* item = (playlist_item_t*)castToItem;
if ( item )
{
copy = (playlist_item_t*)malloc( sizeof( playlist_item_t ) );
if ( copy )
{
// make a copy of the item at index
*copy = *item;
copy->input.psz_name = strdup( item->input.psz_name );
copy->input.psz_uri = strdup( item->input.psz_uri );
}
}
return (void*)copy;
copy->input.psz_name = strdup( item->input.psz_name );
copy->input.psz_uri = strdup( item->input.psz_uri );
}
}
return (void*)copy;
}
// Careful! You need to know what you're doing here!
......@@ -671,11 +671,11 @@ VlcWrapper::PlaylistCloneItem( void* castToItem ) const
void
VlcWrapper::PlaylistSetPlaying( int index ) const
{
if ( index < 0 )
index = 0;
if ( index >= p_playlist->i_size )
index = p_playlist->i_size - 1;
p_playlist->i_index = index;
if ( index < 0 )
index = 0;
if ( index >= p_playlist->i_size )
index = p_playlist->i_size - 1;
p_playlist->i_index = index;
}
......@@ -749,16 +749,18 @@ bool VlcWrapper::HasTitles()
if( !p_input )
return false;
return ( p_input->stream.i_area_nb > 1 );
/* FIXME */
return false;
}
BList * VlcWrapper::GetTitles()
{
if( p_input )
{
BList *list = new BList();
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
BList *list = new BList( p_input->stream.i_area_nb );
BMenuItem *menuItem;
BMessage *message;
......@@ -774,7 +776,7 @@ BList * VlcWrapper::GetTitles()
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
return list;
}
return NULL;
......@@ -782,22 +784,12 @@ BList * VlcWrapper::GetTitles()
void VlcWrapper::PrevTitle()
{
int i_id;
i_id = p_input->stream.p_selected_area->i_id - 1;
if( i_id > 0 )
{
ToggleTitle(i_id);
}
var_SetVoid( p_input, "prev-title" );
}
void VlcWrapper::NextTitle()
{
unsigned int i_id;
i_id = p_input->stream.p_selected_area->i_id + 1;
if( i_id < p_input->stream.i_area_nb )
{
ToggleTitle(i_id);
}
var_SetVoid( p_input, "next-title" );
}
void VlcWrapper::ToggleTitle(int i_title)
......@@ -810,20 +802,22 @@ void VlcWrapper::ToggleTitle(int i_title)
void VlcWrapper::TitleInfo( int32 &currentIndex, int32 &maxIndex )
{
currentIndex = -1;
maxIndex = -1;
if ( p_input )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
currentIndex = -1;
maxIndex = -1;
if ( p_input )
{
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
maxIndex = p_input->stream.i_area_nb - 1;
if ( maxIndex > 0)
currentIndex = p_input->stream.p_selected_area->i_id;
else
maxIndex = -1;
maxIndex = p_input->stream.i_area_nb - 1;
if ( maxIndex > 0)
currentIndex = p_input->stream.p_selected_area->i_id;
else
maxIndex = -1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
}
}
bool VlcWrapper::HasChapters()
......@@ -832,16 +826,18 @@ bool VlcWrapper::HasChapters()
{
return false;
}
return ( p_input->stream.p_selected_area->i_part_nb > 1 );
/* FIXME */
return false;
}
BList * VlcWrapper::GetChapters()
{
if( p_input )
{
BList *list = new BList();
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
BList *list = new BList( p_input->stream.p_selected_area->i_part_nb );
BMenuItem *menuItem;
BMessage *message;
......@@ -858,7 +854,7 @@ BList * VlcWrapper::GetChapters()
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
return list;
}
return NULL;
......@@ -866,22 +862,12 @@ BList * VlcWrapper::GetChapters()
void VlcWrapper::PrevChapter()
{
int i_id;
i_id = p_input->stream.p_selected_area->i_part - 1;
if( i_id >= 0 )
{
ToggleChapter(i_id);
}
var_SetVoid( p_input, "prev-chapter" );
}
void VlcWrapper::NextChapter()
{
int i_id;
i_id = p_input->stream.p_selected_area->i_part + 1;
if( i_id >= 0 )
{
ToggleChapter(i_id);
}
var_SetVoid( p_input, "next-chapter" );
}
void VlcWrapper::ToggleChapter(int i_chapter)
......@@ -894,20 +880,22 @@ void VlcWrapper::ToggleChapter(int i_chapter)
void VlcWrapper::ChapterInfo( int32 &currentIndex, int32 &maxIndex )
{
currentIndex = -1;
maxIndex = -1;
if ( p_input )
{
vlc_mutex_lock( &p_input->stream.stream_lock );
currentIndex = -1;
maxIndex = -1;
if ( p_input )
{
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
maxIndex = p_input->stream.p_selected_area->i_part_nb - 1;
if ( maxIndex > 0)
currentIndex = p_input->stream.p_selected_area->i_part;
else
maxIndex = -1;
maxIndex = p_input->stream.p_selected_area->i_part_nb - 1;
if ( maxIndex > 0)
currentIndex = p_input->stream.p_selected_area->i_part;
else
maxIndex = -1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
}
}
/****************
......@@ -924,6 +912,7 @@ void VlcWrapper::FilterChange()
if( !p_input )
return;
#if 0
vout_thread_t * p_vout;
vlc_mutex_lock( &p_input->stream.stream_lock );
......@@ -947,4 +936,5 @@ void VlcWrapper::FilterChange()
}
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
}
......@@ -63,13 +63,13 @@ static void MergeGeneric ( void *, const void *, const void *, size_t );
#if defined(CAN_COMPILE_C_ALTIVEC)
static void MergeAltivec ( void *, const void *, const void *, size_t );
#endif
#if defined(CAN_COMPILE_MMX)
#if defined(CAN_COMPILE_MMXEXT)
static void MergeMMX ( void *, const void *, const void *, size_t );
#endif
#if defined(CAN_COMPILE_SSE) && !defined(SYS_BEOS)
static void MergeSSE2 ( void *, const void *, const void *, size_t );
#endif
#if defined(CAN_COMPILE_MMX) || defined(CAN_COMPILE_SSE)
#if defined(CAN_COMPILE_MMXEXT) || defined(CAN_COMPILE_SSE)
static void EndMMX ( void );
#endif
......@@ -184,7 +184,7 @@ static int Create( vlc_object_t *p_this )
}
else
#endif
#if defined(CAN_COMPILE_MMX)
#if defined(CAN_COMPILE_MMXEXT)
if( p_vout->p_libvlc->i_cpu & CPU_CAPABILITY_MMX )
{
p_vout->p_sys->pf_merge = MergeMMX;
......@@ -871,7 +871,7 @@ static void MergeGeneric( void *_p_dest, const void *_p_s1,
}
}
#if defined(CAN_COMPILE_MMX)
#if defined(CAN_COMPILE_MMXEXT)
static void MergeMMX( void *_p_dest, const void *_p_s1, const void *_p_s2,
size_t i_bytes )
{
......@@ -934,7 +934,7 @@ static void MergeSSE2( void *_p_dest, const void *_p_s1, const void *_p_s2,
}
#endif
#if defined(CAN_COMPILE_MMX) || defined(CAN_COMPILE_SSE)
#if defined(CAN_COMPILE_MMXEXT) || defined(CAN_COMPILE_SSE)
static void EndMMX( void )
{
__asm__ __volatile__( "emms" :: );
......
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