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 ...@@ -405,14 +405,28 @@ vlc$(EXEEXT): $(vlc_OBJECTS) $(DEPENDENCIES_vlc) stamp-builtin
esac esac
if HAVE_BEOS if HAVE_BEOS
xres -o $@ $(srcdir)/share/vlc_beos.rsrc vlc-bundle: vlc
mimeset -f $@ rm -rf $(srcdir)/vlc-bundle ; mkdir -p $(srcdir)/vlc-bundle
rm -Rf $(srcdir)/locale ; mkdir -p "$(srcdir)/locale" 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 \ for i in $(ALL_LINGUAS); do \
mkdir -p "$(srcdir)/locale/$${i}/LC_MESSAGES" ; \ mkdir -p "$(srcdir)/vlc-bundle/locale/$$i/LC_MESSAGES" ; \
cp "$(srcdir)/po/$${i}.gmo" \ cp "$(srcdir)/po/$$i.gmo" \
"$(srcdir)/locale/$${i}/LC_MESSAGES/vlc.mo" || true ; \ "$(srcdir)/vlc-bundle/locale/$$i/LC_MESSAGES/vlc.mo" || true ; \
done done
find $(srcdir)/vlc-bundle -type f $(srcdir)/vlc-bundle -exec mimeset -f "{}" \;
endif endif
# Install the modules and the symlinks # Install the modules and the symlinks
......
...@@ -2468,7 +2468,7 @@ dnl (enabled by default except on win32) ...@@ -2468,7 +2468,7 @@ dnl (enabled by default except on win32)
dnl dnl
AC_ARG_ENABLE(opengl, AC_ARG_ENABLE(opengl,
[ --enable-opengl OpenGL support (default enabled)]) [ --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, [ AC_CHECK_HEADERS(GL/gl.h, [
VLC_ADD_PLUGINS([opengl]) VLC_ADD_PLUGINS([opengl])
VLC_ADD_LDFLAGS([opengl],[-L${x_libraries} -lGL -lGLU]) VLC_ADD_LDFLAGS([opengl],[-L${x_libraries} -lGL -lGLU])
......
...@@ -58,10 +58,7 @@ all: .autoconf .libtool .automake .iconv .intl .pkgcfg .freetype .fribidi \ ...@@ -58,10 +58,7 @@ all: .autoconf .libtool .automake .iconv .intl .pkgcfg .freetype .fribidi \
endif endif
ifeq ($(SYS),BEOS) ifeq ($(SYS),BEOS)
all: .perl .autoconf .libtool .automake .iconv .intl .freetype .fribidi \ all: .perl .autoconf .libtool .automake .iconv .intl .freetype .fribidi \
.a52 .mpeg2 .id3tag .mad .ogg .vorbis .vorbisenc .theora \ .a52 .mpeg2 .id3tag .mad
.FLAC .speex .faad .faac .lame .ffmpeg .openslp \
.dvdcss .dvdread .dvdnav .dvbpsi .live .goom .caca .dts .mod \
.cddb .cdio .vcdimager
endif endif
FORCE: FORCE:
...@@ -354,6 +351,7 @@ mpeg2dec-$(MPEG2DEC_VERSION).tar.gz: ...@@ -354,6 +351,7 @@ mpeg2dec-$(MPEG2DEC_VERSION).tar.gz:
mpeg2dec: mpeg2dec-$(MPEG2DEC_VERSION).tar.gz mpeg2dec: mpeg2dec-$(MPEG2DEC_VERSION).tar.gz
$(EXTRACT_GZ) $(EXTRACT_GZ)
patch -p 0 < Patches/mpeg2dec.patch
.mpeg2: mpeg2dec .mpeg2: mpeg2dec
(cd $<; ./configure --prefix=$(PREFIX) --without-x --disable-dsl && make && make install) (cd $<; ./configure --prefix=$(PREFIX) --without-x --disable-dsl && make && make install)
...@@ -376,7 +374,9 @@ libid3tag: libid3tag-$(LIBID3TAG_VERSION).tar.gz ...@@ -376,7 +374,9 @@ libid3tag: libid3tag-$(LIBID3TAG_VERSION).tar.gz
.id3tag: libid3tag .id3tag: libid3tag
(cd $<; ./configure --prefix=$(PREFIX) && make && make install) (cd $<; ./configure --prefix=$(PREFIX) && make && make install)
ifeq ($(SYS),DARWIN)
$(INSTALL_NAME) $(INSTALL_NAME)
endif
touch $@ touch $@
CLEAN_FILE += .id3tag CLEAN_FILE += .id3tag
...@@ -395,7 +395,9 @@ libmad: libmad-$(LIBMAD_VERSION).tar.gz ...@@ -395,7 +395,9 @@ libmad: libmad-$(LIBMAD_VERSION).tar.gz
.mad: libmad .mad: libmad
(cd $<; ./configure --prefix=$(PREFIX) CFLAGS="-O3" && make && make install) (cd $<; ./configure --prefix=$(PREFIX) CFLAGS="-O3" && make && make install)
ifeq ($(SYS),DARWIN)
$(INSTALL_NAME) $(INSTALL_NAME)
endif
touch $@ touch $@
CLEAN_FILE += .mad 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 @@ ...@@ -41,6 +41,7 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/aout.h> #include <vlc/aout.h>
#include <vlc/intf.h> #include <vlc/intf.h>
#include <vlc/input.h>
/* BeOS interface headers */ /* BeOS interface headers */
#include "VlcWrapper.h" #include "VlcWrapper.h"
...@@ -417,10 +418,10 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -417,10 +418,10 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
case STOP_PLAYBACK: case STOP_PLAYBACK:
// this currently stops playback not nicely // this currently stops playback not nicely
if (playback_status > UNDEF_S) if (playback_status != -1)
{ {
p_wrapper->PlaylistStop(); p_wrapper->PlaylistStop();
p_mediaControl->SetStatus(UNDEF_S, DEFAULT_RATE); p_mediaControl->SetStatus(-1, INPUT_RATE_DEFAULT);
} }
break; break;
...@@ -429,7 +430,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -429,7 +430,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
case PAUSE_PLAYBACK: case PAUSE_PLAYBACK:
/* toggle between pause and play */ /* toggle between pause and play */
if (playback_status > UNDEF_S) if (playback_status > -1)
{ {
/* pause if currently playing */ /* pause if currently playing */
if ( playback_status == PLAYING_S ) if ( playback_status == PLAYING_S )
...@@ -449,31 +450,31 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -449,31 +450,31 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break; break;
case HEIGHTH_PLAY: case HEIGHTH_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE * 8 ); p_wrapper->InputSetRate( INPUT_RATE_DEFAULT * 8 );
break; break;
case QUARTER_PLAY: case QUARTER_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE * 4 ); p_wrapper->InputSetRate( INPUT_RATE_DEFAULT * 4 );
break; break;
case HALF_PLAY: case HALF_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE * 2 ); p_wrapper->InputSetRate( INPUT_RATE_DEFAULT * 2 );
break; break;
case NORMAL_PLAY: case NORMAL_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE ); p_wrapper->InputSetRate( INPUT_RATE_DEFAULT );
break; break;
case TWICE_PLAY: case TWICE_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE / 2 ); p_wrapper->InputSetRate( INPUT_RATE_DEFAULT / 2 );
break; break;
case FOUR_PLAY: case FOUR_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE / 4 ); p_wrapper->InputSetRate( INPUT_RATE_DEFAULT / 4 );
break; break;
case HEIGHT_PLAY: case HEIGHT_PLAY:
p_wrapper->InputSetRate( DEFAULT_RATE / 8 ); p_wrapper->InputSetRate( INPUT_RATE_DEFAULT / 8 );
break; break;
case SEEK_PLAYBACK: case SEEK_PLAYBACK:
...@@ -482,7 +483,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -482,7 +483,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
// volume related messages // volume related messages
case VOLUME_CHG: case VOLUME_CHG:
/* adjust the volume */ /* adjust the volume */
if (playback_status > UNDEF_S) if (playback_status > -1)
{ {
p_wrapper->SetVolume( p_mediaControl->GetVolume() ); p_wrapper->SetVolume( p_mediaControl->GetVolume() );
p_mediaControl->SetMuted( p_wrapper->IsMuted() ); p_mediaControl->SetMuted( p_wrapper->IsMuted() );
...@@ -499,7 +500,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -499,7 +500,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break; break;
case SELECT_CHANNEL: case SELECT_CHANNEL:
if ( playback_status > UNDEF_S ) if ( playback_status > -1 )
{ {
int32 channel; int32 channel;
if ( p_message->FindInt32( "channel", &channel ) == B_OK ) if ( p_message->FindInt32( "channel", &channel ) == B_OK )
...@@ -510,7 +511,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -510,7 +511,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break; break;
case SELECT_SUBTITLE: case SELECT_SUBTITLE:
if ( playback_status > UNDEF_S ) if ( playback_status > -1 )
{ {
int32 subtitle; int32 subtitle;
if ( p_message->FindInt32( "subtitle", &subtitle ) == B_OK ) if ( p_message->FindInt32( "subtitle", &subtitle ) == B_OK )
...@@ -533,7 +534,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -533,7 +534,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
p_wrapper->ToggleTitle( 0 ); p_wrapper->ToggleTitle( 0 );
break; break;
case TOGGLE_TITLE: case TOGGLE_TITLE:
if ( playback_status > UNDEF_S ) if ( playback_status > -1 )
{ {
int32 index; int32 index;
if( p_message->FindInt32( "index", &index ) == B_OK ) if( p_message->FindInt32( "index", &index ) == B_OK )
...@@ -551,7 +552,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -551,7 +552,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
break; break;
} }
case TOGGLE_CHAPTER: case TOGGLE_CHAPTER:
if ( playback_status > UNDEF_S ) if ( playback_status > -1 )
{ {
int32 index; int32 index;
if( p_message->FindInt32( "index", &index ) == B_OK ) if( p_message->FindInt32( "index", &index ) == B_OK )
...@@ -726,7 +727,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) ...@@ -726,7 +727,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message )
bool InterfaceWindow::QuitRequested() bool InterfaceWindow::QuitRequested()
{ {
p_wrapper->PlaylistStop(); p_wrapper->PlaylistStop();
p_mediaControl->SetStatus(UNDEF_S, DEFAULT_RATE); p_mediaControl->SetStatus(-1, INPUT_RATE_DEFAULT);
_StoreSettings(); _StoreSettings();
...@@ -879,31 +880,31 @@ InterfaceWindow::_UpdateSpeedMenu( int rate ) ...@@ -879,31 +880,31 @@ InterfaceWindow::_UpdateSpeedMenu( int rate )
switch( rate ) switch( rate )
{ {
case ( DEFAULT_RATE * 8 ): case ( INPUT_RATE_DEFAULT * 8 ):
toMark = fHeighthMI; toMark = fHeighthMI;
break; break;
case ( DEFAULT_RATE * 4 ): case ( INPUT_RATE_DEFAULT * 4 ):
toMark = fQuarterMI; toMark = fQuarterMI;
break; break;
case ( DEFAULT_RATE * 2 ): case ( INPUT_RATE_DEFAULT * 2 ):
toMark = fHalfMI; toMark = fHalfMI;
break; break;
case ( DEFAULT_RATE ): case ( INPUT_RATE_DEFAULT ):
toMark = fNormalMI; toMark = fNormalMI;
break; break;
case ( DEFAULT_RATE / 2 ): case ( INPUT_RATE_DEFAULT / 2 ):
toMark = fTwiceMI; toMark = fTwiceMI;
break; break;
case ( DEFAULT_RATE / 4 ): case ( INPUT_RATE_DEFAULT / 4 ):
toMark = fFourMI; toMark = fFourMI;
break; break;
case ( DEFAULT_RATE / 8 ): case ( INPUT_RATE_DEFAULT / 8 ):
toMark = fHeightMI; toMark = fHeightMI;
break; break;
} }
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
/* VLC headers */ /* VLC headers */
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/intf.h> #include <vlc/intf.h>
#include <vlc/input.h>
extern "C" extern "C"
{ {
#include <audio_output.h> #include <audio_output.h>
...@@ -80,8 +81,8 @@ MediaControlView::MediaControlView(BRect frame, intf_thread_t *p_interface) ...@@ -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, : BBox(frame, NULL, B_FOLLOW_NONE, B_WILL_DRAW | B_FRAME_EVENTS | B_PULSE_NEEDED,
B_PLAIN_BORDER), B_PLAIN_BORDER),
fScrubSem(B_ERROR), fScrubSem(B_ERROR),
fCurrentRate(DEFAULT_RATE), fCurrentRate(INPUT_RATE_DEFAULT),
fCurrentStatus(UNDEF_S), fCurrentStatus(-1),
fBottomControlHeight(0.0), fBottomControlHeight(0.0),
fIsEnabled( true ) fIsEnabled( true )
{ {
...@@ -316,14 +317,11 @@ MediaControlView::SetStatus(int status, int rate) ...@@ -316,14 +317,11 @@ MediaControlView::SetStatus(int status, int rate)
switch( status ) switch( status )
{ {
case PLAYING_S: case PLAYING_S:
case FORWARD_S:
case BACKWARD_S:
fPlayPause->SetPlaying(); fPlayPause->SetPlaying();
break; break;
case PAUSE_S: case PAUSE_S:
fPlayPause->SetPaused(); fPlayPause->SetPaused();
break; break;
case UNDEF_S:
default: default:
fPlayPause->SetStopped(); fPlayPause->SetStopped();
break; break;
...@@ -331,7 +329,7 @@ MediaControlView::SetStatus(int status, int rate) ...@@ -331,7 +329,7 @@ MediaControlView::SetStatus(int status, int rate)
if (rate != fCurrentRate) if (rate != fCurrentRate)
{ {
fCurrentRate = rate; fCurrentRate = rate;
if ( rate < DEFAULT_RATE ) if ( rate < INPUT_RATE_DEFAULT )
{ {
// TODO: ... // TODO: ...
} }
......
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/intf.h> #include <vlc/intf.h>
#include <vlc/vout.h> #include <vlc/vout.h>
#include <vlc/input.h>
extern "C" extern "C"
{ {
#include <input_ext-plugins.h> // needed here when compiling without plugins
#include <audio_output.h> #include <audio_output.h>
#include <aout_internal.h> #include <aout_internal.h>
} }
...@@ -97,22 +97,20 @@ int VlcWrapper::InputStatus() ...@@ -97,22 +97,20 @@ int VlcWrapper::InputStatus()
{ {
if( !p_input ) if( !p_input )
{ {
return UNDEF_S; return -1;
} }
vlc_value_t state; return var_GetInteger( p_input, "state" );
var_Get( p_input, "state", &state );
return state.i_int;
} }
int VlcWrapper::InputRate() int VlcWrapper::InputRate()
{ {
if( !p_input ) 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 ) void VlcWrapper::InputSetRate( int rate )
...@@ -150,6 +148,8 @@ BList * VlcWrapper::GetChannels( int i_cat ) ...@@ -150,6 +148,8 @@ BList * VlcWrapper::GetChannels( int i_cat )
return NULL; return NULL;
} }
BList *list = new BList();
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
/* find which track is currently playing */ /* find which track is currently playing */
...@@ -161,7 +161,6 @@ BList * VlcWrapper::GetChannels( int i_cat ) ...@@ -161,7 +161,6 @@ BList * VlcWrapper::GetChannels( int i_cat )
} }
/* build a list of all tracks */ /* build a list of all tracks */
BList *list = new BList( p_input->stream.i_es_number );
BMenuItem *menuItem; BMenuItem *menuItem;
BMessage *message; BMessage *message;
char *trackName; char *trackName;
...@@ -193,6 +192,7 @@ BList * VlcWrapper::GetChannels( int i_cat ) ...@@ -193,6 +192,7 @@ BList * VlcWrapper::GetChannels( int i_cat )
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
return list; return list;
} }
...@@ -209,7 +209,7 @@ void VlcWrapper::ToggleLanguage( int i_language ) ...@@ -209,7 +209,7 @@ void VlcWrapper::ToggleLanguage( int i_language )
void VlcWrapper::ToggleSubtitle( int i_subtitle ) void VlcWrapper::ToggleSubtitle( int i_subtitle )
{ {
if( i_language < 0 ) if( i_subtitle < 0 )
var_SetInteger( p_input, "spu-es", -1 ); /* Disable SPU */ var_SetInteger( p_input, "spu-es", -1 ); /* Disable SPU */
else else
var_SetInteger( p_input, "spu-es", i_subtitle ); var_SetInteger( p_input, "spu-es", i_subtitle );
...@@ -262,24 +262,20 @@ void VlcWrapper::SetTimeAsFloat( float f_position ) ...@@ -262,24 +262,20 @@ void VlcWrapper::SetTimeAsFloat( float f_position )
bool VlcWrapper::IsPlaying() bool VlcWrapper::IsPlaying()
{ {
bool playing = false; bool playing = false;
if( p_input ) if( p_input )
{ {
switch( p_input->stream.control.i_status ) switch( var_GetInteger( p_input, "state" ) )
{ {
case PLAYING_S: case INIT_S:
case FORWARD_S: case PLAYING_S:
case BACKWARD_S: playing = true;
playing = true; break;
break; default:
case PAUSE_S: break;
case UNDEF_S: }
default: }
break; return playing;
}
}
return playing;
} }
/************ /************
...@@ -288,45 +284,45 @@ bool VlcWrapper::IsPlaying() ...@@ -288,45 +284,45 @@ bool VlcWrapper::IsPlaying()
void VlcWrapper::OpenFiles( BList* o_files, bool replace, int32 index ) void VlcWrapper::OpenFiles( BList* o_files, bool replace, int32 index )
{ {
if ( o_files && o_files->CountItems() > 0) if ( o_files && o_files->CountItems() > 0)
{ {
int size = PlaylistSize(); int size = PlaylistSize();
bool wasEmpty = ( size < 1 ); bool wasEmpty = ( size < 1 );
if ( index == -1 ) if ( index == -1 )
index = PLAYLIST_END; index = PLAYLIST_END;
int mode = index == PLAYLIST_END ? PLAYLIST_APPEND : PLAYLIST_INSERT; int mode = index == PLAYLIST_END ? PLAYLIST_APPEND : PLAYLIST_INSERT;
/* delete current playlist */ /* delete current playlist */
if( replace ) if( replace )
{ {
for( int i = 0; i < size; i++ ) for( int i = 0; i < size; i++ )
{ {
playlist_Delete( p_playlist, 0 ); playlist_Delete( p_playlist, 0 );
} }
} }
/* insert files */ /* insert files */
int32 count = o_files->CountItems(); int32 count = o_files->CountItems();
for ( int32 i = count - 1; i >= 0; i-- ) for ( int32 i = count - 1; i >= 0; i-- )
{ {
if ( BString* o_file = (BString *)o_files->RemoveItem( i ) ) if ( BString* o_file = (BString *)o_files->RemoveItem( i ) )
{ {
playlist_Add( p_playlist, o_file->String(), playlist_Add( p_playlist, o_file->String(),
o_file->String(), mode, index ); o_file->String(), mode, index );
if ( mode == PLAYLIST_INSERT ) if ( mode == PLAYLIST_INSERT )
index++; index++;
delete o_file; delete o_file;
} }
} }
// TODO: implement a user setting // TODO: implement a user setting
// if to start automatically // if to start automatically
/* eventually restart playing */ /* eventually restart playing */
if( replace || wasEmpty ) if( replace || wasEmpty )
{ {
playlist_Stop( p_playlist ); playlist_Stop( p_playlist );
playlist_Play( p_playlist ); playlist_Play( p_playlist );
} }
} }
} }
void VlcWrapper::OpenDisc(BString o_type, BString o_device, int i_title, int i_chapter) void VlcWrapper::OpenDisc(BString o_type, BString o_device, int i_title, int i_chapter)
...@@ -391,20 +387,20 @@ void VlcWrapper::PlaylistPrev() ...@@ -391,20 +387,20 @@ void VlcWrapper::PlaylistPrev()
void VlcWrapper::GetPlaylistInfo( int32& currentIndex, int32& maxIndex ) void VlcWrapper::GetPlaylistInfo( int32& currentIndex, int32& maxIndex )
{ {
currentIndex = -1; currentIndex = -1;
maxIndex = -1; maxIndex = -1;
if ( p_playlist ) if ( p_playlist )
{ {
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
maxIndex = p_playlist->i_size; maxIndex = p_playlist->i_size;
if ( maxIndex > 0 ) if ( maxIndex > 0 )
currentIndex = p_playlist->i_index/* + 1 -> why?!?*/; currentIndex = p_playlist->i_index/* + 1 -> why?!?*/;
else else
maxIndex = -1; maxIndex = -1;
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
} }
} }
void VlcWrapper::PlaylistJumpTo( int pos ) void VlcWrapper::PlaylistJumpTo( int pos )
...@@ -414,145 +410,149 @@ void VlcWrapper::PlaylistJumpTo( int pos ) ...@@ -414,145 +410,149 @@ void VlcWrapper::PlaylistJumpTo( int pos )
void VlcWrapper::GetNavCapabilities( bool *canSkipPrev, bool *canSkipNext ) void VlcWrapper::GetNavCapabilities( bool *canSkipPrev, bool *canSkipNext )
{ {
if ( canSkipPrev && canSkipNext ) if ( canSkipPrev && canSkipNext )
{ {
// init the parameters // init the parameters
*canSkipPrev = false; *canSkipPrev = false;
*canSkipNext = false; *canSkipNext = false;
// get playlist info // get playlist info
int pos = PlaylistCurrent(); int pos = PlaylistCurrent();
int size = PlaylistSize(); int size = PlaylistSize();
// see if we have got a stream going // see if we have got a stream going
if ( p_input ) if ( p_input )
{ {
vlc_mutex_lock( &p_input->stream.stream_lock ); #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 hasTitles = p_input->stream.i_area_nb > 1;
bool hasChapters = numChapters > 1; int numChapters = p_input->stream.p_selected_area->i_part_nb;
// first, look for chapters bool hasChapters = numChapters > 1;
if ( hasChapters ) // 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 < *canSkipPrev = p_input->stream.p_selected_area->i_part > 0;
p_input->stream.p_selected_area->i_part_nb - 1; *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 one of the skip capabilities is false,
if ( !*canSkipPrev && hasTitles ) // make it depend on titles instead
*canSkipPrev = p_input->stream.p_selected_area->i_id > 1; if ( !*canSkipPrev && hasTitles )
if ( !*canSkipNext && hasTitles ) *canSkipPrev = p_input->stream.p_selected_area->i_id > 1;
*canSkipNext = p_input->stream.p_selected_area->i_id < if ( !*canSkipNext && hasTitles )
p_input->stream.i_area_nb - 1; *canSkipNext = p_input->stream.p_selected_area->i_id <
p_input->stream.i_area_nb - 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
} vlc_mutex_unlock( &p_input->stream.stream_lock );
// last but not least, make capabilities depend on playlist #endif
if ( !*canSkipPrev ) }
*canSkipPrev = pos > 0; // last but not least, make capabilities depend on playlist
if ( !*canSkipNext ) if ( !*canSkipPrev )
*canSkipNext = pos < size - 1; *canSkipPrev = pos > 0;
} if ( !*canSkipNext )
*canSkipNext = pos < size - 1;
}
} }
void VlcWrapper::NavigatePrev() void VlcWrapper::NavigatePrev()
{ {
bool hasSkiped = false; bool hasSkiped = false;
// see if we have got a stream going // see if we have got a stream going
if ( p_input ) if ( p_input )
{ {
// get information from stream (lock it while looking at it) #if 0
vlc_mutex_lock( &p_input->stream.stream_lock ); // 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 currentTitle = p_input->stream.p_selected_area->i_id;
int numTitles = p_input->stream.i_area_nb; int currentChapter = p_input->stream.p_selected_area->i_part;
bool hasTitles = numTitles > 1; int numTitles = p_input->stream.i_area_nb;
int numChapters = p_input->stream.p_selected_area->i_part_nb; bool hasTitles = numTitles > 1;
bool hasChapters = numChapters > 1; int numChapters = p_input->stream.p_selected_area->i_part_nb;
bool hasChapters = numChapters > 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
vlc_mutex_unlock( &p_input->stream.stream_lock );
// first, look for chapters
if ( hasChapters ) // first, look for chapters
{ if ( hasChapters )
// skip to the previous chapter {
currentChapter--; // skip to the previous chapter
currentChapter--;
if ( currentChapter >= 0 )
{ if ( currentChapter >= 0 )
ToggleChapter( currentChapter ); {
hasSkiped = true; ToggleChapter( currentChapter );
} hasSkiped = true;
} }
// if we couldn't skip chapters, try titles instead }
if ( !hasSkiped && hasTitles ) // if we couldn't skip chapters, try titles instead
{ if ( !hasSkiped && hasTitles )
// skip to the previous title {
currentTitle--; // skip to the previous title
// disallow area 0 since it is used for video_ts.vob currentTitle--;
if( currentTitle > 0 ) // disallow area 0 since it is used for video_ts.vob
{ if( currentTitle > 0 )
ToggleTitle(currentTitle); {
hasSkiped = true; ToggleTitle(currentTitle);
} hasSkiped = true;
} }
}
} #endif
// last but not least, skip to previous file }
if ( !hasSkiped ) // last but not least, skip to previous file
PlaylistPrev(); if ( !hasSkiped )
PlaylistPrev();
} }
void VlcWrapper::NavigateNext() void VlcWrapper::NavigateNext()
{ {
bool hasSkiped = false; bool hasSkiped = false;
// see if we have got a stream going // see if we have got a stream going
if ( p_input ) if ( p_input )
{ {
// get information from stream (lock it while looking at it) #if 0
vlc_mutex_lock( &p_input->stream.stream_lock ); // 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 currentTitle = p_input->stream.p_selected_area->i_id;
int numTitles = p_input->stream.i_area_nb; int currentChapter = p_input->stream.p_selected_area->i_part;
bool hasTitles = numTitles > 1; int numTitles = p_input->stream.i_area_nb;
int numChapters = p_input->stream.p_selected_area->i_part_nb; bool hasTitles = numTitles > 1;
bool hasChapters = numChapters > 1; int numChapters = p_input->stream.p_selected_area->i_part_nb;
bool hasChapters = numChapters > 1;
vlc_mutex_unlock( &p_input->stream.stream_lock );
vlc_mutex_unlock( &p_input->stream.stream_lock );
// first, look for chapters
if ( hasChapters ) // first, look for chapters
{ if ( hasChapters )
// skip to the next chapter {
currentChapter++; // skip to the next chapter
if ( currentChapter < numChapters ) currentChapter++;
{ if ( currentChapter < numChapters )
ToggleChapter( currentChapter ); {
hasSkiped = true; ToggleChapter( currentChapter );
} hasSkiped = true;
} }
// if we couldn't skip chapters, try titles instead }
if ( !hasSkiped && hasTitles ) // if we couldn't skip chapters, try titles instead
{ if ( !hasSkiped && hasTitles )
// skip to the next title {
currentTitle++; // skip to the next title
// disallow area 0 since it is used for video_ts.vob currentTitle++;
if ( currentTitle < numTitles - 1 ) // disallow area 0 since it is used for video_ts.vob
{ if ( currentTitle < numTitles - 1 )
ToggleTitle(currentTitle); {
hasSkiped = true; ToggleTitle(currentTitle);
} hasSkiped = true;
} }
}
} #endif
// last but not least, skip to next file }
if ( !hasSkiped ) // last but not least, skip to next file
PlaylistNext(); if ( !hasSkiped )
PlaylistNext();
} }
/************************* /*************************
...@@ -565,12 +565,12 @@ VlcWrapper::PlaylistLock() const ...@@ -565,12 +565,12 @@ VlcWrapper::PlaylistLock() const
{ {
// TODO: search and destroy -> deadlock! // TODO: search and destroy -> deadlock!
return true; return true;
if ( p_playlist ) if ( p_playlist )
{ {
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
return true; return true;
} }
return false; return false;
} }
// PlaylistUnlock // PlaylistUnlock
...@@ -579,86 +579,86 @@ VlcWrapper::PlaylistUnlock() const ...@@ -579,86 +579,86 @@ VlcWrapper::PlaylistUnlock() const
{ {
// TODO: search and destroy -> deadlock! // TODO: search and destroy -> deadlock!
return; return;
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
} }
// PlaylistItemAt // PlaylistItemAt
void* void*
VlcWrapper::PlaylistItemAt( int index ) const VlcWrapper::PlaylistItemAt( int index ) const
{ {
playlist_item_t* item = NULL; playlist_item_t* item = NULL;
if ( index >= 0 && index < p_playlist->i_size ) if ( index >= 0 && index < p_playlist->i_size )
item = p_playlist->pp_items[index]; item = p_playlist->pp_items[index];
return (void*)item; return (void*)item;
} }
// PlaylistRemoveItem // PlaylistRemoveItem
void* void*
VlcWrapper::PlaylistRemoveItem( int index ) const VlcWrapper::PlaylistRemoveItem( int index ) const
{ {
playlist_item_t* copy = NULL; playlist_item_t* copy = NULL;
// check if item exists at the provided index // check if item exists at the provided index
if ( index >= 0 && index < p_playlist->i_size ) if ( index >= 0 && index < p_playlist->i_size )
{ {
playlist_item_t* item = p_playlist->pp_items[index]; playlist_item_t* item = p_playlist->pp_items[index];
if ( item ) if ( item )
{ {
// make a copy of the removed item // make a copy of the removed item
copy = (playlist_item_t*)PlaylistCloneItem( (void*)item ); copy = (playlist_item_t*)PlaylistCloneItem( (void*)item );
// remove item from playlist (unfortunately, this frees it) // remove item from playlist (unfortunately, this frees it)
playlist_Delete( p_playlist, index ); playlist_Delete( p_playlist, index );
} }
} }
return (void*)copy; return (void*)copy;
} }
// PlaylistRemoveItem // PlaylistRemoveItem
void* void*
VlcWrapper::PlaylistRemoveItem( void* item ) const VlcWrapper::PlaylistRemoveItem( void* item ) const
{ {
playlist_item_t* copy = NULL; playlist_item_t* copy = NULL;
for ( int32 i = 0; i < p_playlist->i_size; i++ ) for ( int32 i = 0; i < p_playlist->i_size; i++ )
{ {
if ( p_playlist->pp_items[i] == item ) if ( p_playlist->pp_items[i] == item )
{ {
copy = (playlist_item_t*)PlaylistRemoveItem( i ); copy = (playlist_item_t*)PlaylistRemoveItem( i );
break; break;
} }
} }
return (void*)copy; return (void*)copy;
} }
// PlaylistAddItem // PlaylistAddItem
bool bool
VlcWrapper::PlaylistAddItem( void* item, int index ) const VlcWrapper::PlaylistAddItem( void* item, int index ) const
{ {
if ( item ) if ( item )
{ {
playlist_AddItem( p_playlist, (playlist_item_t*)item, playlist_AddItem( p_playlist, (playlist_item_t*)item,
PLAYLIST_INSERT, index ); PLAYLIST_INSERT, index );
} }
// TODO: once playlist is returning useful info, return that instead // TODO: once playlist is returning useful info, return that instead
return true; return true;
} }
// PlaylistCloneItem // PlaylistCloneItem
void* void*
VlcWrapper::PlaylistCloneItem( void* castToItem ) const VlcWrapper::PlaylistCloneItem( void* castToItem ) const
{ {
playlist_item_t* copy = NULL; playlist_item_t* copy = NULL;
playlist_item_t* item = (playlist_item_t*)castToItem; playlist_item_t* item = (playlist_item_t*)castToItem;
if ( item ) if ( item )
{ {
copy = (playlist_item_t*)malloc( sizeof( playlist_item_t ) ); copy = (playlist_item_t*)malloc( sizeof( playlist_item_t ) );
if ( copy ) if ( copy )
{ {
// make a copy of the item at index // make a copy of the item at index
*copy = *item; *copy = *item;
copy->input.psz_name = strdup( item->input.psz_name ); copy->input.psz_name = strdup( item->input.psz_name );
copy->input.psz_uri = strdup( item->input.psz_uri ); copy->input.psz_uri = strdup( item->input.psz_uri );
} }
} }
return (void*)copy; return (void*)copy;
} }
// Careful! You need to know what you're doing here! // Careful! You need to know what you're doing here!
...@@ -671,11 +671,11 @@ VlcWrapper::PlaylistCloneItem( void* castToItem ) const ...@@ -671,11 +671,11 @@ VlcWrapper::PlaylistCloneItem( void* castToItem ) const
void void
VlcWrapper::PlaylistSetPlaying( int index ) const VlcWrapper::PlaylistSetPlaying( int index ) const
{ {
if ( index < 0 ) if ( index < 0 )
index = 0; index = 0;
if ( index >= p_playlist->i_size ) if ( index >= p_playlist->i_size )
index = p_playlist->i_size - 1; index = p_playlist->i_size - 1;
p_playlist->i_index = index; p_playlist->i_index = index;
} }
...@@ -749,16 +749,18 @@ bool VlcWrapper::HasTitles() ...@@ -749,16 +749,18 @@ bool VlcWrapper::HasTitles()
if( !p_input ) if( !p_input )
return false; return false;
return ( p_input->stream.i_area_nb > 1 ); /* FIXME */
return false;
} }
BList * VlcWrapper::GetTitles() BList * VlcWrapper::GetTitles()
{ {
if( p_input ) if( p_input )
{ {
BList *list = new BList();
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
BList *list = new BList( p_input->stream.i_area_nb );
BMenuItem *menuItem; BMenuItem *menuItem;
BMessage *message; BMessage *message;
...@@ -774,7 +776,7 @@ BList * VlcWrapper::GetTitles() ...@@ -774,7 +776,7 @@ BList * VlcWrapper::GetTitles()
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
return list; return list;
} }
return NULL; return NULL;
...@@ -782,22 +784,12 @@ BList * VlcWrapper::GetTitles() ...@@ -782,22 +784,12 @@ BList * VlcWrapper::GetTitles()
void VlcWrapper::PrevTitle() void VlcWrapper::PrevTitle()
{ {
int i_id; var_SetVoid( p_input, "prev-title" );
i_id = p_input->stream.p_selected_area->i_id - 1;
if( i_id > 0 )
{
ToggleTitle(i_id);
}
} }
void VlcWrapper::NextTitle() void VlcWrapper::NextTitle()
{ {
unsigned int i_id; var_SetVoid( p_input, "next-title" );
i_id = p_input->stream.p_selected_area->i_id + 1;
if( i_id < p_input->stream.i_area_nb )
{
ToggleTitle(i_id);
}
} }
void VlcWrapper::ToggleTitle(int i_title) void VlcWrapper::ToggleTitle(int i_title)
...@@ -810,20 +802,22 @@ void VlcWrapper::ToggleTitle(int i_title) ...@@ -810,20 +802,22 @@ void VlcWrapper::ToggleTitle(int i_title)
void VlcWrapper::TitleInfo( int32 &currentIndex, int32 &maxIndex ) void VlcWrapper::TitleInfo( int32 &currentIndex, int32 &maxIndex )
{ {
currentIndex = -1; currentIndex = -1;
maxIndex = -1; maxIndex = -1;
if ( p_input ) if ( p_input )
{ {
vlc_mutex_lock( &p_input->stream.stream_lock ); #if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
maxIndex = p_input->stream.i_area_nb - 1; maxIndex = p_input->stream.i_area_nb - 1;
if ( maxIndex > 0) if ( maxIndex > 0)
currentIndex = p_input->stream.p_selected_area->i_id; currentIndex = p_input->stream.p_selected_area->i_id;
else else
maxIndex = -1; maxIndex = -1;
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
} #endif
}
} }
bool VlcWrapper::HasChapters() bool VlcWrapper::HasChapters()
...@@ -832,16 +826,18 @@ bool VlcWrapper::HasChapters() ...@@ -832,16 +826,18 @@ bool VlcWrapper::HasChapters()
{ {
return false; return false;
} }
return ( p_input->stream.p_selected_area->i_part_nb > 1 ); /* FIXME */
return false;
} }
BList * VlcWrapper::GetChapters() BList * VlcWrapper::GetChapters()
{ {
if( p_input ) if( p_input )
{ {
BList *list = new BList();
#if 0
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
BList *list = new BList( p_input->stream.p_selected_area->i_part_nb );
BMenuItem *menuItem; BMenuItem *menuItem;
BMessage *message; BMessage *message;
...@@ -858,7 +854,7 @@ BList * VlcWrapper::GetChapters() ...@@ -858,7 +854,7 @@ BList * VlcWrapper::GetChapters()
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
return list; return list;
} }
return NULL; return NULL;
...@@ -866,22 +862,12 @@ BList * VlcWrapper::GetChapters() ...@@ -866,22 +862,12 @@ BList * VlcWrapper::GetChapters()
void VlcWrapper::PrevChapter() void VlcWrapper::PrevChapter()
{ {
int i_id; var_SetVoid( p_input, "prev-chapter" );
i_id = p_input->stream.p_selected_area->i_part - 1;
if( i_id >= 0 )
{
ToggleChapter(i_id);
}
} }
void VlcWrapper::NextChapter() void VlcWrapper::NextChapter()
{ {
int i_id; var_SetVoid( p_input, "next-chapter" );
i_id = p_input->stream.p_selected_area->i_part + 1;
if( i_id >= 0 )
{
ToggleChapter(i_id);
}
} }
void VlcWrapper::ToggleChapter(int i_chapter) void VlcWrapper::ToggleChapter(int i_chapter)
...@@ -894,20 +880,22 @@ void VlcWrapper::ToggleChapter(int i_chapter) ...@@ -894,20 +880,22 @@ void VlcWrapper::ToggleChapter(int i_chapter)
void VlcWrapper::ChapterInfo( int32 &currentIndex, int32 &maxIndex ) void VlcWrapper::ChapterInfo( int32 &currentIndex, int32 &maxIndex )
{ {
currentIndex = -1; currentIndex = -1;
maxIndex = -1; maxIndex = -1;
if ( p_input ) if ( p_input )
{ {
vlc_mutex_lock( &p_input->stream.stream_lock ); #if 0
vlc_mutex_lock( &p_input->stream.stream_lock );
maxIndex = p_input->stream.p_selected_area->i_part_nb - 1; maxIndex = p_input->stream.p_selected_area->i_part_nb - 1;
if ( maxIndex > 0) if ( maxIndex > 0)
currentIndex = p_input->stream.p_selected_area->i_part; currentIndex = p_input->stream.p_selected_area->i_part;
else else
maxIndex = -1; 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() ...@@ -924,6 +912,7 @@ void VlcWrapper::FilterChange()
if( !p_input ) if( !p_input )
return; return;
#if 0
vout_thread_t * p_vout; vout_thread_t * p_vout;
vlc_mutex_lock( &p_input->stream.stream_lock ); vlc_mutex_lock( &p_input->stream.stream_lock );
...@@ -947,4 +936,5 @@ void VlcWrapper::FilterChange() ...@@ -947,4 +936,5 @@ void VlcWrapper::FilterChange()
} }
} }
vlc_mutex_unlock( &p_input->stream.stream_lock ); vlc_mutex_unlock( &p_input->stream.stream_lock );
#endif
} }
...@@ -63,13 +63,13 @@ static void MergeGeneric ( void *, const void *, const void *, size_t ); ...@@ -63,13 +63,13 @@ static void MergeGeneric ( void *, const void *, const void *, size_t );
#if defined(CAN_COMPILE_C_ALTIVEC) #if defined(CAN_COMPILE_C_ALTIVEC)
static void MergeAltivec ( void *, const void *, const void *, size_t ); static void MergeAltivec ( void *, const void *, const void *, size_t );
#endif #endif
#if defined(CAN_COMPILE_MMX) #if defined(CAN_COMPILE_MMXEXT)
static void MergeMMX ( void *, const void *, const void *, size_t ); static void MergeMMX ( void *, const void *, const void *, size_t );
#endif #endif
#if defined(CAN_COMPILE_SSE) && !defined(SYS_BEOS) #if defined(CAN_COMPILE_SSE) && !defined(SYS_BEOS)
static void MergeSSE2 ( void *, const void *, const void *, size_t ); static void MergeSSE2 ( void *, const void *, const void *, size_t );
#endif #endif
#if defined(CAN_COMPILE_MMX) || defined(CAN_COMPILE_SSE) #if defined(CAN_COMPILE_MMXEXT) || defined(CAN_COMPILE_SSE)
static void EndMMX ( void ); static void EndMMX ( void );
#endif #endif
...@@ -184,7 +184,7 @@ static int Create( vlc_object_t *p_this ) ...@@ -184,7 +184,7 @@ static int Create( vlc_object_t *p_this )
} }
else else
#endif #endif
#if defined(CAN_COMPILE_MMX) #if defined(CAN_COMPILE_MMXEXT)
if( p_vout->p_libvlc->i_cpu & CPU_CAPABILITY_MMX ) if( p_vout->p_libvlc->i_cpu & CPU_CAPABILITY_MMX )
{ {
p_vout->p_sys->pf_merge = MergeMMX; p_vout->p_sys->pf_merge = MergeMMX;
...@@ -871,7 +871,7 @@ static void MergeGeneric( void *_p_dest, const void *_p_s1, ...@@ -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, static void MergeMMX( void *_p_dest, const void *_p_s1, const void *_p_s2,
size_t i_bytes ) size_t i_bytes )
{ {
...@@ -934,7 +934,7 @@ static void MergeSSE2( void *_p_dest, const void *_p_s1, const void *_p_s2, ...@@ -934,7 +934,7 @@ static void MergeSSE2( void *_p_dest, const void *_p_s1, const void *_p_s2,
} }
#endif #endif
#if defined(CAN_COMPILE_MMX) || defined(CAN_COMPILE_SSE) #if defined(CAN_COMPILE_MMXEXT) || defined(CAN_COMPILE_SSE)
static void EndMMX( void ) static void EndMMX( void )
{ {
__asm__ __volatile__( "emms" :: ); __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