summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile21
-rw-r--r--libdha/Makefile2
-rw-r--r--libvo/Makefile4
-rw-r--r--libvo/vo_vesa.c40
-rw-r--r--vidix/Makefile13
-rw-r--r--vidix/drivers/Makefile9
-rw-r--r--vidix/drivers/radeon_vid.c25
7 files changed, 77 insertions, 37 deletions
diff --git a/Makefile b/Makefile
index bc18fb7f53..29ee450f71 100644
--- a/Makefile
+++ b/Makefile
@@ -13,6 +13,9 @@ PRG_FIBMAP = fibmap_mplayer
PRG_TV = tvision
PRG_CFG = codec-cfg
PRG_MENCODER = mencoder
+# these subdirectories required installation due binaries within them
+SUBDIRS = libdha vidix
+DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
#prefix = /usr/local
BINDIR = ${prefix}/bin
@@ -42,11 +45,12 @@ 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
+COMMON_LIBS = -Llinux -losdep -Lpostproc -lpostproc -Lvidix -lvidix
+MISC_LIBS = -Llibdha -ldha
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
+PARTS = g72x libmpdemux mp3lib libac3 liba52 libmp1e libmpeg2 opendivx libavcodec libao2 drivers drivers/syncfb linux postproc xa libdha vidix
ifeq ($(VO2),yes)
PARTS += libvo2
else
@@ -85,7 +89,7 @@ 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 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 libdha/libdha.so vidix/libvidix.a xa/libxa.a
ifeq ($(VO2),yes)
COMMON_DEPS += libvo2/libvo2.a
@@ -135,6 +139,12 @@ mp3lib/libMP3.a:
opendivx/libdecore.a:
$(MAKE) -C opendivx
+libdha/libdha.so:
+ $(MAKE) -C libdha
+
+vidix/libvidix.a:
+ $(MAKE) -C vidix
+
# encore/libencore.a:
# $(MAKE) -C encore
@@ -162,8 +172,10 @@ MENCODER_DEP += Gui/libgui.a
GUI_LIBS = -LGui -lgui
endif
+VIDIX_LIBS = -Lvidix -lvidix
+
$(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) -lm
+ $(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
$(PRG_FIBMAP): fibmap_mplayer.o
$(CC) -o $(PRG_FIBMAP) fibmap_mplayer.o
@@ -185,6 +197,7 @@ $(PRG_CFG): version.h codec-cfg.c codec-cfg.h
$(CC) $(CFLAGS) -g codec-cfg.c -o $(PRG_CFG) -DCODECS2HTML
install: $(ALL_PRG)
+ $(DO_MAKE)
if test ! -d $(BINDIR) ; then mkdir -p $(BINDIR) ; fi
$(INSTALL) -m 755 -s $(PRG) $(BINDIR)/$(PRG)
ifeq ($(GUI),yes)
diff --git a/libdha/Makefile b/libdha/Makefile
index 057fb5ad70..696cf3e20a 100644
--- a/libdha/Makefile
+++ b/libdha/Makefile
@@ -41,7 +41,7 @@ depend:
install:
cp $(LIBNAME) $(prefix)/lib/$(LIBNAME)
- rm $(prefix)/lib/libdha.so
+ rm -f $(prefix)/lib/libdha.so
ln -sf $(LIBNAME) $(prefix)/lib/libdha.so
ldconfig
diff --git a/libvo/Makefile b/libvo/Makefile
index 6a59e36d33..bfef5b4492 100644
--- a/libvo/Makefile
+++ b/libvo/Makefile
@@ -3,10 +3,10 @@ include config.mak
LIBNAME = libvo.a
-SRCS=aspect.c aclib.c osd.c font_load.c video_out.c vo_null.c vo_pgm.c vo_md5.c vo_mpegpes.c x11_common.c $(OPTIONAL_SRCS) img_format.c
+SRCS=aspect.c aclib.c osd.c font_load.c video_out.c vo_null.c vo_pgm.c vo_md5.c vo_mpegpes.c x11_common.c $(OPTIONAL_SRCS) img_format.c vosub_vidix.c
OBJS=$(SRCS:.c=.o)
-CFLAGS = $(OPTFLAGS) -I. -I.. $(SDL_INC) $(X11_INC) $(EXTRA_INC) $(DVB_INC) -DMPG12PLAY #-Wall
+CFLAGS = $(OPTFLAGS) -I. -I.. $(SDL_INC) $(X11_INC) $(EXTRA_INC) $(DVB_INC) -DMPG12PLAY -DVIDIX_PATH='"$(prefix)/lib/mplayer/vidix/"' #-Wall
# -I/usr/X11R6/include/
.SUFFIXES: .c .o
diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c
index 2d10c8d9c9..d811a0e93d 100644
--- a/libvo/vo_vesa.c
+++ b/libvo/vo_vesa.c
@@ -35,6 +35,7 @@
#include "bswap.h"
#include "aspect.h"
#include "vesa_lvo.h"
+#include "vosub_vidix.h"
#include "../postproc/swscale.h"
#include "../postproc/rgb2rgb.h"
@@ -99,6 +100,7 @@ uint8_t multi_idx=0; /* active buffer */
/* Linux Video Overlay */
static const char *lvo_name = NULL;
+static const char *vidix_name = NULL;
static int pre_init_err = 0;
#define HAS_DGA() (win.idx == -1)
@@ -133,6 +135,7 @@ static void vesa_term( void )
{
int err;
if(lvo_name) vlvo_term();
+ else if(vidix_name) vidix_term();
if((err=vbeRestoreState(init_state)) != VBE_OK) PRINT_VBE_ERR("vbeRestoreState",err);
if((err=vbeSetMode(init_mode,NULL)) != VBE_OK) PRINT_VBE_ERR("vbeSetMode",err);
if(HAS_DGA()) vbeUnmapVideoBuffer((unsigned long)win.ptr,win.high);
@@ -330,7 +333,7 @@ static void flip_page(void)
if(!HAS_DGA()) __vbeCopyData(dga_buffer);
flip_trigger = 0;
}
- if(vo_doublebuffering && multi_size > 1 && !lvo_name)
+ if(vo_doublebuffering && multi_size > 1 && !lvo_name && !vidix_name)
{
int err;
if((err=vbeSetDisplayStart(multi_buff[multi_idx],1)) != VBE_OK)
@@ -388,7 +391,7 @@ 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) __vbeCopyData(data);
+ if((!rgb2rgb_fnc || !HAS_DGA()) && !lvo_name && !vidix_name) __vbeCopyData(data);
return 0;
}
@@ -403,7 +406,9 @@ 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() */
- else { printf("vo_vesa: Unknown subdevice: %s\n", sd); return -1; }
+ else
+ if(memcmp(sd,"vidix",5) == 0) vidix_name = &sd[5]; /* vidix_name will be valid within init() */
+ else { printf("vo_vesa: Unknown subdevice: '%s'\n", sd); return -1; }
return flags;
}
@@ -419,11 +424,16 @@ 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);
+ else if(vidix_name) pre_init_err = vidix_preinit(vidix_name);
if(verbose > 2)
printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
first = 0;
}
- if(!pre_init_err && lvo_name) return vlvo_query_info(format);
+ if(!pre_init_err)
+ {
+ if(lvo_name) return vlvo_query_info(format);
+ else if(vidix_name) return vidix_query_fourcc(format);
+ }
switch(format)
{
case IMGFMT_YV12:
@@ -706,7 +716,7 @@ 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 )
+ if(format==IMGFMT_YV12 || lvo_name || vidix_name)
{
/* software scale */
if(vesa_zoom > 1)
@@ -725,7 +735,7 @@ 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) SwScale_Init();
+ if(!lvo_name && !vidix_name) SwScale_Init();
if(verbose) printf("vo_vesa: Using SCALE\n");
}
else
@@ -734,7 +744,7 @@ 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)
+ if(format != IMGFMT_YV12 && image_bpp != video_mode_info.BitsPerPixel && !lvo_name && !vidix_name)
{
if(image_bpp == 24 && video_mode_info.BitsPerPixel == 32) rgb2rgb_fnc = rgb24to32;
else
@@ -830,7 +840,7 @@ 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)
+ if((yuv_fmt || rgb2rgb_fnc) && !lvo_name && !vidix_name)
{
if(!(dga_buffer = memalign(64,video_mode_info.XResolution*video_mode_info.YResolution*video_mode_info.BitsPerPixel)))
{
@@ -868,6 +878,20 @@ 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);
}
+ else
+ if(vidix_name)
+ {
+ if(vidix_init(width,height,x_offset,y_offset,image_width,
+ image_height,format,video_mode_info.BitsPerPixel,
+ video_mode_info.XResolution,video_mode_info.YResolution) != 0)
+ {
+ printf("vo_vesa: Can't initialize VIDIX driver\n");
+ vidix_name = NULL;
+ vesa_term();
+ return -1;
+ }
+ else printf("vo_vesa: Using VIDIX\n",lvo_name);
+ }
}
else
{
diff --git a/vidix/Makefile b/vidix/Makefile
index 0e964faa90..bd287b7131 100644
--- a/vidix/Makefile
+++ b/vidix/Makefile
@@ -1,5 +1,6 @@
-
LIBNAME = libvidix.a
+SUBDIRS = drivers
+DO_MAKE = @ for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
include ../config.mak
@@ -15,22 +16,30 @@ CFLAGS = $(OPTFLAGS) -W -Wall
.c.o:
$(CC) -c $(CFLAGS) -o $@ $<
+all: $(SUBDIRS) $(LIBNAME)
+ $(DO_MAKE)
+
$(LIBNAME): $(OBJS)
$(AR) r $(LIBNAME) $(OBJS)
-all: $(LIBNAME)
clean:
rm -f *.o *.a *~
+ $(DO_MAKE)
distclean:
rm -f test *.o *.a *~ .depend
+ $(DO_MAKE)
dep: depend
+ $(DO_MAKE)
depend:
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
+install:
+ $(DO_MAKE)
+
#
# include dependency files if they exist
#
diff --git a/vidix/drivers/Makefile b/vidix/drivers/Makefile
index 63c3da0019..ab2f026fdd 100644
--- a/vidix/drivers/Makefile
+++ b/vidix/drivers/Makefile
@@ -2,6 +2,8 @@
include ../../config.mak
+BINDIR = $(prefix)/lib/mplayer/vidix
+
RADEON_VID=radeon_vid.so
RADEON_SRCS=radeon_vid.c
@@ -26,13 +28,13 @@ $(RADEON_OBJS): $(RADEON_SRCS)
$(CC) -c $(RADEON_CFLAGS) -o $@ $<
$(RADEON_VID): $(RADEON_OBJS)
- $(CC) $(RADEON_LIBS) -shared -o $(RADEON_VID) $(RADEON_OBJS)
+ $(LD) $(RADEON_LIBS) -shared -soname $(RADEON_VID) -o $(RADEON_VID) $(RADEON_OBJS)
$(RAGE128_OBJS): $(RAGE128_SRCS)
$(CC) -c $(RAGE128_CFLAGS) -o $@ $<
$(RAGE128_VID): $(RAGE128_OBJS)
- $(CC) $(RAGE128_LIBS) -shared -o $(RAGE128_VID) $(RAGE128_OBJS)
+ $(LD) $(RAGE128_LIBS) -shared -soname $(RAGE128_VID) -o $(RAGE128_VID) $(RAGE128_OBJS)
clean:
rm -f *.o *.so *~
@@ -46,7 +48,8 @@ depend:
$(CC) -MM $(CFLAGS) $(SRCS) 1>.depend
install:
-
+ mkdir -p $(BINDIR)
+ cp *.so $(BINDIR)
#
# include dependency files if they exist
#
diff --git a/vidix/drivers/radeon_vid.c b/vidix/drivers/radeon_vid.c
index dc10ffa7a7..3ddc69c1ab 100644
--- a/vidix/drivers/radeon_vid.c
+++ b/vidix/drivers/radeon_vid.c
@@ -1,5 +1,8 @@
/*
radeon_vid - VIDIX based video driver for Radeon and Rage128 chips
+ Copyrights 2002 Nick Kurshev. This file is based on sources from
+ GATOS (gatos.sf.net) and X11 (www.xfree86.org)
+ Licence: GPL
*/
#include <linux/pci_ids.h>
@@ -25,7 +28,7 @@
#endif
#endif
-#define DEBUG 1
+static int __verbose = 0;
typedef struct bes_registers_s
{
@@ -83,9 +86,7 @@ typedef struct bes_registers_s
typedef struct video_registers_s
{
-#ifdef DEBUG
const char * sname;
-#endif
uint32_t name;
uint32_t value;
}video_registers_t;
@@ -94,12 +95,7 @@ static bes_registers_t besr;
#ifndef RAGE128
static int IsR200=0;
#endif
-#ifdef DEBUG
#define DECLARE_VREG(name) { #name, name, 0 }
-#else
-#define DECLARE_VREG(name) { name, 0 }
-#endif
-#ifdef DEBUG
static video_registers_t vregs[] =
{
DECLARE_VREG(VIDEOMUX_CNTL),
@@ -194,7 +190,7 @@ static video_registers_t vregs[] =
DECLARE_VREG(IDCT_AUTH),
DECLARE_VREG(IDCT_CONTROL)
};
-#endif
+
static void * radeon_mmio_base = 0;
static void * radeon_mem_base = 0;
static int32_t radeon_overlay_off = 0;
@@ -629,6 +625,7 @@ int vixProbe( int verbose )
pciinfo_t lst[MAX_PCI_DEVICES];
unsigned i,num_pci;
int err;
+ __verbose = verbose;
err = pci_scan(lst,&num_pci);
if(err)
{
@@ -724,7 +721,6 @@ int vixQueryFourcc(vidix_fourcc_t *to)
return ENOSYS;
}
-#ifdef DEBUG
static void radeon_vid_dump_regs( void )
{
size_t i;
@@ -738,7 +734,6 @@ static void radeon_vid_dump_regs( void )
printf(RADEON_MSG"%s = %08X\n",vregs[i].sname,INREG(vregs[i].name));
printf(RADEON_MSG"*** End of OV0 registers dump ***\n");
}
-#endif
static void radeon_vid_stop_video( void )
{
@@ -848,9 +843,7 @@ static void radeon_vid_display_video( void )
}
OUTREG(OV0_SCALE_CNTL, bes_flags);
OUTREG(OV0_REG_LOAD_CNTL, 0);
-#ifdef DEBUG
- radeon_vid_dump_regs();
-#endif
+ if(__verbose > 1) radeon_vid_dump_regs();
}
static unsigned radeon_query_pitch(unsigned fourcc)
@@ -1050,9 +1043,7 @@ int vixPlaybackFrameSel(unsigned frame)
OUTREG(OV0_VID_BUF1_BASE_ADRS, off1);
OUTREG(OV0_VID_BUF2_BASE_ADRS, off2);
OUTREG(OV0_REG_LOAD_CNTL, 0);
-#ifdef DEBUG
- radeon_vid_dump_regs();
-#endif
+ if(__verbose > 1) radeon_vid_dump_regs();
return 0;
}