From b986aebcc515c02c1c6492b99c081952c8e7c7a9 Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 11 Jan 2002 17:20:43 +0000 Subject: Configurable VIDIX usage git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4090 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 28 +++++++++++++++++++++------- configure | 20 ++++++++++++++++++-- libvo/Makefile | 11 +++++++++-- libvo/vo_fbdev.c | 22 +++++++++++++++++++--- libvo/vo_vesa.c | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 5 files changed, 111 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 2ff8644a2a..7e074981e6 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,10 @@ PRG_TV = tvision PRG_CFG = codec-cfg PRG_MENCODER = mencoder # these subdirectories required installation due binaries within them -SUBDIRS = libdha vidix +ifeq ($(VIDIX),yes) +SUBDIRS += libdha vidix DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done +endif #prefix = /usr/local BINDIR = ${prefix}/bin @@ -45,12 +47,16 @@ 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 $(AV_LIB) -COMMON_LIBS = -Llinux -losdep -Lpostproc -lpostproc -Lvidix -lvidix -MISC_LIBS = -Llibdha -ldha - +COMMON_LIBS = -Llinux -losdep -Lpostproc -lpostproc +ifeq ($(VIDIX),yes) +MISC_LIBS += -Llibdha -ldha -Lvidix -lvidix +endif CFLAGS = $(OPTFLAGS) -Ilibmpdemux -Iloader $(VO_INC) $(EXTRA_INC) # -Wall -PARTS = g72x libmpdemux mp3lib libac3 liba52 libmp1e libmpeg2 opendivx libavcodec libao2 drivers drivers/syncfb linux postproc xa libdha vidix +PARTS = g72x libmpdemux mp3lib libac3 liba52 libmp1e libmpeg2 opendivx libavcodec libao2 drivers drivers/syncfb linux postproc xa +ifeq ($(VIDIX),yes) +PARTS += libdha vidix +endif ifeq ($(VO2),yes) PARTS += libvo2 else @@ -89,8 +95,11 @@ all: $(ALL_PRG) .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 libmpeg2/libmpeg2.a opendivx/libdecore.a linux/libosdep.a postproc/libpostproc.a libdha/libdha.so vidix/libvidix.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 ($(VIDIX),yes) +COMMON_DEPS += libdha/libdha.so vidix/libvidix.a +endif ifeq ($(VO2),yes) COMMON_DEPS += libvo2/libvo2.a else @@ -172,7 +181,10 @@ MENCODER_DEP += Gui/libgui.a GUI_LIBS = -LGui -lgui endif -VIDIX_LIBS = -Lvidix -lvidix +VIDIX_LIBS = +ifeq ($(VIDIX),yes) +VIDIX_LIBS += -Lvidix -lvidix +endif $(PRG): $(MPLAYER_DEP) $(CC) $(CFLAGS) -o $(PRG) $(OBJS_MPLAYER) $(CODEC_LIBS) -Llibmpdemux -lmpdemux $(VO_LIBS) $(AO_LIBS) $(LIB_LOADER) $(GUI_LIBS) $(COMMON_LIBS) $(EXTRA_LIB) $(A_LIBS) $(V_LIBS) $(LIRC_LIB) $(CSS_LIB) $(ARCH_LIB) $(DECORE_LIB) $(TERMCAP_LIB) $(STATIC_LIB) $(GTK_LIBS) $(PNG_LIB) $(Z_LIB) $(STREAMING_LIB) $(VIDIX_LIBS) -lm @@ -197,7 +209,9 @@ $(PRG_CFG): version.h codec-cfg.c codec-cfg.h $(CC) $(CFLAGS) -g codec-cfg.c -o $(PRG_CFG) -DCODECS2HTML install: $(ALL_PRG) +ifeq ($(VIDIX),yes) $(DO_MAKE) +endif if test ! -d $(BINDIR) ; then mkdir -p $(BINDIR) ; fi $(INSTALL) -m 755 -s $(PRG) $(BINDIR)/$(PRG) ifeq ($(GUI),yes) diff --git a/configure b/configure index 75dcaa229e..1803ee20c0 100755 --- a/configure +++ b/configure @@ -130,7 +130,7 @@ Optional features: (use this option if it does not compile) [enable] --disable-streaming disable network streaming support (support for: http/mms/rtp) [enable] - + --disable-vidix disable VIDIX stuff [enable] Video: --enable-gl build with OpenGL render support [autodetect] --enable-dga[=n] build with DGA [n in {1, 2} ] support [autodetect] @@ -705,6 +705,7 @@ _select=yes _tv=yes _tv_v4l=auto _streaming=yes +_vidix=yes _divx4linux=auto _lirc=auto _gui=no @@ -801,6 +802,8 @@ for ac_option do --disable-fastmemcpy) _fastmemcpy=no ;; --enable-streaming) _streaming=yes ;; --disable-streaming) _streaming=no ;; + --enable-vidix) _vidix=yes ;; + --disable-vidix) _vidix=no ;; --enable-divx4linux) _divx4linux=yes ;; --disable-divx4linux) _divx4linux=no ;; --enable-lirc) _lirc=yes ;; @@ -2732,7 +2735,9 @@ test "$_debug" && _def_debug='#define MP_DEBUG 1' _def_linux='#undef TARGET_LINUX' linux && _def_linux='#define TARGET_LINUX 1' - +_def_vidix='#define CONFIG_VIDIX 1' +test "$_vidix" = no && _def_vidix='#undef CONFIG_VIDIX' +echo Checking for vidix ... "$_vidix" ############################################################################# echo "Creating config.mak" cat > config.mak << EOF @@ -2752,6 +2757,7 @@ WIN32_PATH = -DWIN32_PATH=\\"$_win32libdir\\" STREAMING = $_streaming STREAMING_LIB = $_ld_streaming +VIDIX = $_vidix VO2 = $_vo2 @@ -3038,6 +3044,9 @@ $_def_vorbis $_def_streaming +/* enables / disables vidix usage */ +$_def_vidix + /* Extension defines */ $_def_3dnow // only define if you have 3DNOW (AMD k6-2, AMD Athlon, iDT WinChip, etc.) $_def_3dnowex // only define if you have 3DNOWEX (AMD Athlon, etc.) @@ -3222,6 +3231,13 @@ If you suspect a bug, please read DOCS/bugreports.html. EOF +if test "$_vidix" = no ; then +cat < 1 && !lvo_name && !vidix_name) + if(vo_doublebuffering && multi_size > 1 && !lvo_name +#ifdef CONFIG_VIDIX + && !vidix_name +#endif + ) { int err; if((err=vbeSetDisplayStart(multi_buff[multi_idx],1)) != VBE_OK) @@ -391,7 +401,11 @@ static uint32_t draw_frame(uint8_t *src[]) if(verbose > 2) printf("vo_vesa: rgb2rgb_fnc was called\n"); } - if((!rgb2rgb_fnc || !HAS_DGA()) && !lvo_name && !vidix_name) __vbeCopyData(data); + if((!rgb2rgb_fnc || !HAS_DGA()) && !lvo_name +#ifdef CONFIG_VIDIX + && !vidix_name +#endif + ) __vbeCopyData(data); return 0; } @@ -406,8 +420,10 @@ static uint32_t parseSubDevice(const char *sd) if(strcmp(sd,"dga") == 0) { flags &= ~(SUBDEV_NODGA); flags |= SUBDEV_FORCEDGA; } else if(memcmp(sd,"lvo:",4) == 0) lvo_name = &sd[4]; /* lvo_name will be valid within init() */ +#ifdef CONFIG_VIDIX else if(memcmp(sd,"vidix",5) == 0) vidix_name = &sd[5]; /* vidix_name will be valid within init() */ +#endif else { printf("vo_vesa: Unknown subdevice: '%s'\n", sd); return -1; } return flags; } @@ -424,7 +440,9 @@ static uint32_t query_format(uint32_t format) printf("vo_vesa: subdevice %s have been initialized\n",vo_subdevice); if(vo_subdevice) parseSubDevice(vo_subdevice); if(lvo_name) pre_init_err = vlvo_preinit(lvo_name); +#ifdef CONFIG_VIDIX else if(vidix_name) pre_init_err = vidix_preinit(vidix_name,&video_out_vesa); +#endif if(verbose > 2) printf("vo_subdevice: initialization returns: %i\n",pre_init_err); first = 0; @@ -432,7 +450,9 @@ static uint32_t query_format(uint32_t format) if(!pre_init_err) { if(lvo_name) return vlvo_query_info(format); +#ifdef CONFIG_VIDIX else if(vidix_name) return vidix_query_fourcc(format); +#endif } switch(format) { @@ -716,7 +736,11 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 if(sd_flags & SUBDEV_NODGA) video_mode_info.PhysBasePtr = 0; if( vesa_zoom || fs_mode ) { - if(format==IMGFMT_YV12 || lvo_name || vidix_name) + if(format==IMGFMT_YV12 || lvo_name +#ifdef CONFIG_VIDIX + || vidix_name +#endif + ) { /* software scale */ if(vesa_zoom > 1) @@ -735,7 +759,11 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 } scale_srcW=width; scale_srcH=height; - if(!lvo_name && !vidix_name) SwScale_Init(); + if(!lvo_name +#ifdef CONFIG_VIDIX + && !vidix_name +#endif + ) SwScale_Init(); if(verbose) printf("vo_vesa: Using SCALE\n"); } else @@ -744,7 +772,11 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 return -1; } } - if(format != IMGFMT_YV12 && image_bpp != video_mode_info.BitsPerPixel && !lvo_name && !vidix_name) + if(format != IMGFMT_YV12 && image_bpp != video_mode_info.BitsPerPixel && !lvo_name +#ifdef CONFIG_VIDIX + && !vidix_name +#endif + ) { if(image_bpp == 24 && video_mode_info.BitsPerPixel == 32) rgb2rgb_fnc = rgb24to32; else @@ -840,7 +872,11 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 else { cpy_blk_fnc = __vbeCopyBlock; - if((yuv_fmt || rgb2rgb_fnc) && !lvo_name && !vidix_name) + if((yuv_fmt || rgb2rgb_fnc) && !lvo_name +#ifdef CONFIG_VIDIX + && !vidix_name +#endif + ) { if(!(dga_buffer = memalign(64,video_mode_info.XResolution*video_mode_info.YResolution*video_mode_info.BitsPerPixel))) { @@ -878,6 +914,7 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 } else printf("vo_vesa: Using video overlay: %s\n",lvo_name); } +#ifdef CONFIG_VIDIX else if(vidix_name) { @@ -892,6 +929,7 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3 } else printf("vo_vesa: Using VIDIX\n"); } +#endif } else { -- cgit v1.2.3