1
mirror of https://github.com/mpv-player/mpv synced 2024-11-07 01:47:00 +01:00

FreeBSD patch by Vladimir Kushnir <vkushnir@Alfacom.net>

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1178 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi_esp 2001-06-21 00:06:40 +00:00
parent 8238dfaadb
commit 83e2caa277
7 changed files with 116 additions and 1328 deletions

View File

@ -4,12 +4,13 @@ Notes for FreeBSD users
1. To build the package you will need GNU make (gmake, /usr/ports/devel/gmake), 1. To build the package you will need GNU make (gmake, /usr/ports/devel/gmake),
native BSD make will not work. native BSD make will not work.
2. Configure script is different for FreeBSD; use configure.FreeBSD instead. 2. To run mplayer you will need to re-compile the kernel with
3. To run mplayer you will need to re-compile the kernel with
"options USER_LDT" (unless you are running -CURRENT, where this is default). "options USER_LDT" (unless you are running -CURRENT, where this is default).
4. There's no VCD (well, it is not finished) or DVD support for FreeBSD yet. 3. If mplayer complains about "CD-ROM Device '/dev/cdrom' not found!" make a
symbolic link : ln -s /dev/<your_cdrom_device> /dev/cdrom
4. There's no DVD support for FreeBSD yet.
Feel free to add them :-) Feel free to add them :-)
Enjoy (as do I)! Enjoy (as do I)!

95
configure vendored
View File

