diff -Naurd main/CVS/Entries main-patch/CVS/Entries --- main/CVS/Entries Thu Nov 1 23:21:54 2001 +++ main-patch/CVS/Entries Thu Jan 1 01:00:00 1970 @@ -1,60 +0,0 @@ -/.cvsignore/1.3/Mon Apr 23 00:49:42 2001// -/Makefile/1.92/Thu Nov 1 16:10:07 2001// -/ac3-iec958.c/1.1/Wed Aug 15 11:46:13 2001// -/ac3-iec958.h/1.1/Wed Aug 15 11:46:13 2001// -/alaw.h/1.1/Fri May 25 18:26:01 2001// -/bswap.h/1.2/Mon Jul 30 09:08:23 2001// -/cfg-mplayer-def.h/1.2/Mon Mar 19 03:45:49 2001// -/cfg-mplayer.h/1.97/Tue Oct 30 17:04:59 2001// -/cfgparser.c/1.28/Mon Oct 22 20:22:25 2001// -/cfgparser.h/1.7/Wed Aug 22 19:29:47 2001// -/codec-cfg.c/1.44/Tue Oct 23 14:01:13 2001// -/codec-cfg.h/1.22/Tue Oct 23 14:01:13 2001// -/configure/1.217/Wed Oct 31 18:25:28 2001// -/cpudetect.c/1.10/Tue Oct 23 13:02:44 2001// -/cpudetect.h/1.5/Sat Oct 20 11:16:47 2001// -/cputable.h/1.2/Sat Oct 20 11:14:57 2001// -/dec_audio.c/1.51/Tue Oct 30 17:38:09 2001// -/dec_audio.h/1.1/Tue Oct 30 17:04:59 2001// -/dec_video.c/1.56/Tue Oct 30 20:35:25 2001// -/dec_video.h/1.2/Tue Oct 30 17:38:09 2001// -/dll_init.c/1.30/Fri Oct 5 00:08:58 2001// -/dll_init.h/1.2/Fri Oct 5 00:08:58 2001// -/fibmap_mplayer.c/1.2/Wed Sep 26 21:35:14 2001// -/fifo.c/1.1/Fri Mar 16 00:06:50 2001// -/find_sub.c/1.3/Mon Jul 30 02:00:54 2001// -/get_path.c/1.1/Tue Oct 30 17:04:59 2001// -/help_mp-cz.h/1.3/Mon Oct 1 09:51:47 2001// -/help_mp-de.h/1.14/Fri Oct 19 14:09:16 2001// -/help_mp-dk.h/1.1/Fri Sep 28 18:32:22 2001// -/help_mp-en.h/1.10/Thu Oct 11 12:22:18 2001/-kb/ -/help_mp-fr.h/1.2/Thu Oct 11 12:22:18 2001// -/help_mp-hu.h/1.14/Fri Sep 28 18:32:22 2001// -/help_mp-nl.h/1.2/Mon Oct 1 09:54:13 2001// -/help_mp-no.h/1.1/Sat Sep 29 20:34:52 2001// -/help_mp-pl.h/1.11/Thu Oct 11 16:12:31 2001// -/help_mp-ro.h/1.1/Sat Oct 6 10:50:46 2001// -/help_mp-ru.h/1.2/Fri Oct 26 10:42:33 2001// -/ima4.c/1.2/Tue Oct 23 13:56:44 2001// -/ima4.h/1.2/Tue Oct 23 13:56:44 2001// -/lirc_mp.c/1.11/Sun Oct 7 17:19:22 2001// -/lirc_mp.h/1.1.1.1/Sat Feb 24 20:28:35 2001// -/mencoder.c/1.10/Thu Nov 1 21:47:28 2001// -/mixer.c/1.9/Tue Sep 11 16:26:41 2001// -/mixer.h/1.2/Tue Jun 5 18:40:44 2001// -/mmx.h/1.1/Sun Oct 28 11:47:21 2001// -/mmx_defs.h/1.2/Tue Oct 30 16:16:49 2001// -/mp_msg.c/1.6/Wed Sep 26 18:40:57 2001// -/mp_msg.h/1.7/Mon Oct 22 15:40:07 2001// -/mplayer.c/1.310/Tue Oct 30 20:35:26 2001// -/mplayer.h/1.3/Mon Jun 4 18:41:34 2001// -/spudec.c/1.3/Mon Apr 30 02:26:18 2001// -/spudec.h/1.2/Sat Apr 21 17:31:32 2001// -/subreader.c/1.34/Fri Oct 26 22:14:19 2001// -/subreader.h/1.8/Tue Oct 2 21:45:41 2001// -/tvision.c/1.1.1.1/Sat Feb 24 20:28:40 2001// -/version.sh/1.4/Wed Aug 22 16:17:08 2001// -/videodev.h/1.1.1.1/Sat Feb 24 20:28:43 2001// -/xacodec.c/1.21/Fri Oct 26 14:19:42 2001// -/xacodec.h/1.3/Tue Oct 30 17:38:09 2001// -D diff -Naurd main/CVS/Entries.Log main-patch/CVS/Entries.Log --- main/CVS/Entries.Log Thu Nov 1 23:22:56 2001 +++ main-patch/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,21 +0,0 @@ -A D/DOCS//// -A D/Gui//// -A D/TOOLS//// -A D/TVout//// -A D/debian//// -A D/drivers//// -A D/encore//// -A D/etc//// -A D/libac3//// -A D/libao2//// -A D/libavcodec//// -A D/libmpdemux//// -A D/libmpeg2//// -A D/libvo//// -A D/libvo2//// -A D/linux//// -A D/loader//// -A D/mp3lib//// -A D/opendivx//// -A D/postproc//// -A D/xa//// diff -Naurd main/CVS/Repository main-patch/CVS/Repository --- main/CVS/Repository Thu Nov 1 23:21:45 2001 +++ main-patch/CVS/Repository Thu Jan 1 01:00:00 1970 @@ -1 +0,0 @@ -main diff -Naurd main/CVS/Root main-patch/CVS/Root --- main/CVS/Root Thu Nov 1 23:21:45 2001 +++ main-patch/CVS/Root Thu Jan 1 01:00:00 1970 @@ -1 +0,0 @@ -:pserver:anonymous@mplayerhq.hu:/cvsroot/mplayer diff -Naurd main/DOCS/CVS/Entries main-patch/DOCS/CVS/Entries --- main/DOCS/CVS/Entries Thu Nov 1 23:21:57 2001 +++ main-patch/DOCS/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -11,4 +11,10 @@ /skin-en.html/1.1/Thu Sep 27 12:56:01 2001// /sound.html/1.12/Tue Oct 30 17:07:59 2001// /video.html/1.30/Thu Nov 1 17:13:10 2001// -D +D/French//// +D/German//// +D/Hungarian//// +D/Polish//// +D/Russian//// +D/Spanish//// +D/tech//// diff -Naurd main/DOCS/CVS/Entries.Log main-patch/DOCS/CVS/Entries.Log --- main/DOCS/CVS/Entries.Log Thu Nov 1 23:22:12 2001 +++ main-patch/DOCS/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,7 +0,0 @@ -A D/French//// -A D/German//// -A D/Hungarian//// -A D/Polish//// -A D/Russian//// -A D/Spanish//// -A D/tech//// diff -Naurd main/DOCS/Polish/CVS/Entries main-patch/DOCS/Polish/CVS/Entries --- main/DOCS/Polish/CVS/Entries Thu Nov 1 23:22:10 2001 +++ main-patch/DOCS/Polish/CVS/Entries Thu Nov 1 22:13:51 2001 @@ -3,7 +3,7 @@ /CDROM/1.1/Mon Jul 16 17:00:33 2001// /CODECS/1.1/Mon Jul 16 17:00:33 2001// /Debian/1.1/Fri Jun 29 08:48:47 2001// -/FreeBSD/1.2/Thu Nov 1 21:42:37 2001// +/FreeBSD/1.1/Fri Jun 29 08:48:47 2001// /INSTALL/1.1/Mon Jul 16 17:00:33 2001// /LIRC/1.1/Mon Jul 16 17:00:33 2001// /MTRR/1.1/Mon Jul 16 17:00:33 2001// diff -Naurd main/DOCS/Polish/FreeBSD main-patch/DOCS/Polish/FreeBSD --- main/DOCS/Polish/FreeBSD Thu Nov 1 22:42:37 2001 +++ main-patch/DOCS/Polish/FreeBSD Fri Jun 29 10:48:47 2001 @@ -5,9 +5,7 @@ Rodzime BSD make nie zadziała właściwie. 2 . Aby uruchomić mplayera będziesz potrzebował przekompilować jądro z opcją -" options USER_LDT " ( chyba że ujeżdzasz -CURRENT, gdzie opcja ta jest domyślną ). -Jeśli masz procesor z SSE, pamiętaj o dodaniu "options CPU_ENABLE_SSE", by z nich skorzystać. -(Wymagane FreeBSD STABLE, albo patche na kernel) +" options USER_LDT " ( chyba że ujeżdzasz -CURRENT, gdzie opcja ta jest domyślną ) 3 . Jeżeli mplayer narzeka "CD-ROM Device '/dev/cdrom/' not found!" zrób symboliczne dowiązanie: ln -s /dev/ /dev/cdrom diff -Naurd main/Gui/CVS/Entries main-patch/Gui/CVS/Entries --- main/Gui/CVS/Entries Thu Nov 1 23:22:13 2001 +++ main-patch/Gui/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -10,4 +10,7 @@ /language.h/1.2/Wed Sep 12 15:08:52 2001// /timer.c/1.1/Sat Aug 25 21:04:26 2001// /timer.h/1.2/Thu Oct 4 18:27:56 2001// -D +D/bitmap//// +D/mplayer//// +D/skin//// +D/wm//// diff -Naurd main/Gui/CVS/Entries.Log main-patch/Gui/CVS/Entries.Log --- main/Gui/CVS/Entries.Log Thu Nov 1 23:22:17 2001 +++ main-patch/Gui/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,4 +0,0 @@ -A D/bitmap//// -A D/mplayer//// -A D/skin//// -A D/wm//// diff -Naurd main/Gui/bitmap/CVS/Entries main-patch/Gui/bitmap/CVS/Entries --- main/Gui/bitmap/CVS/Entries Thu Nov 1 23:22:13 2001 +++ main-patch/Gui/bitmap/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -2,4 +2,6 @@ /bitmap.c/1.2/Thu Oct 4 18:29:42 2001// /bitmap.h/1.2/Thu Sep 27 17:40:42 2001// /bitmap.mak/1.1/Sat Aug 25 21:04:27 2001// -D +D/bmp//// +D/png//// +D/tga//// diff -Naurd main/Gui/bitmap/CVS/Entries.Log main-patch/Gui/bitmap/CVS/Entries.Log --- main/Gui/bitmap/CVS/Entries.Log Thu Nov 1 23:22:13 2001 +++ main-patch/Gui/bitmap/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,3 +0,0 @@ -A D/bmp//// -A D/png//// -A D/tga//// diff -Naurd main/Gui/mplayer/CVS/Entries main-patch/Gui/mplayer/CVS/Entries --- main/Gui/mplayer/CVS/Entries Thu Nov 1 23:22:13 2001 +++ main-patch/Gui/mplayer/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -10,4 +10,5 @@ /sw.h/1.17/Tue Oct 2 15:01:36 2001// /widgets.c/1.10/Thu Sep 20 10:27:24 2001// /widgets.h/1.6/Thu Sep 20 10:27:24 2001// -D +D/gtk//// +D/pixmaps//// diff -Naurd main/Gui/mplayer/CVS/Entries.Log main-patch/Gui/mplayer/CVS/Entries.Log --- main/Gui/mplayer/CVS/Entries.Log Thu Nov 1 23:22:14 2001 +++ main-patch/Gui/mplayer/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,2 +0,0 @@ -A D/gtk//// -A D/pixmaps//// diff -Naurd main/TOOLS/CVS/Entries main-patch/TOOLS/CVS/Entries --- main/TOOLS/CVS/Entries Thu Nov 1 23:22:18 2001 +++ main-patch/TOOLS/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -19,4 +19,8 @@ /perlbench.pl/1.1/Sun Apr 22 16:09:23 2001// /png2raw.c/1.2/Mon Jun 11 12:47:38 2001// /x2mpsub.sh/1.1/Wed Oct 17 18:07:40 2001// -D +D/GL-test//// +D/benchmark//// +D/mpfc//// +D/subfont-c//// +D/subfont-gimp//// diff -Naurd main/TOOLS/CVS/Entries.Log main-patch/TOOLS/CVS/Entries.Log --- main/TOOLS/CVS/Entries.Log Thu Nov 1 23:22:18 2001 +++ main-patch/TOOLS/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,5 +0,0 @@ -A D/GL-test//// -A D/benchmark//// -A D/mpfc//// -A D/subfont-c//// -A D/subfont-gimp//// diff -Naurd main/TOOLS/subfont-c/CVS/Entries main-patch/TOOLS/subfont-c/CVS/Entries --- main/TOOLS/subfont-c/CVS/Entries Thu Nov 1 23:22:18 2001 +++ main-patch/TOOLS/subfont-c/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -3,4 +3,5 @@ /font.desc.tail/1.1/Thu Aug 9 17:28:06 2001// /runme/1.4/Fri Aug 24 08:55:00 2001// /subfont.c/1.10/Fri Aug 24 10:46:31 2001// -D +D/encodings//// +D/osd//// diff -Naurd main/TOOLS/subfont-c/CVS/Entries.Log main-patch/TOOLS/subfont-c/CVS/Entries.Log --- main/TOOLS/subfont-c/CVS/Entries.Log Thu Nov 1 23:22:18 2001 +++ main-patch/TOOLS/subfont-c/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,2 +0,0 @@ -A D/encodings//// -A D/osd//// diff -Naurd main/TVout/CVS/Entries main-patch/TVout/CVS/Entries --- main/TVout/CVS/Entries Thu Nov 1 23:22:19 2001 +++ main-patch/TVout/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -14,4 +14,6 @@ /matroxfbtune/1.1/Wed Oct 24 20:33:19 2001// /matroxtv/1.3/Tue Oct 30 17:07:30 2001// /modules/1.1.1.1/Sat Feb 24 20:28:52 2001// -D +D/con2fb//// +D/fbset//// +D/matroxset//// diff -Naurd main/TVout/CVS/Entries.Log main-patch/TVout/CVS/Entries.Log --- main/TVout/CVS/Entries.Log Thu Nov 1 23:22:20 2001 +++ main-patch/TVout/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,3 +0,0 @@ -A D/con2fb//// -A D/fbset//// -A D/matroxset//// diff -Naurd main/configure main-patch/configure --- main/configure Wed Oct 31 19:25:28 2001 +++ main-patch/configure Thu Nov 1 23:00:35 2001 @@ -182,6 +182,7 @@ --enable-sdl build with SDL render support [autodetect] --enable-aa build with AAlib render support [autodetect] --enable-ggi build with GGI render support [autodetect] + --enable-dxr3 build with DXR3/H+ render support [autodetect] --enable-mga build with mga_vid support (check for /dev/mga_vid) [autodetect] --enable-xmga build with mga_vid X Window support @@ -560,6 +561,7 @@ _dga2=no _svga=no _fbdev=no +_dxr3=no linux && _fbdev=yes _lirc=no _css=no @@ -584,6 +586,7 @@ _x11lib= _xineramalib= _iconvlib= +_dxr3lib= _select='#define HAVE_AUDIO_SELECT' @@ -642,6 +645,7 @@ #include int main( void ) { return 0; } EOF +_libavcodec_so=no cc_check $_extraincdir $_extralibdir -lffmpeg && _libavcodec_so=yes if test -c /dev/mga_vid ; then @@ -906,6 +910,9 @@ _aa=no cc_check $_extraincdir $_extralibdir -laa && _aa=yes +_dxr3=no +cc_check $_extraincdir $_extralibdir -ldxr3 && _dxr3=yes + _divx4linux=no cc_check $_extraincdir $_extralibdir -ldivxdecore -lm && _divx4linux=yes @@ -1346,6 +1353,9 @@ --enable-fbdev) _fbdev=yes ;; + --enable-dxr3) + _dxr3=yes + ;; --enable-iconv) _iconv=yes ;; @@ -1462,6 +1472,9 @@ --disable-fbdev) _fbdev=no ;; + --disable-dxr3) + _dxr3=no + ;; --disable-iconv) _iconv=no ;; @@ -1713,6 +1726,7 @@ echo "Checking for Xf86VM ... $_vm" echo "Checking for SVGAlib ... $_svga" echo "Checking for FBDev ... $_fbdev" +echo "Checking for DXR3/H+ ... $_dxr3" echo "Checking for OSS Audio ... $_oss_audio" echo "Checking for ALSA Audio ... $_alsaver" echo "Checking for ESD Audio ... $_esd" @@ -2362,6 +2376,15 @@ _fbdev='#undef HAVE_FBDEV' fi +if test "$_dxr3" = yes ; then + _dxr3='#define HAVE_DXR3' + _dxr3lib='-ldxr3' + _vosrc=$_vosrc' vo_dxr3.c' + _aosrc=$_aosrc' ao_dxr3.c' +else + _dxr3='#undef HAVE_DXR3' +fi + if test "$_gui" = yes ; then _gui_def='#define HAVE_NEW_GUI' _gui_lib='-LGui -lgui $(GTKLIB) $(GLIBLIB)' @@ -2407,7 +2430,7 @@ X11_INC=$_x11incdir X11DIR=$_x11libdir -X_LIBS=$_x11libdir $_extralibdir $_gllib $_ggilib $_sdllib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib $_aalib $_libvorbis $_xineramalib $_libmad $_zlib +X_LIBS=$_x11libdir $_extralibdir $_gllib $_ggilib $_sdllib $_dxr3lib $_dgalib $_x11lib $_xvlib $_vmlib $_svgalib $_libpng $_socklib $_aalib $_libvorbis $_xineramalib $_libmad $_zlib TERMCAP_LIB=$_libtermcap XMM_LIBS = $_xmmplibs @@ -2569,7 +2592,7 @@ /* ffmpeg's libavcodec support (requires libavcodec source) */ $_libavcodec -$_libavcodecso +$_libavcodec_so /* use only decoders from libavcodec: */ #define CONFIG_DECODERS @@ -2674,6 +2697,7 @@ $_xmga $_syncfb $_fbdev +$_dxr3 $_svga $_have_xdpms $_aa diff -Naurd main/drivers/CVS/Entries main-patch/drivers/CVS/Entries --- main/drivers/CVS/Entries Thu Nov 1 23:22:21 2001 +++ main-patch/drivers/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -6,4 +6,5 @@ /mga_vid_test.c/1.3/Wed May 23 19:51:52 2001// /sis_vid.c/1.2/Fri Mar 9 00:42:27 2001// /sis_vid.h/1.1.1.1/Sat Feb 24 20:29:04 2001// -D +D/radeon//// +D/syncfb//// diff -Naurd main/drivers/CVS/Entries.Log main-patch/drivers/CVS/Entries.Log --- main/drivers/CVS/Entries.Log Thu Nov 1 23:22:24 2001 +++ main-patch/drivers/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,2 +0,0 @@ -A D/radeon//// -A D/syncfb//// diff -Naurd main/libac3/CVS/Entries main-patch/libac3/CVS/Entries --- main/libac3/CVS/Entries Thu Nov 1 23:22:29 2001 +++ main-patch/libac3/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -35,4 +35,5 @@ /stats.c/1.1.1.1/Sat Feb 24 20:29:39 2001// /stats.h/1.1.1.1/Sat Feb 24 20:29:39 2001// /test2.c/1.2/Wed Jun 6 09:33:56 2001// -D +D/downmix//// +D/mmx//// diff -Naurd main/libac3/CVS/Entries.Log main-patch/libac3/CVS/Entries.Log --- main/libac3/CVS/Entries.Log Thu Nov 1 23:22:29 2001 +++ main-patch/libac3/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,2 +0,0 @@ -A D/downmix//// -A D/mmx//// diff -Naurd main/libao2/ao_dxr3.c main-patch/libao2/ao_dxr3.c --- main/libao2/ao_dxr3.c Thu Jan 1 01:00:00 1970 +++ main-patch/libao2/ao_dxr3.c Thu Nov 1 22:28:05 2001 @@ -0,0 +1,163 @@ +#include +#include +#include +#include +#include +#include + +#include + +#include "../config.h" + +#include "afmt.h" + +#include "audio_out.h" +#include "audio_out_internal.h" + +struct +{ + int ao_format; + int ao_rate; + int ao_channels; +} ao_device; + +static ao_info_t info = +{ + "DXR3/H+ audio out", + "dxr3", + "David Holm ", + "" +}; + +LIBAO_EXTERN(dxr3) + +// there are some globals: +// ao_samplerate +// ao_channels +// ao_format +// ao_bps +// ao_outburst +// ao_buffersize + +// to set/get/query special features/parameters +static int control(int cmd,int arg) +{ + switch(cmd) + { + case AOCONTROL_SET_DEVICE: + return CONTROL_OK; + case AOCONTROL_QUERY_FORMAT: + return CONTROL_TRUE; + case AOCONTROL_GET_VOLUME: + case AOCONTROL_SET_VOLUME: + { + return CONTROL_OK; + } + } + return CONTROL_TRUE; +} + +// open & setup audio device +// return: 1=success 0=fail +static int init(int rate,int channels,int format,int flags) +{ + ao_device.ao_format = format; + ao_device.ao_rate = rate; + ao_device.ao_channels = channels; + + if( dxr3_get_status() == DXR3_STATUS_CLOSED ) + { + if( dxr3_open( "/dev/em8300", "/etc/dxr3.ux" ) != 0 ) printf( "Error loading /dev/em8300 with /etc/dxr3.ux microcode\n" ); + printf( "DXR3 status: &s\n", dxr3_get_status() ? "opened":"closed" ); + } + else + printf( "DXR3 already open\n" ); + + if( dxr3_set_playmode( DXR3_PLAYMODE_PLAY ) != 0 ) printf( "Error setting playmode of DXR3\n" ); + + if( format == AFMT_AC3 ) + { + if( dxr3_audio_set_mode( DXR3_AUDIOMODE_DIGITALAC3 ) != 0 ) + { + printf( "Cannot set DXR3 to AC3 playback!\n" ); + return -1; + } + } + else + { + if( dxr3_audio_set_mode( DXR3_AUDIOMODE_ANALOG ) != 0 ) + { + printf( "Cannot set DXR3 to analog playback!\n" ); + return -1; + } + if( format == AFMT_U8 ) + dxr3_audio_set_samplesize( 8 ); + else if( format == AFMT_S16_LE ) + dxr3_audio_set_samplesize( 16 ); + else + { + printf( "Unsupported audio format\n" ); + return -1; + } + } + + dxr3_audio_set_stereo( (channels > 1) ? "true":"false" ); + dxr3_audio_set_rate( rate ); + + return 1; +} + +// close audio device +static void uninit() +{ + dxr3_close(); +} + +// stop playing and empty buffers (for seeking/pause) +static void reset() +{ + uninit(); + if( !init( ao_device.ao_rate, ao_device.ao_channels, ao_device.ao_format, 0 ) ) + printf("\nFatal error: *** CANNOT RE-OPEN / RESET AUDIO DEVICE ***\n"); +} + +// stop playing, keep buffers (for pause) +static void audio_pause() +{ + // for now, just call reset(); + reset(); +} + +// resume playing, after audio_pause() +static void audio_resume() +{ +} + + +// return: how many bytes can be played without blocking +static int get_space() +{ + return dxr3_audio_get_buffersize()-dxr3_audio_get_bytesleft(); +} + +// plays 'len' bytes of 'data' +// it should round it down to outburst*n +// return: number of bytes played +static int play(void* data,int len,int flags) +{ + if(len) + if( ao_device.ao_format == AFMT_AC3 ) + return dxr3_audio_write_ac3( data, len ); + else + return dxr3_audio_write_ac3( data, len ); + + printf( "Invalid audio data\n" ); + return 0; +} + +// return: how many unplayed bytes are in the buffer +static int get_delay() +{ + return dxr3_audio_get_bytesleft(); +} + diff -Naurd main/libao2/audio_out.c main-patch/libao2/audio_out.c --- main/libao2/audio_out.c Wed Oct 24 16:02:18 2001 +++ main-patch/libao2/audio_out.c Thu Nov 1 22:28:05 2001 @@ -37,6 +37,9 @@ #ifdef USE_SGI_AUDIO extern ao_functions_t audio_out_sgi; #endif +#ifdef HAVE_DXR3 +extern ao_functions_t audio_out_dxr3; +#endif extern ao_functions_t audio_out_pcm; extern ao_functions_t audio_out_pss; @@ -63,6 +66,9 @@ #endif #ifdef HAVE_SDL &audio_out_sdl, +#endif +#ifdef HAVE_DXR3 + &audio_out_dxr3, #endif &audio_out_pcm, // &audio_out_pss, diff -Naurd main/libao2/config.mak main-patch/libao2/config.mak --- main/libao2/config.mak Thu Jan 1 01:00:00 1970 +++ main-patch/libao2/config.mak Thu Nov 1 22:59:15 2001 @@ -0,0 +1,6 @@ + +include ../config.mak + +OPTIONAL_SRCS= ao_alsa5.c ao_oss.c ao_sdl.c ao_dxr3.c +OPTIONAL_OBJS=ao_alsa5.o ao_oss.o ao_sdl.o ao_dxr3.o + diff -Naurd main/libavcodec/CVS/Entries main-patch/libavcodec/CVS/Entries --- main/libavcodec/CVS/Entries Thu Nov 1 23:22:29 2001 +++ main-patch/libavcodec/CVS/Entries Thu Nov 1 22:29:37 2001 @@ -1,2 +1,2 @@ /README/1.2/Wed Aug 8 19:54:46 2001// -D +D/i386//// diff -Naurd main/libavcodec/CVS/Entries.Log main-patch/libavcodec/CVS/Entries.Log --- main/libavcodec/CVS/Entries.Log Thu Nov 1 23:22:29 2001 +++ main-patch/libavcodec/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1 +0,0 @@ -A D/i386//// diff -Naurd main/libvo/config.mak main-patch/libvo/config.mak --- main/libvo/config.mak Thu Jan 1 01:00:00 1970 +++ main-patch/libvo/config.mak Thu Nov 1 22:59:15 2001 @@ -0,0 +1,6 @@ + +include ../config.mak + +OPTIONAL_SRCS= vo_aa.c vo_png.c vo_gl.c vo_gl2.c vo_sdl.c vo_ggi.c vo_x11.c vo_xv.c vo_dga.c vo_dga.c vo_fbdev.c vo_dxr3.c +OPTIONAL_OBJS=vo_aa.o vo_png.o vo_gl.o vo_gl2.o vo_sdl.o vo_ggi.o vo_x11.o vo_xv.o vo_dga.o vo_dga.o vo_fbdev.o vo_dxr3.o + diff -Naurd main/libvo/video_out.c main-patch/libvo/video_out.c --- main/libvo/video_out.c Wed Oct 31 23:04:28 2001 +++ main-patch/libvo/video_out.c Thu Nov 1 22:28:05 2001 @@ -70,6 +70,7 @@ extern vo_functions_t video_out_ggi; extern vo_functions_t video_out_aa; extern vo_functions_t video_out_mpegpes; +extern vo_functions_t video_out_dxr3; #ifdef TARGET_LINUX extern vo_functions_t video_out_vesa; #endif @@ -118,6 +119,9 @@ #endif #ifdef HAVE_AA &video_out_aa, +#endif +#ifdef HAVE_DXR3 + &video_out_dxr3, #endif #ifdef HAVE_PNG diff -Naurd main/libvo/vo_dxr3.c main-patch/libvo/vo_dxr3.c --- main/libvo/vo_dxr3.c Thu Jan 1 01:00:00 1970 +++ main-patch/libvo/vo_dxr3.c Thu Nov 1 22:51:39 2001 @@ -0,0 +1,323 @@ +#define PES_MAX_SIZE 2048 +/* + * vo_dxr3.c - DXR3/H+ video out + * + * Copyright (C) 2001 David Holm + * + * libav - MPEG-PS multiplexer, part of ffmpeg + * Copyright Gerard Lantau (see http://ffmpeg.sf.net) + * + */ + +#include "fastmemcpy.h" +#include +#include +#include + +#include +#include +#include + +#include + +#include "config.h" +#include "video_out.h" +#include "video_out_internal.h" + +#include "yuv2rgb.h" +#ifdef HAVE_MMX +#include "mmx.h" +#endif + +LIBVO_EXTERN (dxr3) + +#ifdef USE_LIBAVCODEC + +#ifdef USE_LIBAVCODEC_SO +#include +#else +#include "../libavcodec/avcodec.h" +#endif +static AVPicture picture; +static AVCodec *codec=NULL; +static AVCodecContext codec_context; +extern int avcodec_inited; +#endif + +static unsigned char *picture_buf=NULL; +static unsigned char *outbuf=NULL; +static int outbuf_size = 100000; +static int s_pos_x,s_pos_y; +static int d_pos_x,d_pos_y; +static int osd_w,osd_h; +static uint32_t img_format = 0; + +static vo_info_t vo_info = +{ + "DXR3/H+ video out", + "dxr3", + "David Holm ", + "" +}; + +static uint32_t +init(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format) +{ + if( dxr3_get_status() == DXR3_STATUS_CLOSED ) + { + if( dxr3_open( "/dev/em8300", "/etc/dxr3.ux" ) != 0 ) printf( "Error loading /dev/em8300 with /etc/dxr3.ux microcode file\n" ); + printf( "DXR3 status: %s\n", dxr3_get_status() ? "opened":"closed" ); + } + else + printf( "DXR3 already open\n" ); + + if( dxr3_set_playmode( DXR3_PLAYMODE_PLAY ) !=0 ) printf( "Error setting playmode of DXR3\n" ); + + img_format = format; + picture_buf=NULL; + if( format == IMGFMT_YV12 ) + { +#ifdef USE_LIBAVCODEC + + int size; + + printf("Format: YV12\n"); + + if(!avcodec_inited){ + avcodec_init(); + avcodec_register_all(); + avcodec_inited=1; + } + + /* find the mpeg1 video encoder */ + codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO); + if (!codec) { + fprintf(stderr, "mpeg1 codec not found\n"); + return -1; + } + + memset(&codec_context,0,sizeof(codec_context)); + codec_context.bit_rate=100000; // not used + codec_context.frame_rate=25*FRAME_RATE_BASE; // !!!!! + codec_context.gop_size=0; // I frames only + codec_context.flags=CODEC_FLAG_QSCALE; + codec_context.quality=1; // quality! 1..31 (1=best,slowest) + codec_context.pix_fmt = PIX_FMT_RGB24; + if(width<=352 && height<=288){ + codec_context.width=352; + codec_context.height=288; + } else + if(width<=352 && height<=576){ + codec_context.width=352; + codec_context.height=576; + } else + if(width<=480 && height<=576){ + codec_context.width=480; + codec_context.height=576; + } else + if(width<=544 && height<=576){ + codec_context.width=544; + codec_context.height=576; + } else { + codec_context.width=704; + codec_context.height=576; + } + + osd_w=s_width; + d_pos_x=(codec_context.width-(int)s_width)/2; + if(d_pos_x<0){ + s_pos_x=-d_pos_x;d_pos_x=0; + osd_w=codec_context.width; + } else s_pos_x=0; + + osd_h=s_height; + d_pos_y=(codec_context.height-(int)s_height)/2; + if(d_pos_y<0){ + s_pos_y=-d_pos_y;d_pos_y=0; + osd_h=codec_context.height; + } else s_pos_y=0; + + printf("[vo] position mapping: %d;%d => %d;%d\n",s_pos_x,s_pos_y,d_pos_x,d_pos_y); + + /* open it */ + if (avcodec_open(&codec_context, codec) < 0) { + fprintf(stderr, "could not open codec\n"); + return -1; + } + + outbuf_size=10000+width*height; // must be enough! + outbuf = malloc(outbuf_size); + + size = codec_context.width*codec_context.height; + picture_buf = malloc((size * 3) / 2); /* size for YUV 420 */ + + picture.data[0] = picture_buf; + picture.data[1] = picture.data[0] + size; + picture.data[2] = picture.data[1] + size / 4; + picture.linesize[0] = codec_context.width; + picture.linesize[1] = codec_context.width / 2; + picture.linesize[2] = codec_context.width / 2; + return 0; +#endif + return -1; + } + else if(format==IMGFMT_MPEGPES) + { + printf( "Format: MPEG-PES\n" ); + return 0; + } + + printf( "Format: Unsupported\n" ); + return -1; +} + +static const vo_info_t* +get_info(void) +{ + return &vo_info; +} + +static void draw_alpha(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride) +{ + int x,y; + if( img_format == IMGFMT_YV12 ) + vo_draw_alpha_yv12(w,h,src,srca,stride,picture.data[0]+(x0+d_pos_x)+(y0+d_pos_y)*picture.linesize[0],picture.linesize[0]); +} + +static void draw_osd(void) +{ + if( img_format == IMGFMT_YV12 ) + { + vo_draw_text(osd_w,osd_h,draw_alpha); + } +} + +static uint32_t draw_frame(uint8_t * src[]) +{ + int data_left; + if( img_format == IMGFMT_MPEGPES ) + { + vo_mpegpes_t *p=(vo_mpegpes_t *)src[0]; + + data_left = p->size; + while( data_left ) + data_left -= dxr3_video_write( &((unsigned char*)p->data)[p->size-data_left], data_left ); + + return 0; + } +#ifdef USE_LIBAVCODEC + else if( img_format == IMGFMT_YV12 ) + { + printf("ERROR: Uninplemented\n"); + } +#endif + + printf( "Error in draw_frame(...)" ); + return -1; +} + +static void flip_page (void) +{ +#ifdef USE_LIBAVCODEC + if( img_format == IMGFMT_YV12 ) + { + int out_size, tmp_size; + /* encode the image */ + tmp_size = out_size = avcodec_encode_video(&codec_context, outbuf, outbuf_size, &picture); + while( out_size ) + out_size -= dxr3_video_write( &outbuf[tmp_size-out_size], out_size ); + } +#endif +} + +static uint32_t draw_slice( uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0 ) +{ + int y; + unsigned char* s; + unsigned char* d; + int data_left; + vo_mpegpes_t *p = (vo_mpegpes_t *)srcimg[0]; + + if( img_format == IMGFMT_YV12 ) + { + x0+=d_pos_x; + y0+=d_pos_y; + if(x0+w>picture.linesize[0]) w=picture.linesize[0]-x0; // !! + if(y0+h>codec_context.height) h=codec_context.height-y0; + + // Y + s=srcimg[0]+s_pos_x+s_pos_y*stride[0]; + d=picture.data[0]+x0+y0*picture.linesize[0]; + for( y = 0; y < h; y++) + { + memcpy(d,s,w); + s+=stride[0]; + d+=picture.linesize[0]; + } + + w/=2;h/=2;x0/=2;y0/=2; + + // U + s=srcimg[1]+(s_pos_x/2)+(s_pos_y/2)*stride[1]; + d=picture.data[1]+x0+y0*picture.linesize[1]; + for( y = 0; y < h; y++) + { + memcpy(d,s,w); + s+=stride[1]; + d+=picture.linesize[1]; + } + + // V + s=srcimg[2]+(s_pos_x/2)+(s_pos_y/2)*stride[2]; + d=picture.data[2]+x0+y0*picture.linesize[2]; + for(y=0;ysize; + while( data_left ) + data_left -= dxr3_video_write( &((unsigned char*)p->data)[p->size-data_left], data_left ); + return 0; + } + + return -1; +} + + +static uint32_t +query_format(uint32_t format) +{ + if(format==IMGFMT_MPEGPES) return 1; +#ifdef USE_LIBAVCODEC + if(format==IMGFMT_YV12) return 1; +#endif + return 0; +} + +static void +uninit(void) +{ +#ifdef USE_LIBAVCODEC + if( img_format == IMGFMT_YV12 ) + { + free(outbuf); + free(picture_buf); + } +#endif + dxr3_close( ); +} + + +static void check_events(void) +{ +} + diff -Naurd main/loader/CVS/Entries main-patch/loader/CVS/Entries --- main/loader/CVS/Entries Thu Nov 1 23:22:42 2001 +++ main-patch/loader/CVS/Entries Thu Nov 1 22:29:38 2001 @@ -20,4 +20,6 @@ /win32.c/1.24/Tue Oct 30 22:40:40 2001// /win32.h/1.4/Mon Oct 8 22:26:14 2001// /wineacm.h/1.2/Thu Oct 4 02:21:34 2001// -D +D/DirectShow//// +D/qtx//// +D/wine//// diff -Naurd main/loader/CVS/Entries.Log main-patch/loader/CVS/Entries.Log --- main/loader/CVS/Entries.Log Thu Nov 1 23:22:44 2001 +++ main-patch/loader/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1,3 +0,0 @@ -A D/DirectShow//// -A D/qtx//// -A D/wine//// diff -Naurd main/loader/qtx/CVS/Entries main-patch/loader/qtx/CVS/Entries --- main/loader/qtx/CVS/Entries Thu Nov 1 23:22:44 2001 +++ main-patch/loader/qtx/CVS/Entries Thu Nov 1 22:29:38 2001 @@ -1,2 +1,2 @@ /qtxload.c/1.3/Tue Oct 30 23:20:31 2001// -D +D/qtxsdk//// diff -Naurd main/loader/qtx/CVS/Entries.Log main-patch/loader/qtx/CVS/Entries.Log --- main/loader/qtx/CVS/Entries.Log Thu Nov 1 23:22:44 2001 +++ main-patch/loader/qtx/CVS/Entries.Log Thu Jan 1 01:00:00 1970 @@ -1 +0,0 @@ -A D/qtxsdk//// diff -Naurd main/mencoder.c main-patch/mencoder.c --- main/mencoder.c Thu Nov 1 22:47:28 2001 +++ main-patch/mencoder.c Thu Nov 1 03:31:23 2001 @@ -64,8 +64,7 @@ static float max_pts_correction=0;//default_max_pts_correction; static float c_total=0; -float force_fps=0; -float force_ofps=0; // set to 24 for inverse telecine +int force_fps=0; //#include "libmpeg2/mpeg2.h" //#include "libmpeg2/mpeg2_internal.h" @@ -173,8 +172,7 @@ float audio_preload=0.3; -double v_pts_corr=0; -double v_timer_corr=0; +float v_timer_corr=0; //int out_buffer_size=0x200000; //unsigned char* out_buffer=malloc(out_buffer_size); @@ -339,7 +337,7 @@ mux_v->h.dwSampleSize=0; // VBR mux_v->h.dwScale=10000; -mux_v->h.dwRate=mux_v->h.dwScale*(force_ofps?force_ofps:sh_video->fps); +mux_v->h.dwRate=mux_v->h.dwScale*sh_video->fps; mux_v->codec=VCODEC_DIVX4; // 0=streamcopy @@ -419,7 +417,7 @@ // init divx4linux: enc_param.x_dim=sh_video->disp_w; enc_param.y_dim=sh_video->disp_h; - enc_param.framerate=(float)mux_v->h.dwRate/mux_v->h.dwScale; + enc_param.framerate=sh_video->fps; enc_param.bitrate=800000; enc_param.rc_period=0; enc_param.rc_reaction_period=0; @@ -477,7 +475,6 @@ float v_pts=0; unsigned char* start=NULL; int in_size; - int skip_flag=0; // 1=skip -1=duplicate if(sh_audio){ // get audio: @@ -543,34 +540,11 @@ in_size=video_read_frame(sh_video,&frame_time,&start,force_fps); if(in_size<0){ eof=1; break; } sh_video->timer+=frame_time; - - v_timer_corr-=frame_time-(float)mux_v->h.dwScale/mux_v->h.dwRate; - -// check frame duplicate/drop: - -if(v_timer_corr>=(float)mux_v->h.dwScale/mux_v->h.dwRate){ - v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate; - ++skip_flag; // skip -} else -while(v_timer_corr<=-(float)mux_v->h.dwScale/mux_v->h.dwRate){ - v_timer_corr+=(float)mux_v->h.dwScale/mux_v->h.dwRate; - --skip_flag; // dup -} - -while( (v_pts_corr<=-(float)mux_v->h.dwScale/mux_v->h.dwRate && skip_flag>0) - || (v_pts_corr<=-2*(float)mux_v->h.dwScale/mux_v->h.dwRate) ){ - v_pts_corr+=(float)mux_v->h.dwScale/mux_v->h.dwRate; - --skip_flag; // dup -} -if( (v_pts_corr>=(float)mux_v->h.dwScale/mux_v->h.dwRate && skip_flag<0) - || (v_pts_corr>=2*(float)mux_v->h.dwScale/mux_v->h.dwRate) ) - if(skip_flag<=0){ // we can't skip more than 1 frame now - v_pts_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate; - ++skip_flag; // skip - } +// if(!blit_frame) continue; -if(skip_flag<=0){ // don't have to skip frame. +if(v_timer_corr<2*sh_video->frametime){ +// don't have to skip frame. switch(mux_v->codec){ case 0: mux_v->buffer=start; @@ -605,20 +579,19 @@ aviwrite_write_chunk(muxer,mux_v,muxer_f,enc_frame.length,enc_result.is_key_frame?0x10:0); break; } - -if(skip_flag<0){ +if(v_timer_corr<-2*sh_video->frametime){ // duplicate frame - printf("\nduplicate %d frame(s)!!! \n",-skip_flag); - while(skip_flag<0){ - aviwrite_write_chunk(muxer,mux_v,muxer_f,0,0); - ++skip_flag; - } + printf("\nduplicate frame!!! \n"); + aviwrite_write_chunk(muxer,mux_v,muxer_f,0,0); + v_timer_corr+=(float)mux_v->h.dwScale/mux_v->h.dwRate; +// v_timer_corr=0; } } else { // skip frame printf("\nskip frame!!! \n"); - --skip_flag; + v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate; +// v_timer_corr=0; } if(sh_audio){ @@ -639,7 +612,7 @@ } v_pts=d_video->pts; // av = compensated (with out buffering delay) A-V diff - AV_delay=(a_pts-v_pts); AV_delay-=mux_a->timer-(mux_v->timer-(v_timer_corr+v_pts_corr)); + AV_delay=(a_pts-v_pts); AV_delay-=mux_a->timer-(mux_v->timer-v_timer_corr); // compensate input video timer by av: x=AV_delay*0.1f; if(x<-max_pts_correction) x=-max_pts_correction; else @@ -650,12 +623,12 @@ max_pts_correction=sh_video->frametime*0.10; // +-10% of time // sh_video->timer-=x; c_total+=x; - v_pts_corr+=x; + v_timer_corr+=x; - printf("A:%6.1f V:%6.1f A-V:%7.3f oAV:%7.3f diff:%7.3f ct:%7.3f vpc:%7.3f \r", + printf("A:%6.1f V:%6.1f A-V:%7.3f oAV:%7.3f diff:%7.3f ct:%7.3f vtc:%7.3f \r", a_pts,v_pts,a_pts-v_pts, (float)(mux_a->timer-mux_v->timer), - AV_delay, c_total, v_pts_corr ); + AV_delay, c_total, v_timer_corr ); }