Quoting Hallvar Helleseth ([EMAIL PROTECTED]):
> Hello..
> I've been quite buisy the last weeks, but I've put together patches to get a
> videoprovider for directfb using Xine.
> I've got two patches one for the latest xine cvs:
> cd xine-lib;cat patch-xine-lib | patch -p1
> and one for latest directfb cvs:
> cd DirectFB;cat patch-directfb | patch -p1
>
> first install the xine stuff, then directfb
>
> $ df_video video.mpg
>
> HOWEVER!!! (BIG)
> It doesn't work, I'm stuck with a problem that I can't figure out.
> if you try the code you'll see at the beginning of the output there is:
> datatype: 0 <--- printed from xine's directfb videoutput plugin
> <a line>
> gotten: 2 <--- printed from idirectfbvideoprovider_xine.c
I got it working. First thing is that you forgot to include the CFLAGS
from directfb-internal.pc. So I hacked the configure.in and the Makefile.am.
Furthermore I handled all three planes in display_frame so I got it running
in df_layer with YUY2, playing a 384x288 MPEG1 at 4% CPU usage, very nice.
I have attached all files that I had to modify to get it working.
If you don't have enough time to continue work on this provider
I would like to finish it. This seems really cool as it can play
many formats, we could get away from avifile.
BTW: I listened to an ".mp3" yesterday in dfbsee (using the xine provider) :-P
--
Best regards,
Denis Oliver Kropp
.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/ |
"------------------------------------------"
convergence integrated media GmbH
/*
(c) Copyright 2001 Kim JeongHoe <[EMAIL PROTECTED]> and Hallvar I guess..
All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <malloc.h>
#include <pthread.h>
#include <directfb.h>
#include <directfb_internals.h>
#include <misc/util.h>
#include <misc/mem.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/state.h>
#include <core/surfaces.h>
#include <core/gfxcard.h>
#include <display/idirectfbsurface.h>
//#include <xine.h>
#include <xine/xine_internal.h>
//#include "utils.h"
#include <xine/xineutils.h>
#include "xine_provider.h"
static void
IDirectFBVideoProvider_Xine_Destruct( IDirectFBVideoProvider *thiz )
{
IDirectFBVideoProvider_Xine_data *data;
data = (IDirectFBVideoProvider_Xine_data*)thiz->priv;
thiz->Stop( thiz );
DFBFREE( data->filename );
DFBFREE( thiz->priv );
thiz->priv = NULL;
#ifndef DFB_DEBUG
DFBFREE( thiz );
#endif
}
static DFBResult
IDirectFBVideoProvider_Xine_AddRef( IDirectFBVideoProvider *thiz )
{
INTERFACE_GET_DATA (IDirectFBVideoProvider_Xine)
data->ref++;
return DFB_OK;
}
static DFBResult
IDirectFBVideoProvider_Xine_Release( IDirectFBVideoProvider *thiz )
{
INTERFACE_GET_DATA (IDirectFBVideoProvider_Xine)
if (--data->ref == 0) {
IDirectFBVideoProvider_Xine_Destruct( thiz );
}
return DFB_OK;
}
static DFBResult
IDirectFBVideoProvider_Xine_GetCapabilities(
IDirectFBVideoProvider *thiz,
DFBVideoProviderCapabilities *caps )
{
INTERFACE_GET_DATA (IDirectFBVideoProvider_Xine)
if (!caps)
return DFB_INVARG;
*caps = DVCAPS_BASIC | DVCAPS_SCALE | DVCAPS_SEEK;
return DFB_OK;
}
static DFBResult
IDirectFBVideoProvider_Xine_GetSurfaceDescription(
IDirectFBVideoProvider *thiz, DFBSurfaceDescription *desc )
{
INTERFACE_GET_DATA (IDirectFBVideoProvider_Xine)
if (!desc)
return DFB_INVARG;
desc->flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
desc->width = 384;
desc->height = 288;
desc->pixelformat = layers->shared->surface->format;
return DFB_OK;
}
static void*
MpegThread( void *ctx )
{
IDirectFBVideoProvider_Xine_data *data =
(IDirectFBVideoProvider_Xine_data*) ctx;
struct timeval start, after;
long frame_delay;
long delay = -1;
double rate;
DFBRectangle rect, drect, srect;
int drop = 0;
long frame;
long frames;
rect.x = 0;
rect.y = 0;
rect.w = 384;
rect.h = 288;
data->d = 542;
xine_play(data->xine, data->filename, 0, 0);
while ( 1 ) {
pthread_testcancel();
usleep(20000);
/*
drect = data->dest_rect;
if (drect.w != rect.w || drect.h != rect.h)
{
gfxcard_stretchblit( &rect, &drect, &data->state );
}
else {
srect = rect;
gfxcard_blit( &srect, drect.x, drect.y, &data->state );
}
if (data->callback)
data->callback (data->ctx);
*/
}
return NULL;
}
static DFBResult
IDirectFBVideoProvider_Xine_PlayTo( IDirectFBVideoProvider *thiz,
IDirectFBSurface *destination,
DFBRectangle *dstrect,
DVFrameCallback callback,
void *ctx )
{
DFBRectangle rect;
IDirectFBSurface_data *dst_data;
INTERFACE_GET_DATA (IDirectFBVideoProvider_Xine)
if (!destination)
return DFB_INVARG;
dst_data = (IDirectFBSurface_data*)destination->priv;
if (!dst_data)
return DFB_DEAD;
/* build the destination rectangle */
if (dstrect) {
if (dstrect->w < 1 || dstrect->h < 1)
return DFB_INVARG;
rect = *dstrect;
rect.x += dst_data->area.wanted.x;
rect.y += dst_data->area.wanted.y;
}
else
rect = dst_data->area.wanted;
/* save for later blitting operation */
data->dest_rect = rect;
/* build the clip rectangle */
if (!rectangle_intersect( &rect, &dst_data->area.current ))
return DFB_INVARG;
/* put the destination clip into the state */
data->state.clip.x1 = rect.x;
data->state.clip.y1 = rect.y;
data->state.clip.x2 = rect.x + rect.w - 1;
data->state.clip.y2 = rect.y + rect.h - 1;
data->state.destination = dst_data->surface;
data->state.modified = (StateModificationFlags)
(data->state.modified | SMF_CLIP | SMF_DESTINATION);
if (data->destination) {
data->destination->Release( data->destination );
data->destination = NULL; /* FIXME: remove listener */
}
destination->AddRef( destination );
data->destination = destination; /* FIXME: install listener */
data->callback = callback;
data->ctx = ctx;
data->width = dst_data->surface->width;
data->height = dst_data->surface->height;
data->dstsurface = dst_data->surface;
surfacemanager_lock(data->dstsurface->manager);
surfacemanager_assure_video(data->dstsurface->manager, data->dstsurface->back_buffer);
surfacemanager_unlock(data->dstsurface->manager);
if (data->thread == -1)
pthread_create( &data->thread, NULL, MpegThread, data );
return DFB_OK;
}
static DFBResult
IDirectFBVideoProvider_Xine_Stop( IDirectFBVideoProvider *thiz )
{
IDirectFBVideoProvider_Xine_data *data;
if (!thiz)
return DFB_INVARG;
data = (IDirectFBVideoProvider_Xine_data*)thiz->priv;
if (!data)
return DFB_DEAD;
if (data->thread != -1)
{
pthread_cancel( data->thread );
pthread_join( data->thread, NULL );
data->thread = -1;
}
if (data->destination) {
data->destination->Release( data->destination );
data->destination = NULL; /* FIXME: remove listener */
}
return DFB_OK;
}
static DFBResult IDirectFBVideoProvider_Xine_SeekTo(
IDirectFBVideoProvider *thiz,
double seconds )
{
IDirectFBVideoProvider_Xine_data *data;
double rate;
if (!thiz)
return DFB_INVARG;
data = (IDirectFBVideoProvider_Xine_data*)thiz->priv;
if (!data)
return DFB_DEAD;
/*
rate = mpeg3_frame_rate( data->stream, 0 );
mpeg3_set_frame( data->stream, (long) (seconds * rate), 0 );
*/
return DFB_OK;
}
static DFBResult IDirectFBVideoProvider_Xine_GetPos(
IDirectFBVideoProvider *thiz,
double *seconds )
{
IDirectFBVideoProvider_Xine_data *data;
double rate;
if (!thiz)
return DFB_INVARG;
data = (IDirectFBVideoProvider_Xine_data*)thiz->priv;
if (!data)
return DFB_DEAD;
/*
rate = mpeg3_frame_rate( data->stream, 0 );
*seconds = mpeg3_get_frame( data->stream, 0 ) / rate;
*/
return DFB_OK;
}
static DFBResult IDirectFBVideoProvider_Xine_GetLength(
IDirectFBVideoProvider *thiz,
double *seconds )
{
IDirectFBVideoProvider_Xine_data *data;
double rate;
long frames;
if (!thiz)
return DFB_INVARG;
data = (IDirectFBVideoProvider_Xine_data*)thiz->priv;
if (!data)
return DFB_DEAD;
/*
frames = mpeg3_video_frames( data->stream, 0 );
if (frames <= 1)
return DFB_UNSUPPORTED;
rate = mpeg3_frame_rate( data->stream, 0 );
*seconds = frames / rate;
*/
return DFB_OK;
}
static DFBResult IDirectFBVideoProvider_Xine_GetColorAdjustment(
IDirectFBVideoProvider *thiz,
DFBColorAdjustment *adj )
{
IDirectFBVideoProvider_Xine_data *data;
if (!thiz || !adj)
return DFB_INVARG;
data = (IDirectFBVideoProvider_Xine_data*)thiz->priv;
if (!data)
return DFB_DEAD;
return DFB_UNIMPLEMENTED;
}
static DFBResult IDirectFBVideoProvider_Xine_SetColorAdjustment(
IDirectFBVideoProvider *thiz,
DFBColorAdjustment *adj )
{
IDirectFBVideoProvider_Xine_data *data;
if (!thiz || !adj)
return DFB_INVARG;
data = (IDirectFBVideoProvider_Xine_data*)thiz->priv;
if (!data)
return DFB_DEAD;
return DFB_UNIMPLEMENTED;
}
/* exported symbols */
const char *get_type()
{
return "IDirectFBVideoProvider";
}
const char *get_implementation()
{
return "Xine";
}
DFBResult Probe( const char *filename )
{
return DFB_OK;
}
DFBResult Construct( IDirectFBVideoProvider *thiz, const char *filename )
{
IDirectFBVideoProvider_Xine_data *data;
int height, width;
char *audio_driver_id = NULL;
int audio_channel = 0;
int demux_strategy = DEMUX_DEFAULT_STRATEGY;
char *configfile;
vo_driver_t *vo_driver;
data = (IDirectFBVideoProvider_Xine_data *)
DFBCALLOC( 1, sizeof(IDirectFBVideoProvider_Xine_data) );
/*
data = (IDirectFBVideoProvider_Xine_data *) malloc(sizeof(IDirectFBVideoProvider_Xine_data));
data->d = 2;
data->vo_driver = xine_load_video_output_plugin(NULL, "directfb", VISUAL_TYPE_DIRECTFB, (void *) data);
*/
thiz->priv = data;
data->ref = 1;
data->filename = DFBSTRDUP( filename );
data->state.source = data->source;
data->state.modified = SMF_ALL;
data->thread = -1;
thiz->AddRef = IDirectFBVideoProvider_Xine_AddRef;
thiz->Release = IDirectFBVideoProvider_Xine_Release;
thiz->GetCapabilities = IDirectFBVideoProvider_Xine_GetCapabilities;
thiz->GetSurfaceDescription =
IDirectFBVideoProvider_Xine_GetSurfaceDescription;
thiz->PlayTo = IDirectFBVideoProvider_Xine_PlayTo;
thiz->Stop = IDirectFBVideoProvider_Xine_Stop;
thiz->SeekTo = IDirectFBVideoProvider_Xine_SeekTo;
thiz->GetPos = IDirectFBVideoProvider_Xine_GetPos;
thiz->GetLength = IDirectFBVideoProvider_Xine_GetLength;
thiz->GetColorAdjustment =
IDirectFBVideoProvider_Xine_GetColorAdjustment;
thiz->SetColorAdjustment =
IDirectFBVideoProvider_Xine_SetColorAdjustment;
if(!xine_check_version(0, 9, 6))
return DFB_INIT;
{
char *homedir;
homedir = strdup(xine_get_homedir());
configfile = (char *) xine_xmalloc(strlen(homedir) + 8 + 1);
sprintf (configfile, "%s/.xinerc", homedir);
}
data->config = config_file_init (configfile);
/*
width = 384;
height = 288;
surface_create( width, height, DSPF_RGB16, CSP_SYSTEMONLY,
DSCAPS_SYSTEMONLY, &(data->source));
*/
data->d = 2;
//DataType *b;
//b = (DataType *)malloc(sizeof(DataType));
//b->d = 2343;
printf("gotten: %i (%p)\n", data->d, data);
vo_driver = xine_load_video_output_plugin(data->config, "directfb", VISUAL_TYPE_DIRECTFB, (void *) data);
printf("gotten: %i (%p)\n", data->d, data);
if(!vo_driver)
{
printf("video driver directfb failed\n");
return DFB_INIT;
}
audio_driver_id = "oss";
data->ao_driver = xine_load_audio_output_plugin(data->config,
audio_driver_id);
if(!data->ao_driver)
{
printf("audio driver oss failed\n");
}
data->xine = xine_init (vo_driver, data->ao_driver, data->config);
if(!data->xine)
{
printf("xine_init() failed.\n");
return DFB_INIT;
}
xine_select_audio_channel (data->xine, audio_channel);
return DFB_OK;
}
/*
#include <directfb.h>
#include <directfb_internals.h>
#include <misc/util.h>
#include <misc/mem.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/layers.h>
#include <core/state.h>
#include <core/surfaces.h>
#include <core/gfxcard.h>
#include <display/idirectfbsurface.h>
*/
typedef struct _xineviddata {
int ref;
char *filename;
xine_t *xine;
int ignore_status;
config_values_t *config;
ao_driver_t *ao_driver;
vo_driver_t *vo_driver;
pthread_t thread;
IDirectFBSurface *destination;
DFBRectangle dest_rect;
DVFrameCallback callback;
void *ctx;
int width;
int height;
CardState state;
CoreSurface *source;
CoreSurface *dstsurface;
int d;
} IDirectFBVideoProvider_Xine_data;
dnl
dnl Configure.in for xine
dnl
AC_INIT(src/xine-engine/xine.c)
dnl
dnl Require autoconf version 2.13
dnl
AC_PREREQ(2.13)
dnl
dnl Require libtool minimum version 1.4.0
dnl
dnl AC_PREREQ_LIBTOOL(1.4.0,,AC_MSG_ERROR(*** You should have libtool >= 1.4 installed
***))
dnl Making releases:
dnl XINE_SUB += 1;
dnl XINE_IFACE_AGE += 1;
dnl XINE_BIN_AGE += 1;
dnl if any functions have been added, set XINE_IFACE_AGE to 0.
dnl if backwards compatibility has been broken,
dnl set XINE_BIN_AGE _and_ XINE_IFACE_AGE to 0.
dnl
XINE_MAJOR=0
XINE_MINOR=9
XINE_SUB=7
XINE_PRE="cvs"
XINE_IFACE_AGE=2
XINE_BIN_AGE=2
AC_SUBST(XINE_MAJOR)
AC_SUBST(XINE_MINOR)
AC_SUBST(XINE_SUB)
AC_SUBST(XINE_IFACE_AGE)
AC_SUBST(XINE_BIN_AGE)
AC_DEFINE_UNQUOTED(XINE_MAJOR, $XINE_MAJOR)
AC_DEFINE_UNQUOTED(XINE_MINOR, $XINE_MINOR)
AC_DEFINE_UNQUOTED(XINE_SUB, $XINE_SUB)
## this is only for pre-1.0 releases (ie with unstable interface)
LT_RELEASE=$XINE_MAJOR.$XINE_MINOR.$XINE_SUB
LT_CURRENT=0
LT_REVISION=0
LT_AGE=0
## non-devel releases should not use LT_RELEASE but something like this:
##
## LT_REVISION=$XINE_SUB
## LT_CURRENT=`expr $XINE_MAJOR + $XINE_MINOR`
## LT_AGE=$XINE_MINOR
##
## !! This only works if subminor releases don't have any interface changes,
## !! minor releases _only add_ interfaces and major releases remove at least
## !! one interface
## otherwise, the LT_* variables must be set according to
## <info:(libtool)Updating version info>
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
TAR_NAME="xine-lib-"$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE
SPEC_VERSION=$XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE
AC_SUBST(TAR_NAME)
AC_SUBST(SPEC_VERSION)
AM_INIT_AUTOMAKE("xine-lib", $XINE_MAJOR.$XINE_MINOR.$XINE_SUB$XINE_PRE)
dnl
dnl Made possible to build for another arch.
dnl
if test x$XINE_BUILD != "x"; then
AC_MSG_RESULT([*** build forced to $XINE_BUILD ***])
build=$XINE_BUILD
host=$XINE_BUILD
else
check_athlon=yes
fi
AC_CANONICAL_HOST
AM_CONFIG_HEADER(config.h)
dnl
dnl Check for programs.
dnl
AC_ISC_POSIX
AC_PROG_CC
AC_STDC_HEADERS
AC_PROG_MAKE_SET
AC_PROG_INSTALL
dnl obsolete AC_PROG_RANLIB
AC_PROG_LN_S
dnl
dnl Libtool
dnl
AC_LIBTOOL_DLOPEN
AM_DISABLE_STATIC
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
STATIC="-static"
else
STATIC=
fi
AC_SUBST(STATIC)
dnl
dnl Check for assembler (ffmpeg need it), don't call this before LIBTOOL
dnl
AM_PROG_AS
dnl
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_C_BIGENDIAN
dnl AC_C_BIGENDIAN triggers an AC_TRY_RUN warning; we can't cross compile
dnl xine (oh, well)
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AM_TYPE_PTRDIFF_T
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(GLOBAL_CFLAGS)
dnl
dnl threads
dnl
case "$host" in
*-*-freebsd*)
THREAD_LIBS="-L/usr/local/lib -pthread"
THREAD_CFLAGS="-I/usr/local/include -D_THREAD_SAFE"
CFLAGS="$CFLAGS -L/usr/local/lib $THREAD_CFLAGS"
CPPFLAGS="$CPPFLAGS -I/usr/local/include -L/usr/local/lib"
;;
*)
AC_CHECK_LIB(pthread, pthread_create,
THREAD_LIBS="-lpthread",
AC_MSG_ERROR(pthread needed))
;;
esac
AC_SUBST(THREAD_LIBS)
AC_SUBST(THREAD_CFLAGS)
dnl
dnl dynamic linker
dnl
AC_CHECK_LIB(c, dlopen,
DYNAMIC_LD_LIBS="",
AC_CHECK_LIB(dl, dlopen,
DYNAMIC_LD_LIBS="-ldl",
AC_MSG_ERROR(dynamic linker needed)))
AC_SUBST(DYNAMIC_LD_LIBS)
dnl
dnl mpeg2lib stuff
dnl
AC_SUBST(LIBMPEG2_CONFIG_OBJS)
AC_SUBST(LIBMPEG2_CFLAGS)
AC_SUBST(LIBA52_CFLAGS)
AC_SUBST(LIBFFMPEG_CFLAGS)
LIBMPEG2_CFLAGS="" dnl default include path removed, no more needed.
LIBA52_CFLAGS=""
LIBFFMPEG_CFLAGS=""
AC_ARG_ENABLE(altivec, [ --disable-altivec use assembly codes for Motorola 74xx
CPUs],
enable_altivec=no, enable_altivec=yes)
if test x$enable_mlib = x; then
AC_ARG_ENABLE(mlib,
[ --disable-mlib make a version not using mediaLib],
enable_mlib=no, enable_mlib=yes)
fi
if test x$enable_mlib = xyes; then
if test x"$MLIBHOME" = x; then
mlibhome=/opt/SUNWmlib
else
mlibhome="$MLIBHOME"
fi
AC_CHECK_LIB(mlib, mlib_VideoAddBlock_U8_S16,
[ LIBS="$LIBS -L$mlibhome/lib -lmlib"
LIBMPEG2_CONFIG_OBJS="$LIBMPEG2_CONFIG_OBJS idct_mlib.lo
motion_comp_mlib.lo"
LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -I$mlibhome/include"
LIBA52_CFLAGS="$LIBA52_CFLAGS -I$mlibhome/include"
LIBFFMPEG_CFLAGS="$LIBFFMPEG_CFLAGS -I$mlibhome/include"
AC_DEFINE(HAVE_MLIB)
AC_DEFINE(LIBMPEG2_MLIB)
AC_DEFINE(LIBA52_MLIB)
ac_have_mlib=yes],
, -L/opt/SUNWmlib/lib)
AM_CONDITIONAL(HAVE_MLIB, test x$ac_have_mlib = "xyes")
fi
dnl
dnl Checks for X11
dnl
AC_PATH_XTRA
if test x"$no_x" != "xyes"; then
AC_DEFINE(HAVE_X11)
fi
AM_CONDITIONAL(HAVE_X11, [test x"$no_x" != "xyes"])
dnl
dnl Checks for Xv extension
dnl
dnl static linking with libXv is preferred!
dnl but only dynamic linking is possible when using libtool < 1.4.0
AC_PREREQ_LIBTOOL(1.4.0, xv_lib="libXv.a", xv_lib="libXv.so")
AC_ARG_WITH(xv-path,[ --with-xv-path=path Where $xv_lib is installed],
xv_path="$withval", xv_path="/usr/X11R6/lib")
AC_CHECK_LIB(Xv, XvShmCreateImage,
[ AC_MSG_CHECKING(for $xv_lib location)
if test -f "$xv_path/$xv_lib"; then
AC_MSG_RESULT(found in $xv_path)
XV_LIB="-lXv"
AC_DEFINE(HAVE_XV)
ac_have_xv="yes"
else
AC_MSG_RESULT(not found in $xv_path)
echo
echo
"****************************************************************"
echo "* if you don't have a libXv.so on your system, use:
*"
echo "* ld --whole-archive -shared -o libXv.so.1 libXv.a
*"
echo "* then: ln -s libXv.so.1 libXv.so
*"
echo "* to create it or try to use --with-xv-path to set the
*"
echo "* location of libXv.so
*"
echo
"****************************************************************"
echo
fi ],, [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
AM_CONDITIONAL(HAVE_XV, test x$ac_have_xv = "xyes")
AC_SUBST(XV_LIB)
dnl
dnl Checks for Xinerama extension
dnl
AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
[X_LIBS="$X_LIBS -lXinerama"
AC_DEFINE(HAVE_XINERAMA)
ac_have_xinerama="yes"],,
[$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
AM_CONDITIONAL(HAVE_XINERAMA, test x$ac_have_xinerama = "xyes")
dnl
dnl Checks for Ascii-Art library
dnl
AM_PATH_AALIB(1.2,, AC_MSG_RESULT([*** All of AALIB dependent parts will be disabled
***]))
AM_CONDITIONAL(HAVE_AA, test x$no_aalib != "xyes")
dnl
dnl Checks for DirectFB library
dnl
#
# Find pkg-config
#
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test x$PKG_CONFIG = xno ; then
AC_MSG_ERROR([*** pkg-config not found. See http://pkgconfig.sourceforge.net])
fi
if ! pkg-config --atleast-pkgconfig-version 0.5 ; then
AC_MSG_ERROR([*** pkg-config too old; version 0.5 or better required.])
fi
#
# Check for DirectFB
#
DIRECTFB_VERSION=0.9.8
DIRECTFB_REQUIRED_VERSION=$DIRECTFB_VERSION
AC_MSG_CHECKING(for DirectFB)
if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb ; then
DFB_CFLAGS=`$PKG_CONFIG --cflags directfb`
DFB_LIBS=`$PKG_CONFIG --libs directfb`
AC_MSG_RESULT(found)
else
AC_MSG_ERROR([*** DirectFB $DIRECTFB_VERSION or newer is required. ])
fi
#
# Check for DirectFB-Internal
#
DIRECTFB_REQUIRED_VERSION=$DIRECTFB_VERSION
AC_MSG_CHECKING(for DirectFB-Internal)
if $PKG_CONFIG --atleast-version $DIRECTFB_REQUIRED_VERSION directfb-internal ; then
DFB_INTERNAL_CFLAGS=`$PKG_CONFIG --cflags directfb-internal`
AC_MSG_RESULT(found)
else
AC_MSG_ERROR([*** DirectFB-Internal $DIRECTFB_VERSION or newer is required. ])
fi
DFB_CFLAGS="$DFB_CFLAGS $DFB_INTERNAL_CFLAGS -DREENTRANT"
AC_SUBST(DFB_CFLAGS)
AC_SUBST(DFB_LIBS)
AM_CONDITIONAL(HAVE_DIRECTFB, true)
dnl
dnl Check for divx4
dnl
dnl AC_CHECK_DIVX4(, AC_MSG_RESULT(*** All of DIVX4 dependent parts will be disabled
***))
dnl AM_CONDITIONAL(HAVE_DIVX4, test x"$no_divx4" != "xyes")
dnl
dnl Ogg/Vorbis libs.
dnl
AM_PATH_OGG([no_oggvorbis=no
AM_PATH_VORBIS(no_oggvorbis=no,
AC_MSG_RESULT([*** All of OGG/VORBIS dependent parts will
be disabled ***]))],
AC_MSG_RESULT([*** All of OGG/VORBIS dependent parts will be disabled
***]))
AM_CONDITIONAL(HAVE_VORBIS, [test x"$no_oggvorbis" = "xno"])
dnl
dnl OSS style audio interface
dnl
AC_MSG_CHECKING(for OSS audio support)
have_ossaudio=no
AC_TRY_COMPILE([
#ifdef __NetBSD__
#include <soundcard.h>
#else
#include <sys/soundcard.h>
#endif
],[
int arg = SNDCTL_DSP_SETFRAGMENT;
],[
have_ossaudio=yes
])
AC_MSG_RESULT($have_ossaudio)
AM_CONDITIONAL(HAVE_OSS, test x"$have_ossaudio" = "xyes")
dnl
dnl Alsa support
dnl
AM_PATH_ALSA(0.5.5,
[ AC_DEFINE(HAVE_ALSA)
if test x"$have_alsa05" = "xyes"; then
AC_DEFINE(HAVE_ALSA05)
fi
if test x"$have_alsa09" = "xyes"; then
AC_DEFINE(HAVE_ALSA09)
fi
],
AC_MSG_RESULT(*** All of ALSA dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ALSA, test x"$no_alsa" != "xyes")
AM_CONDITIONAL(HAVE_ALSA05, test x"$have_alsa05" = "xyes")
AM_CONDITIONAL(HAVE_ALSA09, test x"$have_alsa09" = "xyes")
dnl
dnl ESD support
dnl
AM_PATH_ESD(0.2.8,
AC_DEFINE(HAVE_ESD),
AC_MSG_RESULT(*** All of ESD dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ESD, test x"$no_esd" != "xyes")
dnl
dnl ARTS support
dnl
AM_PATH_ARTS(0.9.5,
AC_DEFINE(HAVE_ARTS),
AC_MSG_RESULT(*** All of ARTS dependent parts will be disabled ***))
AM_CONDITIONAL(HAVE_ARTS, test x"$no_arts" != "xyes")
dnl
dnl SUN style audio interface
dnl
AC_MSG_CHECKING(for Sun audio support)
have_sunaudio=no
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/audioio.h>
],[
audio_info_t audio_info;
AUDIO_INITINFO(&audio_info);
],[
have_sunaudio=yes
])
AC_MSG_RESULT($have_sunaudio)
AM_CONDITIONAL(HAVE_SUNAUDIO, test x"$have_sunaudio" = "xyes")
dnl
dnl IRIX style audio interface
dnl
AM_CHECK_IRIXAL([AC_DEFINE(HAVE_IRIXAL)],
[AC_MSG_RESULT([*** All of IRIX AL dependent parts will be disabled ***])])
AM_CONDITIONAL(HAVE_IRIXAL, [test "x$am_cv_have_irixal" = xyes])
dnl
dnl Solaris kstat kernel statistics
dnl
AC_CHECK_LIB(kstat, kstat_open,
[KSTAT_LIBS=-lkstat
AC_DEFINE([HAVE_KSTAT])])
AC_SUBST(KSTAT_LIBS)
dnl
dnl cdrom ioctls
dnl
AC_CHECK_HEADERS(sys/cdio.h linux/cdrom.h)
AM_CHECK_CDROM_IOCTLS([AC_DEFINE([HAVE_CDROM_IOCTLS])],
[AC_MSG_RESULT([*** DVD and (S)VCD support will be disabled ***])])
AM_CONDITIONAL(HAVE_CDROM_IOCTLS, [test x"$have_cdrom_ioctls" = "xyes"])
dnl
dnl dxr3 / hollywood plus card
dnl
AC_LINUX_PATH(/usr/src/linux)
AC_SUBST([LINUX_INCLUDE])
AC_CHECK_DXR3()
AM_CONDITIONAL(HAVE_DXR3, test x"$have_dxr3" = "xyes")
AM_CONDITIONAL(HAVE_LIBFAME, test x"$have_libfame" = "xyes")
AM_CONDITIONAL(HAVE_LIBRTE, test x"$have_librte" = "xyes")
AM_CONDITIONAL(HAVE_ENCODER, test x"$have_encoder" = "xyes")
dnl
dnl zlib
dnl
dnl Test for libz
AC_CHECK_LIB(z, gzsetparams, [AC_CHECK_HEADER(zlib.h,have_zlib=yes,)])
AM_CONDITIONAL(HAVE_ZLIB, [test x"$have_zlib" = "xyes"])
dnl
dnl ASF build can be optional
dnl
AC_ARG_ENABLE(asf, [ --disable-asf do not build ASF demuxer],
enable_asf=no, enable_asf=yes)
AM_CONDITIONAL(BUILD_ASF, test x"$enable_asf" = "xyes")
dnl
dnl ip_mreqn
dnl
AC_CHECK_IP_MREQN
dnl
dnl Using or not using -fPIC (override default behavior - system dependent)
dnl
AC_ARG_ENABLE(fpic,
[ --disable-fpic disable -fPIC on shared libs (default on x86)],
no_fpic=yes, no_fpic=no)
dnl
dnl Some extra checks.
dnl
AC_CHECK_LIB(posix4, sched_get_priority_min)
AC_HAVE_FUNCS(sigaction sigset getpwuid_r nanosleep strsep strpbrk)
AC_CHECK_HEADERS(byteswap.h malloc.h sys/mman.h)
if test "$GCC" = yes; then
dnl
dnl check cflags not supported by all gcc versions
dnl eg: -mpreferred-stack-boundary=2 and 2.91.66,
dnl and gcc-2.7.2.3 support a bit less options
dnl
AC_TRY_CFLAGS("-mpreferred-stack-boundary=2",
m_psb="-mpreferred-stack-boundary=2", m_psb="")
AC_TRY_CFLAGS("-fno-strict-aliasing", f_nsa="-fno-strict-aliasing", f_nsa="")
AC_TRY_CFLAGS("-fschedule-insns2", f_si="-fschedule-insns2", f_si="")
AC_TRY_CFLAGS("-mwide-multiply", m_wm="-mwide-multiply", m_wm="")
fi
dnl Flags not supported by all *cc* variants
AC_TRY_CFLAGS("-Wall", wall="-Wall", wall="")
dnl Common cflags for all platforms
COMMON_CFLAGS="$wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE"
enable_w32dll="no"
enable_ffmmx="no"
host_or_hostalias="$host"
if test "$host_or_hostalias" = ""; then
dnl user has called ./configure with a host parameter unknown to
dnl config.sub; the canonical "$host" is empty
dnl
dnl Try the following switch with user's original host_alias
dnl input instead.
dnl
host_or_hostalias="$host_alias"
fi
case "$host_or_hostalias" in
i386-*-freebsd*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -pipe -fomit-frame-pointer -malign-functions=4
-malign-loops=4 -malign-jumps=4 -malign-functions=4 $m_wm $m_psb
-fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -finline-functions"
GLOBAL_CFLAGS="$GLOBAL_CFLAGS $CFLAGS"
DEBUG_CFLAGS="$X_CFLAGS $DEBUG_CFLAGS $CFLAGS"
AC_DEFINE(__i386__)
AC_DEFINE([ARCH_X86],,[x86 architecture])
AC_DEFINE(FPM_INTEL)
enable_w32dll="yes"
enable_ffmmx="yes"
no_fpic="yes"
;;
i?86-*-linux* | i386-*-solaris* | i?86-* | k?-* | athlon-*)
if test "$GCC" = yes; then
dnl Check for gcc cpu optimization support
AC_TRY_CFLAGS("-mcpu=i386",
sarchopt="-mcpu",
AC_TRY_CFLAGS("-march=i386",
sarchopt="-march",
[ AC_MSG_RESULT(** no cpu optimization supports **)
sarchopt=no ]))
dnl special check for k7 cpu CC support
AC_TRY_CFLAGS("$sarchopt=athlon", k7cpu="athlon", k7cpu="i686")
dnl add x86 specific gcc CFLAGS
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -pipe -fomit-frame-pointer
-malign-functions=4 -malign-loops=4 -malign-jumps=4 -malign-functions=4 $m_wm $m_psb
-fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -funroll-all-loops
-finline-functions"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"
if test x"$sarchopt" != "xno"; then
[
archopt_val=
case "$host_alias" in
i386-*) # *BSD return this even on a P III #-))
archopt_val=i386 ;;
i486-*) # oh dear!
archopt_val=i486 ;;
i586-*)
archopt_val=pentium ;;
i686-*)
archopt_val=pentiumpro
if test x"$check_athlon" = "xyes"; then
if test -f /proc/cpuinfo; then
modelname=`cat /proc/cpuinfo | grep "model\ name\ :" |
sed -e 's/ //g' | cut -d':' -f2`
case "$modelname" in
*Athlon* | *Duron* | *K7*)
archopt_val="$k7cpu" ;;
esac
fi
fi
;;
k6-*)
archopt_val=k6 ;;
k7-*)
archopt_val=k7 ;;
athlon-*)
archopt_val=athlon ;;
esac
if test x"$archopt_val" != x; then
GLOBAL_CFLAGS="$GLOBAL_CFLAGS $sarchopt=$archopt_val"
DEBUG_CFLAGS="$DEBUG_CFLAGS $sarchopt=$archopt_val"
fi
]
fi
dnl enable x86 specific parts of the code
dnl
dnl all of this stuff needs gcc/gas; it uses gnu c compiler extensions
dnl like the extended asm() or __attribute(__cdecl__), or other direct
dnl mmx/sse/3dnow assembler instructions.
dnl
AC_DEFINE([ARCH_X86],,[x86 architecture])
AC_DEFINE(FPM_INTEL)
enable_w32dll="yes"
enable_ffmmx="yes"
else
dnl add x86 specific cc CFLAGS
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O"
AC_DEFINE(FPM_64BIT)
fi
no_fpic="yes"
AC_DEFINE(__i386__)
;;
alphaev56-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -mcpu=ev56 -mieee"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mcpu=ev56 -mieee"
AC_DEFINE(FPM_64BIT)
;;
alpha*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -mieee"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3 -mieee"
AC_DEFINE(FPM_64BIT)
;;
ppc-*-linux* | powerpc-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 -pipe -fomit-frame-pointer $m_wm $m_psb
-fexpensive-optimizations $f_si $f_nsa -ffast-math -funroll-loops -funroll-all-loops
-finline-functions"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"
AC_DEFINE(FPM_PPC)
AC_DEFINE(ARCH_PPC)
if test x$enable_altivec = xyes; then
AC_DEFINE(ENABLE_ALTIVEC)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -Wa,-m7400"
fi
;;
sparc*-*-linux*)
case $host_alias in
sparc-*) cpu_cflags="-mcpu=supersparc -mtune=supersparc" ;;
sparc64-*) cpu_cflags="-mcpu=supersparc -mtune=ultrasparc" ;;
esac
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3 $cpu_cflags -funroll-loops -funroll-all-loops
-finline-functions"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O $cpu_cflags -funroll-loops -funroll-all-loops
-finline-functions"
AC_DEFINE(FPM_SPARC)
;;
sparc-*-solaris*)
if test "$GCC" = yes; then
case `uname -m` in
sun4c) cpu_cflags="-mcpu=v7 -mtune=supersparc" ;;
sun4m) cpu_cflags="-mcpu=v8 -mtune=supersparc" ;;
sun4u) cpu_cflags="-mcpu=supersparc -mtune=ultrasparc" ;;
*) cpu_cflags= ;;
esac
cc_optimize_cflags="-O3 $cpu_cflags -funroll-loops -funroll-all-loops
-finline-functions"
cc_debug_cflags="-O $cpu_cflags -funroll-loops -funroll-all-loops
-finline-functions"
AC_DEFINE(FPM_SPARC) dnl uses gnu c asm extensions
else
cc_optimize_cflags="-O"
cc_debug_cflags="-O"
AC_DEFINE(FPM_64BIT) dnl use portable version with non-gcc
fi
GLOBAL_CFLAGS="$GLOBAL_CFLAGS $cc_optimize_cflags"
DEBUG_CFLAGS="$DEBUG_CFLAGS $cc_debug_cflags"
;;
mips-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O"
AC_DEFINE(FPM_MIPS)
;;
m68k-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O2"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O"
AC_DEFINE(FPM_DEFAULT)
;;
ia64-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"
AC_DEFINE(FPM_64BIT)
;;
s390-*)
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O3"
AC_DEFINE(FPM_DEFAULT)
;;
*)
echo
echo "****************************** WARNING ******************************"
echo
echo "Host type '$host' ($host_alias) is currently not supported by xine"
echo
echo "Assuming that -O3 makes the compiler produce useful code."
echo
echo "You might experience problems with this, so please report your"
echo "architecture and, if possible, known good optimization flags for"
echo "your compiler to <[EMAIL PROTECTED]>"\!
echo
echo "*********************************************************************"
echo "(sleeping one minute so you can read this...)"
sleep 60
GLOBAL_CFLAGS="$GLOBAL_CFLAGS -O3"
DEBUG_CFLAGS="$DEBUG_CFLAGS -O"
AC_DEFINE(FPM_DEFAULT)
;;
esac
GLOBAL_CFLAGS="$GLOBAL_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS $ARTS_CFLAGS
$IRIXAL_CFLAGS"
DEBUG_CFLAGS="$DEBUG_CFLAGS $COMMON_CFLAGS $ALSA_CFLAGS $ESD_CFLAGS $ARTS_CFLAGS
$IRIXAL_CFLAGS -g -DDEBUG"
AM_CONDITIONAL(HAVE_W32DLL, test x"$enable_w32dll" = "xyes")
if test x"$enable_w32dll" = "xyes"; then
W32DLL_DEP=""
else
W32DLL_DEP="#"
fi
AC_SUBST(W32DLL_DEP)
AM_CONDITIONAL(HAVE_FFMMX, test x"$enable_ffmmx" = "xyes")
dnl
dnl gcc __attribute__ ((aligned ()))
dnl
AC_C_ATTRIBUTE_ALIGNED
dnl
dnl XINE_ROOTDIR does not work if architecture independent files are
dnl installed to another place than architecture dependent files !!!
dnl
if test "x$prefix" = xNONE; then
prefix="${ac_default_prefix}"
fi
if test "x$exec_prefix" = xNONE; then
exec_prefix='${prefix}'
fi
XINE_PLUGINDIR="$libdir/xine/plugins"
eval XINE_PLUGINPATH=`eval echo "$XINE_PLUGINDIR"`
AC_DEFINE_UNQUOTED(XINE_PLUGINDIR,"$XINE_PLUGINPATH")
AC_SUBST(XINE_PLUGINPATH)
XINE_SKINDIR="${datadir}/xine/skins"
eval XINE_SKINPATH="$XINE_SKINDIR"
AC_DEFINE_UNQUOTED(XINE_SKINDIR,"$XINE_SKINPATH")
AC_SUBST(XINE_SKINPATH)
XINE_FONTDIR="${datadir}/xine/fonts"
eval XINE_FONTPATH="$XINE_FONTDIR"
AC_DEFINE_UNQUOTED(XINE_FONTDIR,"$XINE_FONTPATH")
AC_SUBST(XINE_FONTPATH)
AC_SUBST(XINE_PLUGINDIR)
AC_SUBST(XINE_DEMUXDIR)
AC_SUBST(XINE_SKINDIR)
AC_SUBST(XINE_FONTDIR)
UT_LIBS="$(top_srcdir)/xine-utils/.libs/libxineutils.so"
AC_SUBST(UT_LIBS)
dnl Where scripts will/should be installed.
eval XINE_SCRIPTPATH="${datadir}/xine/scripts"
AC_SUBST(XINE_SCRIPTPATH)
dnl Where desktops icons will/should be installed.
eval XINE_DESKTOPPATH="${datadir}/xine/desktop"
AC_SUBST(XINE_DESKTOPPATH)
dnl
dnl Some informations about xine-lib compilation
dnl
XINE_BUILD_CC="`$CC -v 2>&1 | tail -1`"
XINE_BUILD_OS="`uname -s -r -m`"
XINE_BUILD_DATE="`date \"+%a %d %b %Y %T\"`"
AC_SUBST(XINE_BUILD_CC)
AC_SUBST(XINE_BUILD_OS)
AC_SUBST(XINE_BUILD_DATE)
dnl
dnl For win32 libraries location, needed by libw32dll.
dnl
AC_ARG_WITH(w32-path,[ --with-w32-path=path Location of WIN32 libraries],
w32_path="$withval", w32_path="/usr/lib/win32")
AC_SUBST(w32_path)
dnl
dnl Some include paths ( !!! DO NOT REMOVE !!! )
dnl
INCLUDES='-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/src -I$(top_builddir)/src
-I$(top_srcdir)/src/xine-engine -I$(top_builddir)/src/xine-engine
-I$(top_srcdir)/src/xine-utils -I$(top_builddir)/src/xine-utils'
AC_SUBST(INCLUDES)
dnl
dnl Get where .m4 should be installed.
dnl
case "`id`" in
uid=0\(* )
AC_MSG_CHECKING(for aclocal directory)
if (aclocal --version) < /dev/null > /dev/null 2>&1; then
ACLOCAL_DIR="`eval $ACLOCAL --print-ac-dir`"
AC_MSG_RESULT($ACLOCAL_DIR)
else
ACLOCAL_DIR="/usr/local/share/aclocal"
AC_MSG_RESULT(none - will be installed in $ACLOCAL_DIR)
fi
escapedprefix="`echo $prefix | sed -e 's/\\//\\\\\//g'`"
ACLOCAL_DIR="`echo $ACLOCAL_DIR|sed -e 's/^'$escapedprefix/'\${prefix}'/`"
AC_SUBST(ACLOCAL_DIR)
;;
esac
AM_CONDITIONAL(INSTALL_M4, test x"$ACLOCAL_DIR" != "x")
dnl
dnl Check for doxygen (dynamic documentation generator)
dnl
AC_CHECK_PROG(DOXYGEN, doxygen, doxygen, no)
dnl
dnl Output configuration files
dnl
AC_OUTPUT([
Makefile
include/Makefile
include/xine.h.tmpl
src/Makefile
src/audio_out/Makefile
src/video_out/Makefile
src/demuxers/Makefile
src/dxr3/Makefile
src/libmpeg2/Makefile
src/liba52/Makefile
src/libffmpeg/Makefile
src/libffmpeg/libavcodec/Makefile
src/liblpcm/Makefile
src/libdts/Makefile
src/libmad/Makefile
src/libw32dll/Makefile
src/libw32dll/wine/Makefile
src/libw32dll/DirectShow/Makefile
src/libspudec/Makefile
src/libsputext/Makefile
src/libvfill/Makefile
src/libvorbis/Makefile
src/libdivx4/Makefile
src/xine-utils/Makefile
src/input/Makefile
src/xine-engine/Makefile
misc/Makefile
misc/xine-config
m4/Makefile
doc/Makefile
doc/man/Makefile
doc/man/en/Makefile
doc/man/en/man3/Makefile
doc/xine-lib-API/Makefile
doc/xine-lib-API/html/Makefile
misc/xine-lib.spec
misc/guenter.spec
misc/SlackBuild
misc/guenter_rpms.sh
misc/build_rpms.sh
misc/fonts/Makefile],
[chmod +x ./misc/SlackBuild ./misc/build_rpms.sh ./misc/guenter_rpms.sh; rm -f
include/xine.h; echo '/* !! DO NO EDIT THIS FILE, it is automatically generated */' >
include/xine.h && cat include/xine.h.tmpl >> include/xine.h])
dnl
dnl Hack the libtool script (if required).
dnl
dnl If user intentionnaly overrided detection, use wish.
if test x"$enable_fpic" != x; then
case "${enable_fpic}" in
yes)
no_fpic="no"
;;
*)
no_fpic="yes"
;;
esac
fi
if test x$no_fpic = "xyes"; then
cat libtool | sed -e 's/^pic_flag=/#pic_flag=/' > libtool-nofpic
else
cat libtool > libtool-nofpic
fi
chmod +x libtool-nofpic
dnl
dnl Some infos:
dnl
dnl Video plugins
echo "xine-lib summary:"
echo "----------------"
echo " * video driver plugins:"
if test x"$no_x" != "xyes"; then
echo " - XShm (X11 shared memory)"
echo " - SyncFB (for Matrox G200/G400 cards)"
dnl Xv
if test x$ac_have_xv = "xyes"; then
if test x$xv_lib="xlibXv.a"; then
echo " - Xv (XVideo *static*)"
else
echo " - Xv (XVideo *shared*)"
fi
fi
fi
if test x$no_aalib != "xyes"; then
echo " - aa (Ascii ART)"
fi
if test x"$have_dxr3" = "xyes"; then
if test x"$have_encoder" = "xyes"; then
echo " - dxr3 (Hollywood+ and Creative dxr3, both mpeg and non-mpeg video)"
else
echo " - dxr3 (Hollywood+ and Creative dxr3, mpeg video only)"
fi
fi
if test x$no_directfb != "xyes";then
echo " - directfb (For use with video provider"
fi
echo ""
dnl Audio plugins
echo " * audio driver plugins:"
if test x"$have_ossaudio" = "xyes"; then
echo " - oss (Open Sound System)"
fi
if test x"$no_alsa" != "xyes"; then
if test x"$have_alsa05" = "xyes"; then
echo " - alsa05 (Alsa 0.5.x)"
fi
if test x"$have_alsa09" = "xyes"; then
echo " - alsa09 (Alsa 0.9.x)"
fi
fi
if test x"$no_esd" != "xyes"; then
echo " - esd (Enlightened Sound Daemon)"
fi
if test x"$no_arts" != "xyes"; then
echo " - arts ()"
fi
if test x"$have_sunaudio" = "xyes"; then
echo " - sun ()"
fi
if test "x$am_cv_have_irixal" = xyes; then
echo " - irixal (Irix audio library)"
fi
echo ""
dnl Decoders
echo " * decoder plugins:"
echo " - a52 - dts"
echo " - mpeg2 - spu"
echo " - ffmpeg - mad"
echo " - vfill - divx4"
if test x"$no_oggvorbis" = "xno"; then
echo " - vorbis"
fi
if test x"$have_dxr3" = "xyes"; then
echo " - dxr3"
fi
if test x"$enable_w32dll" = "xyes"; then
echo " - w32dll"
fi
echo ""
dnl Demuxers
echo " * demultiplexer plugins:"
echo " - avi - mpeg"
echo " - mpeg_block - mpeg_audio"
echo " - mpeg_elem - mpeg_pes"
echo " - mpeg_ts - qt"
if test x"$enable_asf" = "xyes"; then
echo " - asf"
fi
if test x"$no_oggvorbis" = "xno"; then
echo " - ogg"
fi
echo ""
dnl Input
echo " * input plugins:"
echo " - file - net"
echo " - stdin - rtp"
echo " - http"
if test x"$have_cdrom_ioctls" = "xyes"; then
echo " - dvd - vcd"
echo " - cda"
fi
echo "---"
CFLAGS = @DFB_CFLAGS@ @GLOBAL_CFLAGS@ @X_CFLAGS@ @LIBMPEG2_CFLAGS@ -DXINE_COMPILE
DEBUG_CFLAGS = @DEBUG_CFLAGS@ @X_CFLAGS@ @LIBMPEG2_CFLAGS@ -DXINE_COMPILE
LIBTOOL = $(SHELL) $(top_builddir)/libtool-nofpic
libdir = $(XINE_PLUGINDIR)
if HAVE_X11
xshm_module = xineplug_vo_out_xshm.la
syncfb_module = xineplug_vo_out_syncfb.la
if HAVE_XV
xv_module = xineplug_vo_out_xv.la
endif
endif
if HAVE_AA
aa_module = xineplug_vo_out_aa.la
endif
if HAVE_DIRECTFB
directfb_module = xineplug_vo_out_directfb.la
endif
##
# IMPORTANT:
# ---------
# All of xine video out plugins should be named like the
# scheme "xineplug_vo_out_"
#
lib_LTLIBRARIES = $(xv_module) $(syncfb_module) $(xshm_module) $(aa_module)
$(directfb_module)
xineplug_vo_out_xv_la_SOURCES = deinterlace.c alphablend.c video_out_xv.c
xineplug_vo_out_xv_la_LIBADD = $(XV_LIB) $(X_LIBS) -lXext
xineplug_vo_out_xv_la_LDFLAGS = -avoid-version -module
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
xineplug_vo_out_xshm_la_LDFLAGS = -avoid-version -module
xineplug_vo_out_syncfb_la_SOURCES = alphablend.c video_out_syncfb.c
xineplug_vo_out_syncfb_la_LDFLAGS = -avoid-version -module
xineplug_vo_out_aa_la_SOURCES = video_out_aa.c
xineplug_vo_out_aa_la_LIBADD = $(AALIB_LIBS)
xineplug_vo_out_aa_la_LDFLAGS = -avoid-version -module
xineplug_vo_out_directfb_la_SOURCES = video_out_directfb.c
xineplug_vo_out_directfb_la_LIBADD = $(DFB_LIBS)
xineplug_vo_out_directfb_la_LDFLAGS = -avoid-version -module
noinst_HEADERS = yuv2rgb.h video_out_syncfb.h alphablend.h deinterlace.h
include_HEADERS = video_out_x11.h
debug:
@$(MAKE) CFLAGS="$(DEBUG_CFLAGS) -DXINE_COMPILE"
install-debug: debug
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
###
# Install header files (default=$includedir/xine)
#
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(includedir)/xine
@list='$(include_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/xine/$$p"; \
$(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/xine/$$p; \
done
###
# Remove them
#
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(include_HEADERS)'; for p in $$list; do \
rm -f $(DESTDIR)$(includedir)/xine/$$p; \
done
mostlyclean-generic:
-rm -f *~ \#* .*~ .\#*
maintainer-clean-generic:
-@echo "This command is intended for maintainers to use;"
-@echo "it deletes files that may require special tools to rebuild."
-rm -f Makefile.in
/*
* Copyright (C) 2000-2001 the xine project
*
* This file is part of xine, a unix video player.
*
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* xine is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* $Id: video_out_aa.c,v 1.13 2001/10/03 15:14:03 jkeil Exp $
*
* video_out_aa.c, ascii-art output plugin for xine
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <sys/time.h>
#include <directfb.h>
#include <directfb_internals.h>
#include <misc/util.h>
#include <misc/mem.h>
#include <core/coredefs.h>
#include <core/coretypes.h>
#include <core/state.h>
#include <core/surfaces.h>
#include <display/idirectfbsurface.h>
#include "video_out.h"
#include <xine-engine/xine_internal.h>
#include <xine-utils/xineutils.h>
#include <xine_provider.h>
/*
* global variables
*/
typedef struct directfb_frame_s {
vo_frame_t vo_frame;
int width, height;
uint8_t *mem[3];
int ratio_code;
int format;
} directfb_frame_t;
typedef struct {
vo_driver_t vo_driver;
config_values_t *config;
int user_ratio;
IDirectFBVideoProvider_Xine_data *context;
} directfb_driver_t;
/*
* our video driver
*/
static uint32_t directfb_get_capabilities (vo_driver_t *this) {
return VO_CAP_YUY2 | VO_CAP_RGB;
}
static void *malloc_aligned (size_t alignment, size_t size, void **mem) {
char *aligned;
aligned = malloc (size+alignment);
*mem = aligned;
while ((int) aligned % alignment)
aligned++;
return aligned;
}
static void directfb_dispose_frame (vo_frame_t *vo_img) {
directfb_frame_t *frame = (directfb_frame_t *)vo_img;
if (frame->mem[0])
free (frame->mem[0]);
if (frame->mem[1])
free (frame->mem[1]);
if (frame->mem[2])
free (frame->mem[2]);
free (frame);
}
static void directfb_frame_field (vo_frame_t *vo_img, int which_field) {
/* nothing to be done here */
}
static vo_frame_t *directfb_alloc_frame(vo_driver_t *this) {
directfb_frame_t *frame;
frame = (directfb_frame_t *) malloc (sizeof (directfb_frame_t));
memset (frame, 0, sizeof (directfb_frame_t));
frame->vo_frame.copy = NULL;
frame->vo_frame.field = directfb_frame_field;
frame->vo_frame.dispose = directfb_dispose_frame;
return (vo_frame_t*) frame;
}
static void directfb_update_frame_format (vo_driver_t *this, vo_frame_t *img,
uint32_t width, uint32_t height,
int ratio_code, int format, int flags) {
int image_size;
directfb_frame_t *frame = (directfb_frame_t *) img;
printf ("directfb_update_format...\n");
if ((frame->width != width) || (frame->height != height)
|| (frame->format != format)) {
if (frame->mem[0]) {
free (frame->mem[0]);
frame->mem[0] = NULL;
}
if (frame->mem[1]) {
free (frame->mem[1]);
frame->mem[1] = NULL;
}
if (frame->mem[2]) {
free (frame->mem[2]);
frame->mem[2] = NULL;
}
frame->width = width;
frame->height = height;
frame->format = format;
if (format == IMGFMT_YV12) {
image_size = width * height;
frame->vo_frame.base[0] = malloc_aligned(16,image_size, (void**) &frame->mem[0]);
frame->vo_frame.base[1] = malloc_aligned(16,image_size/4, (void**) &frame->mem[1]);
frame->vo_frame.base[2] = malloc_aligned(16,image_size/4, (void**) &frame->mem[2]);
// printf ("allocated yuv memory for %d x %d image\n", width, height);
} else if (format == IMGFMT_YUY2) {
image_size = width * 2 * height;
frame->vo_frame.base[0] = malloc_aligned(16,image_size, (void**) &frame->mem[0]);
} else {
printf ("alert! unsupported image format %04x\n", format);
exit (1);
}
frame->ratio_code = ratio_code;
}
/* printf ("aa_update_format done\n"); */
}
static void directfb_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) {
int x,y, pitch;
double x_fact, y_fact; /* ratio between aa's and frame's width/height */
uint16_t *img;
uint8_t *src_y;
uint8_t *src_u;
uint8_t *src_v;
IDirectFBVideoProvider_Xine_data *data;
directfb_driver_t *this = (directfb_driver_t*) this_gen;
directfb_frame_t *frame = (directfb_frame_t *) frame_gen;
data = (IDirectFBVideoProvider_Xine_data *) this->context;
x_fact = (double) frame->width / (double) data->width;
y_fact = (double) frame->height / (double) data->height;
src_y = frame->vo_frame.base[0];
src_u = frame->vo_frame.base[1];
src_v = frame->vo_frame.base[2];
surface_soft_lock (data->dstsurface, DSLF_WRITE, &img, &pitch, 0);
if (frame->format == IMGFMT_YV12)
{
for (y = 0; y<data->height; y++)
{
for (x = 0; x<data->width; x++)
{
/* int pos1 = ((int)((double) x * x_fact) +
frame->width * (int)((double) y * y_fact));
int pos2 = ((int)((double) x * x_fact/2.0) +
frame->width/2 * (int)((double) y * y_fact/2.0));*/
if (x & 1)
img[x] = (src_v[x/2] << 8) | src_y[x];
else
img[x] = (src_u[x/2] << 8) | src_y[x];
}
img += pitch/2;
src_y += frame->width;
if (y & 1)
{
src_u += frame->width/2;
src_v += frame->width/2;
}
}
}
else
{
for (y = 0; y<data->height; y++)
{
for (x = 0; x<data->width; x++)
{
img[x] = src_y[((int)((double) x * x_fact) +
frame->width * (int)((double) y * y_fact))];
}
img += pitch/2;
}
}
surface_unlock (data->dstsurface, 0);
frame->vo_frame.displayed (&frame->vo_frame);
/*
aa_fastrender(this->context, 0, 0,
directfb_imgwidth (this->context),
directfb_imgheight (this->context));
aa_flush (this->context);
*/
}
static int directfb_get_property (vo_driver_t *this_gen, int property) {
directfb_driver_t *this = (directfb_driver_t*) this_gen;
if ( property == VO_PROP_ASPECT_RATIO) {
return this->user_ratio ;
} else {
printf ("video_out_xshm: tried to get unsupported property %d\n", property);
}
return 0;
}
static int directfb_set_property (vo_driver_t *this_gen,
int property, int value) {
directfb_driver_t *this = (directfb_driver_t*) this_gen;
if ( property == VO_PROP_ASPECT_RATIO) {
if (value>=NUM_ASPECT_RATIOS)
value = ASPECT_AUTO;
this->user_ratio = value;
} else {
printf ("video_out_xshm: tried to set unsupported property %d\n", property);
}
return value;
}
static void directfb_get_property_min_max (vo_driver_t *this_gen,
int property, int *min, int *max) {
*min = 0;
*max = 0;
}
static void directfb_exit (vo_driver_t *this_gen) {
}
vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) {
directfb_driver_t *this;
IDirectFBVideoProvider_Xine_data *b;
this = (directfb_driver_t*) xine_xmalloc (sizeof (directfb_driver_t));
//this->context = (IDirectFBVideoProvider_Xine_data *) visual_gen;
//printf("dcontext: %i\n", this->context->d);
b = (IDirectFBVideoProvider_Xine_data *) visual_gen;
printf("dataype: %i (%p)\n", b->d, b);
this->config = config;
this->context = b;
this->vo_driver.get_capabilities = directfb_get_capabilities;
this->vo_driver.alloc_frame = directfb_alloc_frame ;
this->vo_driver.update_frame_format = directfb_update_frame_format;
this->vo_driver.display_frame = directfb_display_frame;
this->vo_driver.get_property = directfb_get_property;
this->vo_driver.set_property = directfb_set_property;
this->vo_driver.get_property_min_max = directfb_get_property_min_max;
this->vo_driver.gui_data_exchange = NULL;
this->vo_driver.exit = directfb_exit;
return (vo_driver_t*) this;
}
static vo_info_t vo_info_directfb = {
2,
"directfb",
"xine video output plugin using the DirectFB library",
VISUAL_TYPE_DIRECTFB,
10
};
vo_info_t *get_video_out_plugin_info() {
return &vo_info_directfb;
}