@ -142,13 +142,18 @@ params:
--disable-fastmemcpy disable 3dnow/sse/mmx optimized memcpy() --disable-fastmemcpy disable 3dnow/sse/mmx optimized memcpy()
--with-x11libdir=DIR X library files are in DIR --with-x11libdir=DIR X library files are in DIR
--with-x11incdir=DIR X headerss are in DIR
(only needed if autodetection fails)
--with-win32libdir=DIR windows codec files --with-win32libdir=DIR windows codec files
--with-csslibdir=DIR directory contains libcss.so shared library --with-csslibdir=DIR directory contains libcss.so shared library
--with-cssincdir=DIR directory contains libcss header file (css.h) --with-cssincdir=DIR directory contains libcss header file (css.h)
(--with-css* only needed, if libCSS autodetect fails) (--with-css* only needed, if libCSS autodetect fails)
--with-sdl-config=PATH specify location of sdl-config if it's not in your PATH --with-sdl-config=PATH specify location of sdl-config if it's not in your PATH
(example: --with-sdl-config=/usr/sdl/bin/sdl-config) (example: --with-sdl-config=/usr/sdl/bin/sdl-config)
--with-extralibdir=DIR extra library files (png, SDL) are in DIR
(only needed if autodetection fails)
--with-extraincdir=DIR extra headers (png, SDL) are in DIR
(only needed if autodetection fails)
--size-x=SIZE default screen width --size-x=SIZE default screen width
--size-y=SIZE default screen height --size-y=SIZE default screen height
EOF EOF
@ -160,6 +165,15 @@ fi
echo "You can get detailed help on configure with: $0 --help" echo "You can get detailed help on configure with: $0 --help"
echo "Please wait while ./configure discovers your software and hardware environment!" echo "Please wait while ./configure discovers your software and hardware environment!"
# Determine our OS name and OS dependent libs
system_name=`uname -s 2>&1`
if [ "$system_name" = "FreeBSD" ]; then
_archlibs="-rdynamic -pthread"
else
_archlibs="-ldl -lpthread"
fi
# LGB: temporary files # LGB: temporary files
TMPC="mplayer-conf-${RANDOM}-$$-${RANDOM}.c" TMPC="mplayer-conf-${RANDOM}-$$-${RANDOM}.c"
@ -201,9 +215,27 @@ else
fi fi
fi fi
_x11incdir=
if [ -d /usr/include/X11 ]; then
_x11incdir=
elif [ -d /usr/X11R6 ]; then
_x11incdir=-I/usr/X11R6/include
elif [ -d /usr/X11 ]; then
_x11incdir=-I/usr/X11/include
fi
# Lots of stuff are installed under /usr/local
_extralibdir=-L/usr/local/lib
_extraincdir=-I/usr/local/include
_skip_cc_check=no _skip_cc_check=no
_skip_as_check=no _skip_as_check=no
if [ "$system_name" = "FreeBSD" ]; then
_sdlconfig='sdl11-config'
else
_sdlconfig='sdl-config' _sdlconfig='sdl-config'
fi
for ac_option for ac_option
do do
@ -223,6 +255,9 @@ do
--with-x11libdir=*) --with-x11libdir=*)
_x11libdir=-L`echo $ac_option | cut -d '=' -f 2` _x11libdir=-L`echo $ac_option | cut -d '=' -f 2`
;; ;;
--with-x11incdir=*)
_x11incdir=-I`echo $ac_option | cut -d '=' -f 2`
;;
--enable-x11) --enable-x11)
_x11=yes _x11=yes
;; ;;
@ -232,6 +267,12 @@ do
--with-sdl-config=*) --with-sdl-config=*)
_sdlconfig=`echo $ac_option | cut -d '=' -f 2` _sdlconfig=`echo $ac_option | cut -d '=' -f 2`
;; ;;
--with-extralibdir=*)
_extralibdir=-L`echo $ac_option | cut -d '=' -f 2`
;;
--with-extraincdir=*)
_extraincdir=-I`echo $ac_option | cut -d '=' -f 2`
;;
esac esac
done done
@ -265,6 +306,10 @@ fi
if [ -r /proc/cpuinfo ]; then if [ -r /proc/cpuinfo ]; then
# linux with /proc mounted, extract cpu information from it # linux with /proc mounted, extract cpu information from it
_cpuinfo="cat /proc/cpuinfo" _cpuinfo="cat /proc/cpuinfo"
elif [ -r /compat/linux/proc/cpuinfo ]; then
# FreeBSD with linux emulation /proc mounted,
# extract cpu information from it
_cpuinfo="cat /compat/linux/proc/cpuinfo"
else else
# all other OS try to extract cpu information from a small helper # all other OS try to extract cpu information from a small helper
# program TOOLS/cpuinfo instead # program TOOLS/cpuinfo instead
@ -523,10 +568,15 @@ fi
#echo "DONE (${proc})." #echo "DONE (${proc})."
$_cc $TMPC -o $TMPO -lvgagl -lvga > /dev/null 2>&1 && _svga=yes $_cc $_extraincdir $_extralibdir $TMPC -o $TMPO -lvgagl -lvga > /dev/null 2>&1 && _svga=yes
if [ "$system_name" = "FreeBSD" ]; then
$_cc $TMPC -o $TMPO -pthread > /dev/null 2>&1 || \
{ echo "Lib pthread not found."; rm -f $TMPC $TMPO $TMPS ; exit 1; }
else
$_cc $TMPC -o $TMPO -lpthread > /dev/null 2>&1 || \ $_cc $TMPC -o $TMPO -lpthread > /dev/null 2>&1 || \
{ echo "Lib pthread not found."; rm -f $TMPC $TMPO $TMPS ; exit 1; } { echo "Lib pthread not found."; rm -f $TMPC $TMPO $TMPS ; exit 1; }
fi
# Atmosfear: added SDL versioncheck and autodetect; removed warnings. # Atmosfear: added SDL versioncheck and autodetect; removed warnings.
_sdl=no _sdl=no
@ -569,7 +619,7 @@ _termcap=no
$_cc $TMPC -o $TMPO -ltermcap > /dev/null 2>&1 && _termcap=yes $_cc $TMPC -o $TMPO -ltermcap > /dev/null 2>&1 && _termcap=yes
_png=no _png=no
$_cc $TMPC -o $TMPO -lpng -lz -lm > /dev/null 2>&1 && _png=yes $_cc $_extraincdir $_extralibdir $TMPC -o $TMPO -lpng -lz -lm > /dev/null 2>&1 && _png=yes
_ggi=no _ggi=no
$_cc $TMPC -o $TMPO -lggi > /dev/null 2>&1 && _ggi=yes $_cc $TMPC -o $TMPO -lggi > /dev/null 2>&1 && _ggi=yes
@ -598,14 +648,23 @@ $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXdpms $_socklib > /dev/null 2>&1
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXv $_socklib > /dev/null 2>&1 && _xv=yes $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXv $_socklib > /dev/null 2>&1 && _xv=yes
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXxf86vm $_socklib > /dev/null 2>&1 && _vm=yes $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXxf86vm $_socklib > /dev/null 2>&1 && _vm=yes
if [ "$system_name" = "FreeBSD" ]; then
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL -pthread $_socklib > /dev/null 2>&1 && _gl=yes
else
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL $_socklib > /dev/null 2>&1 && _gl=yes $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL $_socklib > /dev/null 2>&1 && _gl=yes
fi
cat > $TMPC << EOF cat > $TMPC << EOF
#include <GL/gl.h> #include <GL/gl.h>
int main( void ) { return 0; } int main( void ) { return 0; }
EOF EOF
if [ "$system_name" = "FreeBSD" ]; then
$_cc $_x11incdir $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL -pthread $_socklib > /dev/null 2>&1 || \
{ _gl=no; echo "GL includes not found!";}
else
$_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL $_socklib > /dev/null 2>&1 || \ $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL $_socklib > /dev/null 2>&1 || \
{ _gl=no; echo "GL includes not found!";} { _gl=no; echo "GL includes not found!";}
fi
cat > $TMPC << EOF cat > $TMPC << EOF
#include <stdio.h> #include <stdio.h>
@ -614,7 +673,7 @@ cat > $TMPC << EOF
int main (void) { return 0;} int main (void) { return 0;}
EOF EOF
$_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib > /dev/null 2>&1 && _dga=yes $_cc -I/usr/X11R6/unclude $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib > /dev/null 2>&1 && _dga=yes
# Note: the -lXxf86vm library is the VideoMode extension and though it's # Note: the -lXxf86vm library is the VideoMode extension and though it's
# not needed for DGA, AFAIK every distribution packages together with DGA # not needed for DGA, AFAIK every distribution packages together with DGA
# stuffs named 'X extensions' or something similar. This check can be usefull # stuffs named 'X extensions' or something similar. This check can be usefull
@ -630,7 +689,7 @@ int main (void) { XDGAMode mode; XDGADevice device; return 0;}
EOF EOF
_dga2=no _dga2=no
$_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib > /dev/null 2>&1 && _dga2=yes $_cc $_x11incdir $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib > /dev/null 2>&1 && _dga2=yes
fi fi
@ -699,7 +758,7 @@ cat > $TMPC << EOF
int main( void ){ return 0; } int main( void ){ return 0; }
EOF EOF
$_cc -o $TMPO -lesd $TMPC 2> /dev/null || { _esd=no; } $_cc $_extraincdir $_extralibdir -o $TMPO -lesd $TMPC 2> /dev/null || { _esd=no; }
# --- # ---
@ -920,6 +979,12 @@ do
;; ;;
--with-x11libdir=*) --with-x11libdir=*)
;; ;;
--with-x11incdir=*)
;;
--with-extralibdir=*)
;;
--with-extraincdir=*)
;;
--prefix=*) --prefix=*)
_prefix=`echo $ac_option | cut -d '=' -f 2` _prefix=`echo $ac_option | cut -d '=' -f 2`
;; ;;
@ -1001,7 +1066,7 @@ fi
# Checking kernel version... # Checking kernel version...
_k_verc_problem=no _k_verc_problem=no
system_name=`uname -s 2>&1` if [ "$system_name" != "FreeBSD" ];then
kernel_version=`uname -r 2>&1` kernel_version=`uname -r 2>&1`
echo $_echo_n "Checking $system_name kernel version ... $_echo_c" echo $_echo_n "Checking $system_name kernel version ... $_echo_c"
case $kernel_version in case $kernel_version in
@ -1018,6 +1083,7 @@ echo "WARNING! You want to run mplayer on this system then be prepared for probl
else else
echo "$kernel_version, ok" echo "$kernel_version, ok"
fi fi
fi
if [ $_x11 = 'yes' ]; then if [ $_x11 = 'yes' ]; then
if [ $_mga = 'yes' ]; then if [ $_mga = 'yes' ]; then
@ -1067,7 +1133,16 @@ if [ $_streaming = yes ]; then
fi fi
if [ $_gl = yes ]; then if [ $_gl = yes ]; then
if [ "$system_name" = "FreeBSD" ]; then
# Under XFree86 4.x GL port is poorly designed
if [ -r /usr/X11R6/bin/XFree86 ]; then
_gllib='-lGL -pthread'
else
_gllib='-lGL' _gllib='-lGL'
fi
else
_gllib='-lGL'
fi
fi fi
if [ $_css = yes ]; then if [ $_css = yes ]; then
@ -1219,9 +1294,9 @@ AR=ar
CC=$_cc CC=$_cc
X11DIR=$_x11libdir X11DIR=$_x11libdir
# OPTFLAGS=-O4 $_profile $_debug -march=$proc -mcpu=$proc -pipe -fomit-frame-pointer -ffast-math # OPTFLAGS=-O4 $_profile $_debug -march=$proc -mcpu=$proc -pipe -fomit-frame-pointer -ffast-math
OPTFLAGS=$CFLAGS OPTFLAGS=$CFLAGS $_x11incdir $_extraincdir
# LIBS=-L/usr/lib -L/usr/local/lib $_x11libdir $_gllib $_sdllib $_ggilib $_dgalib $_x11lib $_xvlib # LIBS=-L/usr/lib -L/usr/local/lib $_x11libdir $_gllib $_sdllib $_ggilib $_dgalib $_x11lib $_xvlib
X_LIBS=$_x11libdir $_gllib $_sdllib $_ggilib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib X_LIBS=$_x11libdir $_extralibdir $_gllib $_sdllib $_ggilib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib
TERMCAP_LIB=$_libtermcap TERMCAP_LIB=$_libtermcap
XMM_LIBS = $_xmmplibs XMM_LIBS = $_xmmplibs
LIRC_LIBS = $_lirclibs LIRC_LIBS = $_lirclibs
@ -1235,7 +1310,7 @@ DS_LIB = $_dshowlib
ALSA_LIB = $_alsalib ALSA_LIB = $_alsalib
ESD_LIB = $_esdlib ESD_LIB = $_esdlib
prefix = $_prefix prefix = $_prefix
ARCH_LIBS = -ldl -lpthread ARCH_LIBS = $_archlibs
STREAM_SRCS = $_streamingsrcs STREAM_SRCS = $_streamingsrcs
EOF EOF

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
# include <dvd.h> # include <dvd.h>
# undef OLD_CSS_API # undef OLD_CSS_API
#else #else
# if defined(__NetBSD__) || defined(__OpenBSD__) # if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
# include <sys/dvdio.h> # include <sys/dvdio.h>
# elif defined(__linux__) # elif defined(__linux__)
# include <linux/cdrom.h> # include <linux/cdrom.h>

