summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--configure.ac42
-rw-r--r--src/liba52/Makefile.am2
-rw-r--r--src/libffmpeg/Makefile.am2
-rw-r--r--src/libffmpeg/diff_to_ffmpeg_cvs.txt32
-rw-r--r--src/libffmpeg/libavcodec/mlib/dsputil_mlib.c4
-rw-r--r--src/libmpeg2/Makefile.am2
-rw-r--r--src/video_out/Makefile.am9
-rw-r--r--src/video_out/yuv2rgb.c7
-rw-r--r--src/xine-utils/cpu_accel.c39
10 files changed, 97 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index b38d80a8b..3b5a879fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,7 +13,9 @@ xine-lib (1-rc2)
* concatenated asf streams support
* fix performance issue with wav demuxer and compressed data
* fix mpeg 2 audio frame parsing (mpeg_audio demuxer)
-
+ * fix segmentation fault in mms when iconv_open fails
+ * allow lazy loading of Sun mediaLib (configure --enable-mlib-lazyload)
+
xine-lib (1-rc1)
* fix incorrect colours when blending frame with a big-endian RGB pixel format
* add support for chroma keyed overlay graphics to video_out_pgx64
diff --git a/configure.ac b/configure.ac
index 4a09115fb..3f91ba3fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,29 +226,31 @@ dnl mpeg2lib stuff
dnl ---------------------------------------------
AC_SUBST(LIBMPEG2_CFLAGS)
-AC_SUBST(LIBA52_CFLAGS)
AC_SUBST(LIBFFMPEG_CFLAGS)
LIBMPEG2_CFLAGS=""
-LIBA52_CFLAGS=""
LIBFFMPEG_CFLAGS="-DSIMPLE_IDCT -DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DUSE_FASTMEMCPY -DCONFIG_RISKY -DCONFIG_ENCODERS"
AC_ARG_ENABLE(altivec,
- [ --disable-altivec use assembly codes for Motorola 74xx CPUs],
+ [ --disable-altivec Use assembly codes for Motorola 74xx CPUs],
enable_altivec=no,
enable_altivec=yes)
AC_ARG_ENABLE(vis,
- [ --disable-vis use assembly codes for Sun UltraSPARC cpus],
+ [ --disable-vis Use assembly codes for Sun UltraSPARC CPUs],
enable_vis=no,
enable_vis=yes)
-if test x$enable_mlib = x; then
AC_ARG_ENABLE(mlib,
- [ --disable-mlib make a version not using mediaLib],
+ [ --disable-mlib Do not build Sun mediaLib support],
enable_mlib=no,
enable_mlib=yes)
-fi
+
+AC_ARG_ENABLE(mlib-lazyload,
+ [ --enable-mlib-lazyload Check for Sun mediaLib at runtime],
+ enable_mlib_lazyload=yes,
+ enable_mlib_lazyload=no)
+
if test x$enable_mlib = xyes; then
if test x"$MLIBHOME" = x; then
mlibhome=/opt/SUNWmlib
@@ -260,20 +262,28 @@ if test x$enable_mlib = xyes; then
[ saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$mlibhome/include"
AC_CHECK_HEADER(mlib_video.h,
- [ LIBS="$LIBS -L$mlibhome/lib -lmlib"
- LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -I$mlibhome/include"
- LIBA52_CFLAGS="$LIBA52_CFLAGS -I$mlibhome/include"
- LIBFFMPEG_CFLAGS="$LIBFFMPEG_CFLAGS -I$mlibhome/include"
- MLIB_CFLAGS="-I$mlibhome/include"
+ [ if test x$enable_mlib_lazyload = xyes; then
+ if test "$GCC" = yes; then
+ MLIB_LIBS="-L$mlibhome/lib -Wl,-z,lazyload,-lmlib,-z,nolazyload"
+ else
+ MLIB_LIBS="-L$mlibhome/lib -z lazyload -lmlib -z nolazyload"
+ fi
+ AC_DEFINE(MLIB_LAZYLOAD,1,[Define this if you want to load mlib lazily])
+ else
+ MLIB_LIBS="-L$mlibhome/lib -lmlib"
+ fi
+ MLIB_CFLAGS="-I$mlibhome/include"
+ LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS $MLIB_CFLAGS"
+ LIBFFMPEG_CFLAGS="$LIBFFMPEG_CFLAGS $MLIB_CFLAGS"
AC_DEFINE(HAVE_MLIB,1,[Define this if you have mlib installed])
- AC_DEFINE(LIBMPEG2_MLIB,1,[Define this if you have mlib installed])
- AC_DEFINE(LIBA52_MLIB,1,[Define this if you have mlib installed])
+ AC_DEFINE(LIBMPEG2_MLIB,1,[Define this if you have mlib installed])
ac_have_mlib=yes
],)
CPPFLAGS="$saved_CPPFLAGS"
], , -L$mlibhome/lib)
fi
AM_CONDITIONAL(HAVE_MLIB, test x$ac_have_mlib = "xyes")
+AC_SUBST(MLIB_LIBS)
AC_SUBST(MLIB_CFLAGS)
@@ -304,7 +314,7 @@ dnl IPv6
dnl ---------------------------------------------
AC_ARG_ENABLE(ipv6,
- [ --enable-ipv6 enable use of IPv6],
+ [ --enable-ipv6 Enable use of IPv6],
enable_ipv6=yes,
enable_ipv6=no)
@@ -980,7 +990,7 @@ dnl ---------------------------------------------
dnl VCDx
dnl ---------------------------------------------
dnl
-dnl AC_ARG_ENABLE(vcdx,[ --disable-vcdx Do not compile VCDX plugin. Compile old VCD instead], enable_vcdx=no, enable_vcdx=yes)
+dnl AC_ARG_ENABLE(vcdx,[ --disable-vcdx Do not compile VCDX plugin. Compile old VCD instead], enable_vcdx=no, enable_vcdx=yes)
dnl
dnl Force build of both vcd plugins, for now.
enable_vcdx="yes"
diff --git a/src/liba52/Makefile.am b/src/liba52/Makefile.am
index cee608e1d..6857bcea3 100644
--- a/src/liba52/Makefile.am
+++ b/src/liba52/Makefile.am
@@ -1,7 +1,5 @@
include $(top_srcdir)/misc/Makefile.common
-AM_CFLAGS = $(LIBA52_CFLAGS)
-
libdir = $(XINE_PLUGINDIR)
lib_LTLIBRARIES = xineplug_decode_a52.la
diff --git a/src/libffmpeg/Makefile.am b/src/libffmpeg/Makefile.am
index f92828aeb..9bccb7589 100644
--- a/src/libffmpeg/Makefile.am
+++ b/src/libffmpeg/Makefile.am
@@ -23,6 +23,6 @@ xineplug_decode_ff_la_SOURCES = xine_decoder.c
xineplug_decode_ff_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
endif
-xineplug_decode_ff_la_LIBADD = $(XINE_LIB) \
+xineplug_decode_ff_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB) \
$(top_builddir)/src/libffmpeg/libavcodec/libavcodec.la \
$(top_builddir)/src/libffmpeg/libavcodec/libpostproc/libpostprocess.la
diff --git a/src/libffmpeg/diff_to_ffmpeg_cvs.txt b/src/libffmpeg/diff_to_ffmpeg_cvs.txt
index adbaf0d43..627cb4750 100644
--- a/src/libffmpeg/diff_to_ffmpeg_cvs.txt
+++ b/src/libffmpeg/diff_to_ffmpeg_cvs.txt
@@ -692,3 +692,35 @@ diff -u -r1.8 motion_est_mmx.c
static inline void sad8_mmx(uint8_t *blk1, uint8_t *blk2, int stride, int h)
{
+Index: libavcodec/mlib/dsputil_mlib.c
+===================================================================
+RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c,v
+--- dsputil_mlib,c 2003-10-19 13:06:27.560738000 +0100
++++ dsputil_mlib.c 2003-10-19 13:01:50.427851000 +0100
+@@ -414,6 +414,7 @@
+
+ void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx)
+ {
++ if (xine_mm_accel() & MM_ACCEL_MLIB) {
+ c->get_pixels = get_pixels_mlib;
+ c->diff_pixels = diff_pixels_mlib;
+ c->add_pixels_clamped = add_pixels_clamped_mlib;
+@@ -440,10 +441,12 @@
+ c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib;
+
+ c->bswap_buf = bswap_buf_mlib;
++ }
+ }
+
+ void MPV_common_init_mlib(MpegEncContext *s)
+ {
++ if (xine_mm_accel() & MM_ACCEL_MLIB) {
+ if(s->avctx->dct_algo==FF_DCT_AUTO || s->avctx->dct_algo==FF_DCT_MLIB){
+ s->dsp.fdct = ff_fdct_mlib;
+ }
+@@ -453,4 +456,5 @@
+ s->dsp.idct_add = ff_idct_add_mlib;
+ s->dsp.idct_permutation_type= FF_NO_IDCT_PERM;
+ }
++ }
+ }
diff --git a/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c b/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c
index f4ad328f0..19c9e6c19 100644
--- a/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c
+++ b/src/libffmpeg/libavcodec/mlib/dsputil_mlib.c
@@ -414,6 +414,7 @@ static void ff_fdct_mlib(DCTELEM *data)
void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx)
{
+ if (xine_mm_accel() & MM_ACCEL_MLIB) {
c->get_pixels = get_pixels_mlib;
c->diff_pixels = diff_pixels_mlib;
c->add_pixels_clamped = add_pixels_clamped_mlib;
@@ -440,10 +441,12 @@ void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx)
c->put_no_rnd_pixels_tab[1][0] = put_pixels8_mlib;
c->bswap_buf = bswap_buf_mlib;
+ }
}
void MPV_common_init_mlib(MpegEncContext *s)
{
+ if (xine_mm_accel() & MM_ACCEL_MLIB) {
if(s->avctx->dct_algo==FF_DCT_AUTO || s->avctx->dct_algo==FF_DCT_MLIB){
s->dsp.fdct = ff_fdct_mlib;
}
@@ -453,4 +456,5 @@ void MPV_common_init_mlib(MpegEncContext *s)
s->dsp.idct_add = ff_idct_add_mlib;
s->dsp.idct_permutation_type= FF_NO_IDCT_PERM;
}
+ }
}
diff --git a/src/libmpeg2/Makefile.am b/src/libmpeg2/Makefile.am
index 7e5dbeb15..417bc33cf 100644
--- a/src/libmpeg2/Makefile.am
+++ b/src/libmpeg2/Makefile.am
@@ -25,7 +25,7 @@ xineplug_decode_mpeg2_la_SOURCES = \
stats.c \
xine_decoder.c
-xineplug_decode_mpeg2_la_LIBADD = $(XINE_LIB)
+xineplug_decode_mpeg2_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB)
xineplug_decode_mpeg2_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
noinst_HEADERS = vlc.h mpeg2.h mpeg2_internal.h
diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am
index 03bd3dd2a..48333bd83 100644
--- a/src/video_out/Makefile.am
+++ b/src/video_out/Makefile.am
@@ -85,14 +85,13 @@ xineplug_vo_out_xvmc_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
xineplug_vo_out_xshm_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \
alphablend.c video_out_xshm.c
-xineplug_vo_out_xshm_la_LIBADD = $(X_LIBS) -lXext \
- $(XINE_LIB)
+xineplug_vo_out_xshm_la_LIBADD = $(MLIB_LIBS) $(X_LIBS) -lXext $(XINE_LIB)
xineplug_vo_out_xshm_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
#xineplug_vo_out_opengl_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \
# alphablend.c video_out_opengl.c
-#xineplug_vo_out_opengl_la_LIBADD = $(OPENGL_LIBS) $(GLUT_LIBS) $(GLU_LIBS) $(X_LIBS) \
-# $(XINE_LIB)
+#xineplug_vo_out_opengl_la_LIBADD = $(MLIB_LIBS) $(OPENGL_LIBS) $(GLUT_LIBS) \
+# $(GLU_LIBS) $(X_LIBS) $(XINE_LIB)
#xineplug_vo_out_opengl_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
xineplug_vo_out_syncfb_la_SOURCES = alphablend.c video_out_syncfb.c
@@ -105,7 +104,7 @@ xineplug_vo_out_aa_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
xineplug_vo_out_fb_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c \
alphablend.c video_out_fb.c
-xineplug_vo_out_fb_la_LIBADD = $(XINE_LIB)
+xineplug_vo_out_fb_la_LIBADD = $(MLIB_LIBS) $(XINE_LIB)
xineplug_vo_out_fb_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@
xineplug_vo_out_directfb_la_SOURCES = alphablend.c video_out_directfb.c
diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c
index d60b57dbb..ac7a55b2b 100644
--- a/src/video_out/yuv2rgb.c
+++ b/src/video_out/yuv2rgb.c
@@ -23,7 +23,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: yuv2rgb.c,v 1.44 2003/08/25 21:51:50 f1rmb Exp $
+ * $Id: yuv2rgb.c,v 1.45 2003/10/20 00:33:29 komadori Exp $
*/
#include "config.h"
@@ -3156,10 +3156,7 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped,
uint8_t *cmap) {
yuv2rgb_factory_t *this;
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
uint32_t mm = xine_mm_accel();
-#endif
this = malloc (sizeof (yuv2rgb_factory_t));
@@ -3204,7 +3201,7 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped,
}
#endif
#if HAVE_MLIB
- if (this->yuv2rgb_fun == NULL) {
+ if ((this->yuv2rgb_fun == NULL) && (mm & MM_ACCEL_MLIB)) {
yuv2rgb_init_mlib (this);
diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c
index 6794143f7..d0f328112 100644
--- a/src/xine-utils/cpu_accel.c
+++ b/src/xine-utils/cpu_accel.c
@@ -26,6 +26,7 @@
#include <inttypes.h>
#include <signal.h>
#include <setjmp.h>
+#include <dlfcn.h>
#include "xineutils.h"
@@ -174,16 +175,32 @@ static uint32_t arch_accel (void)
uint32_t xine_mm_accel (void)
{
-#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC))
+ static int initialized = 0;
static uint32_t accel;
- static int initialized;
if (!initialized) {
+#if defined (ARCH_X86) || (defined (ARCH_PPC) && defined (ENABLE_ALTIVEC))
accel = arch_accel ();
+#elif defined (HAVE_MLIB)
+#ifdef MLIB_LAZYLOAD
+ void *hndl;
+
+ if ((hndl = dlopen("libmlib.so.2", RTLD_LAZY | RTLD_GLOBAL | RTLD_NODELETE)) == NULL) {
+ accel = 0;
+ }
+ else {
+ dlclose(hndl);
+ accel = MM_ACCEL_MLIB;
+ }
+#else
+ accel = MM_ACCEL_MLIB;
+#endif
+#else
+ accel = 0;
+#endif
#if defined(ARCH_X86) || defined(ARCH_X86_64)
#ifndef _MSC_VER
-
/* test OS support for SSE */
if( accel & MM_ACCEL_X86_SSE ) {
void (*old_sigill_handler)(int);
@@ -202,22 +219,14 @@ uint32_t xine_mm_accel (void)
signal (SIGILL, old_sigill_handler);
}
#endif /* _MSC_VER */
-#endif /* ARCH_X86 */
+#endif /* ARCH_X86 || ARCH_X86_64 */
- if( getenv("XINE_NO_ACCEL") )
+ if(getenv("XINE_NO_ACCEL")) {
accel = 0;
+ }
- initialized++;
+ initialized = 1;
}
return accel;
-
-#else /* !ARCH_X86 && !ARCH_PPC/ENABLE_ALTIVEC */
-#ifdef HAVE_MLIB
- return MM_ACCEL_MLIB;
-#else
- return 0;
-#endif
-#endif /* !ARCH_X86 && !ARCH_PPC/ENABLE_ALTIVEC */
}
-