# HG changeset patch # User atmos4 # Date 1007995304 0 # Node ID 5cb7caab5536117aeb5edca0f6a9689b36adb3ff # Parent 63ecec3bdf93dd659c608cc3dccd40d803a4d9b8 MP1E configure patch by D. Holm. diff -r 63ecec3bdf93 -r 5cb7caab5536 Makefile --- a/Makefile Mon Dec 10 13:14:28 2001 +0000 +++ b/Makefile Mon Dec 10 14:41:44 2001 +0000 @@ -35,12 +35,12 @@ VO_LIBS = -Llibvo -lvo VO_INC = -Ilibvo endif -V_LIBS = $(X_LIB) $(DXR3_LIB) $(GGI_LIB) $(MLIB_LIB) $(PNG_LIB) $(SDL_LIB) $(SVGA_LIB) $(AA_LIB) $(DIRECTFB_LIB) +V_LIBS = $(X_LIB) $(MP1E_LIB) $(GGI_LIB) $(MLIB_LIB) $(PNG_LIB) $(SDL_LIB) $(SVGA_LIB) $(AA_LIB) $(DIRECTFB_LIB) AO_LIBS = -Llibao2 -lao2 A_LIBS = $(ALSA_LIB) $(NAS_LIB) $(MAD_LIB) $(VORBIS_LIB) $(SGIAUDIO_LIB) -CODEC_LIBS = -Lg72x -lg72x -Lmp3lib -lMP3 -Llibac3 -lac3 -Lliba52 -la52 -Lxa -lxa -Llibmpeg2 -lmpeg2 -Llibmp1e -lmp1e $(AV_LIB) +CODEC_LIBS = -Lg72x -lg72x -Lmp3lib -lMP3 -Llibac3 -lac3 -Lliba52 -la52 -Lxa -lxa -Llibmpeg2 -lmpeg2 $(AV_LIB) COMMON_LIBS = -Llinux -losdep -Lpostproc -lpostproc CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) # -Wall @@ -84,7 +84,7 @@ .c.o: $(CC) -c $(CFLAGS) -o $@ $< -COMMON_DEPS = g72x/libg72x.a libmpdemux/libmpdemux.a libao2/libao2.a libac3/libac3.a liba52/liba52.a mp3lib/libMP3.a libmp1e/libmp1e.a libmpeg2/libmpeg2.a opendivx/libdecore.a linux/libosdep.a postproc/libpostproc.a xa/libxa.a +COMMON_DEPS = g72x/libg72x.a libmpdemux/libmpdemux.a libao2/libao2.a libac3/libac3.a liba52/liba52.a mp3lib/libMP3.a libmpeg2/libmpeg2.a opendivx/libdecore.a linux/libosdep.a postproc/libpostproc.a xa/libxa.a ifeq ($(VO2),yes) COMMON_DEPS += libvo2/libvo2.a @@ -149,8 +149,8 @@ g72x/libg72x.a: $(MAKE) -C g72x -MPLAYER_DEP = $(OBJS_MPLAYER) $(LOADER_DEP) $(AV_DEP) $(COMMON_DEPS) -MENCODER_DEP = $(OBJS_MENCODER) $(LOADER_DEP) $(AV_DEP) $(COMMON_DEPS) +MPLAYER_DEP = $(OBJS_MPLAYER) $(LOADER_DEP) $(MP1E_DEP) $(AV_DEP) $(COMMON_DEPS) +MENCODER_DEP = $(OBJS_MENCODER) $(LOADER_DEP) $(MP1E_DEP) $(AV_DEP) $(COMMON_DEPS) ifeq ($(GUI),yes) MPLAYER_DEP += Gui/libgui.a diff -r 63ecec3bdf93 -r 5cb7caab5536 configure --- a/configure Mon Dec 10 13:14:28 2001 +0000 +++ b/configure Mon Dec 10 14:41:44 2001 +0000 @@ -126,6 +126,7 @@ --enable-vorbis build with OggVorbis support [autodetect] --disable-iconv do not use iconv(3) function [autodetect] --disable-rtc disable RTC (/dev/rtc) on Linux [autodetect] + --disable-mp1e disable libmp1e support (only if it won't compile) [enable] Video: --enable-gl build with OpenGL render support [autodetect] @@ -640,6 +641,7 @@ # If autodetection is available then the third state is: auto _libavcodec=auto _libavcodecso=no # changed default to no as it causes problems - atmos +_mp1e=yes _mencoder=auto _x11=auto _dga=auto # 1 2 no auto @@ -735,6 +737,7 @@ --disable-iconv) _iconv=no ;; --enable-rtc) _rtc=yes ;; --disable-rtc) _rtc=no ;; + --disable-mp1e) _mp1e=no ;; --enable-ossaudio) _ossaudio=yes ;; --disable-ossaudio) _ossaudio=no ;; --enable-mad) _mad=yes ;; @@ -1810,6 +1813,22 @@ fi echores "$_nas" +if test "$_mmx" = no ; then + _mp1e=no +fi +if test "$_mp1e" = yes ; then + _def_mp1e='#define USE_MP1E' + _ld_mp1e="-Llibmp1e -lmp1e" + _dep_mp1e='libmp1e/libmp1e.a' +else + echocheck "libmp1e" + _mp1e=no + _def_mp1e='#undef USE_MP1E' + _ld_mp1e="" + _dep_mp1e='' + echores "$_mp1e" +fi + echocheck "DXR3/H+" if test "$_dxr3" = auto ; then cat > $TMPC << EOF @@ -2650,6 +2669,8 @@ DS_LIB = $_ld_dshow AV_DEP = $_dep_libavcodec AV_LIB = $_ld_libavcodec +MP1E_DEP = $_dep_mp1e +MP1E_LIB = $_ld_mp1e ARCH_LIB = $_ld_arch $_ld_iconv DIVX4LINUX = $_divx4linux DECORE_LIB = $_ld_decore @@ -2715,6 +2736,9 @@ Note: REQUIRED for mencoder */ $_def_mp3lame +/* Define libmp1e */ +$_def_mp1e + /* Define this to enable avg. byte/sec-based AVI sync method by default: (use -bps or -nobps commandline option for run-time method selection) -bps gives better sync for vbr mp3 audio, it is now default */ diff -r 63ecec3bdf93 -r 5cb7caab5536 libvo/vo_dxr3.c --- a/libvo/vo_dxr3.c Mon Dec 10 13:14:28 2001 +0000 +++ b/libvo/vo_dxr3.c Mon Dec 10 14:41:44 2001 +0000 @@ -21,7 +21,9 @@ #include "config.h" #include "video_out.h" #include "video_out_internal.h" +#ifdef USE_MP1E #include "../libmp1e/libmp1e.h" +#endif #include "../postproc/rgb2rgb.h" #ifdef HAVE_MMX @@ -30,9 +32,11 @@ LIBVO_EXTERN (dxr3) +#ifdef USE_MP1E rte_context *mp1e_context = NULL; rte_codec *mp1e_codec = NULL; rte_buffer mp1e_buffer; +#endif struct { uint16_t Y,U,V; } YUV_s; #define RGBTOY(R,G,B) (uint16_t)( (0.257 * R) + (0.504 * G) + (0.098 * B) + 16 ) #define RGBTOU(R,G,B) (uint16_t)( -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128 ) @@ -66,10 +70,12 @@ "" }; +#ifdef USE_MP1E void write_dxr3( rte_context* context, void* data, size_t size, void* user_data ) { write( fd_video, data, size ); } +#endif static uint32_t init(uint32_t scr_width, uint32_t scr_height, uint32_t width, uint32_t height, uint32_t fullscreen, char *title, uint32_t format) { @@ -116,6 +122,7 @@ if( format == IMGFMT_YV12 || format == IMGFMT_YUY2 || format == IMGFMT_BGR24 ) { +#ifdef USE_MP1E int size; enum rte_frame_rate frame_rate; @@ -235,6 +242,8 @@ } return 0; +#endif + return -1; } else if(format==IMGFMT_MPEGPES) { @@ -272,6 +281,7 @@ return 0; } +#ifdef USE_MP1E else if( img_format == IMGFMT_YUY2 ) { int w=v_width,h=v_height; @@ -342,12 +352,13 @@ return 0; } - +#endif return -1; } static void flip_page (void) { +#ifdef USE_MP1E if( img_format == IMGFMT_YV12 ) { mp1e_buffer.data = picture_data[0]; @@ -355,6 +366,7 @@ mp1e_buffer.user_data = NULL; rte_push_video_buffer( mp1e_context, &mp1e_buffer ); } +#endif } static uint32_t draw_slice( uint8_t *srcimg[], int stride[], int w, int h, int x0, int y0 ) @@ -404,11 +416,15 @@ static uint32_t query_format(uint32_t format) { - if(format==IMGFMT_MPEGPES) return 0x2;0x4; + if(format==IMGFMT_MPEGPES) return 0x2|0x4; +#ifdef USE_MP1E if(format==IMGFMT_YV12) return 0x1|0x4; if(format==IMGFMT_YUY2) return 0x1|0x4; if(format==IMGFMT_BGR24) { printf( "VO: [dxr3] WARNING\tExperimental output, black&white only and very slow\n\t(will be inproved later, this format is rarely used)\n" ); return 0x1|0x4; } else printf( "VO: [dxr3] Format unsupported, mail dholm@iname.com\n" ); +#else + else printf( "VO: [dxr3] You have disabled libmp1e support, you won't be able to play this format!\n" ); +#endif return 0; }