View File

@ -22,6 +22,9 @@
#if defined(sun) #if defined(sun)
#define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0" #define DEFAULT_CDROM_DEVICE "/vol/dev/aliases/cdrom0"
#elif defined(__FreeBSD__)
#define DEFAULT_CDROM_DEVICE "/dev/cdrom"
#include <sys/cdrio.h>
#else #else
#define DEFAULT_CDROM_DEVICE "/dev/cdrom" #define DEFAULT_CDROM_DEVICE "/dev/cdrom"
#endif #endif
@ -491,6 +494,9 @@ float initial_pts_delay=0;
#ifdef VCD_CACHE #ifdef VCD_CACHE
int vcd_cache_size=128; int vcd_cache_size=128;
#endif #endif
#ifdef __FreeBSD__
int bsize = VCD_SECTOR_SIZE;
#endif
char* title="MPlayer"; char* title="MPlayer";
// movie info: // movie info:
@ -630,6 +636,11 @@ if(vcd_track){
if(verbose) printf("VCD start byte position: 0x%X end: 0x%X\n",seek_to_byte,ret2); if(verbose) printf("VCD start byte position: 0x%X end: 0x%X\n",seek_to_byte,ret2);
#ifdef VCD_CACHE #ifdef VCD_CACHE
vcd_cache_init(vcd_cache_size); vcd_cache_init(vcd_cache_size);
#endif
#ifdef __FreeBSD__
if (ioctl (f, CDRIOCSETBLOCKSIZE, &bsize) == -1) {
perror ( "Error in CDRIOCSETBLOCKSIZE");
}
#endif #endif
stream=new_stream(f,STREAMTYPE_VCD); stream=new_stream(f,STREAMTYPE_VCD);
stream->start_pos=ret; stream->start_pos=ret;

View File

@ -10,7 +10,6 @@
extern int verbose; // defined in mplayer.c extern int verbose; // defined in mplayer.c
#ifdef __FreeBSD__ #ifdef __FreeBSD__
#warning "VCD support under FreeBSD not implemented yet"
#include "vcd_read_fbsd.c" #include "vcd_read_fbsd.c"
#else #else
#include "vcd_read.c" #include "vcd_read.c"

View File

@ -5,11 +5,12 @@
#define CDROM_LEADOUT 0xAA #define CDROM_LEADOUT 0xAA
typedef struct { typedef struct {
unsigned char unused; uint8_t sync [12];
unsigned char minute; uint8_t header [4];
unsigned char second; uint8_t subheader [8];
unsigned char frame; uint8_t data [2324];
} cdrom_msf; uint8_t spare [4];
} cdsector_t;
static struct ioc_read_toc_single_entry vcd_entry; static struct ioc_read_toc_single_entry vcd_entry;
@ -76,13 +77,14 @@ void vcd_read_toc(int fd){
} }
} }
static char vcd_buf[VCD_SECTOR_SIZE]; static cdsector_t vcd_buf;
static int vcd_read(int fd,char *mem){ static int vcd_read(int fd,char *mem){
memcpy(vcd_buf,&vcd_entry.entry.addr.msf,sizeof(cdrom_msf)); off_t offset = 0;
/* if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; */ // EOF? if (pread(fd,&vcd_buf,VCD_SECTOR_SIZE,vcd_get_msf()*VCD_SECTOR_SIZE)
/* if(ioctl(fd,CDRIOCSETBLOCKSIZE,VCD_SECTOR_SIZE)==-1) return 0; != VCD_SECTOR_SIZE) return 0; // EOF?
if (pread(fd,vcd_buf,VCD_SECTOR_SIZE,ntohl(vcd_entry.entry.addr.lba)*VCD_SECTOR_SIZE) != VCD_SECTOR_SIZE) return 0; */ // EOF? offset++;
vcd_entry.entry.addr.msf.frame++; vcd_entry.entry.addr.msf.frame++;
if (vcd_entry.entry.addr.msf.frame==75){ if (vcd_entry.entry.addr.msf.frame==75){
vcd_entry.entry.addr.msf.frame=0; vcd_entry.entry.addr.msf.frame=0;
@ -92,8 +94,7 @@ static int vcd_read(int fd,char *mem){
vcd_entry.entry.addr.msf.minute++; vcd_entry.entry.addr.msf.minute++;
} }
} }
memcpy(mem,vcd_buf.data,VCD_SECTOR_DATA);
memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
return VCD_SECTOR_DATA; return VCD_SECTOR_DATA;
} }