mirror of https://github.com/mpv-player/mpv
Configurable VIDIX usage
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4090 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
940ceca1e7
commit
b986aebcc5
28
Makefile
28
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)
|
||||
|
|
|
@ -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 <<EOF
|
||||
You've disabled VIDIX. Although it would be better to PORT it instead.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
EOF
|
||||
fi
|
||||
|
||||
# Last move:
|
||||
rm -f "$TMPO" "$TMPC" "$TMPS" "$TMPCPP"
|
||||
|
||||
|
|
|
@ -3,10 +3,17 @@ 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 vosub_vidix.c sub.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 sub.c
|
||||
OBJS=$(SRCS:.c=.o)
|
||||
|
||||
CFLAGS = $(OPTFLAGS) -I. -I.. $(SDL_INC) $(X11_INC) $(EXTRA_INC) $(DVB_INC) -DMPG12PLAY -DVIDIX_PATH='"$(prefix)/lib/mplayer/vidix/"' #-Wall
|
||||
ifeq ($(VIDIX),yes)
|
||||
SRCS += vosub_vidix.c
|
||||
endif
|
||||
|
||||
CFLAGS = $(OPTFLAGS) -I. -I.. $(SDL_INC) $(X11_INC) $(EXTRA_INC) $(DVB_INC) -DMPG12PLAY #-Wall
|
||||
ifeq ($(VIDIX),yes)
|
||||
CFLAGS += -DVIDIX_PATH='"$(prefix)/lib/mplayer/vidix/"'
|
||||
endif
|
||||
# -I/usr/X11R6/include/
|
||||
|
||||
.SUFFIXES: .c .o
|
||||
|
|
|
@ -28,7 +28,9 @@
|
|||
#include "fastmemcpy.h"
|
||||
#include "sub.h"
|
||||
#include "../postproc/rgb2rgb.h"
|
||||
#ifdef CONFIG_VIDIX
|
||||
#include "vosub_vidix.h"
|
||||
#endif
|
||||
#include "aspect.h"
|
||||
|
||||
LIBVO_EXTERN(fbdev)
|
||||
|
@ -42,10 +44,11 @@ static vo_info_t vo_info = {
|
|||
|
||||
extern int verbose;
|
||||
|
||||
#ifdef CONFIG_VIDIX
|
||||
/* Name of VIDIX driver */
|
||||
static const char *vidix_name = NULL;
|
||||
static int pre_init_err = 0;
|
||||
|
||||
#endif
|
||||
/******************************
|
||||
* fb.modes support *
|
||||
******************************/
|
||||
|
@ -730,13 +733,14 @@ struct fb_cmap *make_directcolor_cmap(struct fb_var_screeninfo *var)
|
|||
return cmap;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_VIDIX
|
||||
static uint32_t parseSubDevice(const char *sd)
|
||||
{
|
||||
if(memcmp(sd,"vidix",5) == 0) vidix_name = &sd[5]; /* vidix_name will be valid within init() */
|
||||
else { printf(FBDEV "Unknown subdevice: '%s'\n", sd); return -1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static int fb_preinit(void)
|
||||
{
|
||||
|
@ -906,7 +910,11 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
|
|||
if (!fb_preinit())
|
||||
return 1;
|
||||
|
||||
if (zoom && !vidix_name) {
|
||||
if (zoom
|
||||
#ifdef CONFIG_VIDIX
|
||||
&& !vidix_name
|
||||
#endif
|
||||
) {
|
||||
printf(FBDEV "-zoom is not supported\n");
|
||||
return 1;
|
||||
}
|
||||
|
@ -1062,6 +1070,7 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
|
|||
fb_size = fb_finfo.smem_len;
|
||||
frame_buffer = NULL;
|
||||
next_frame = NULL;
|
||||
#ifdef CONFIG_VIDIX
|
||||
if(vidix_name)
|
||||
{
|
||||
unsigned image_width,image_height,x_offset,y_offset;
|
||||
|
@ -1099,6 +1108,7 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
|
|||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
if ((frame_buffer = (uint8_t *) mmap(0, fb_size, PROT_READ | PROT_WRITE,
|
||||
MAP_SHARED, fb_dev_fd, 0)) == (uint8_t *) -1) {
|
||||
|
@ -1143,11 +1153,14 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
|
|||
|
||||
static uint32_t query_format(uint32_t format)
|
||||
{
|
||||
#ifdef CONFIG_VIDIX
|
||||
static int first = 1;
|
||||
#endif
|
||||
int ret = 0x4; /* osd/sub is supported on every bpp */
|
||||
|
||||
if (!fb_preinit())
|
||||
return 0;
|
||||
#ifdef CONFIG_VIDIX
|
||||
if(first)
|
||||
{
|
||||
first = 1;
|
||||
|
@ -1159,6 +1172,7 @@ static uint32_t query_format(uint32_t format)
|
|||
if(!pre_init_err)
|
||||
if(vidix_name)
|
||||
return vidix_query_fourcc(format);
|
||||
#endif
|
||||
if ((format & IMGFMT_BGR_MASK) == IMGFMT_BGR) {
|
||||
int bpp = format & 0xff;
|
||||
|
||||
|
@ -1280,6 +1294,8 @@ static void uninit(void)
|
|||
close(fb_tty_fd);
|
||||
close(fb_dev_fd);
|
||||
if(frame_buffer) munmap(frame_buffer, fb_size);
|
||||
#ifdef CONFIG_VIDIX
|
||||
if(vidix_name) vidix_term();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,9 @@
|
|||
#include "bswap.h"
|
||||
#include "aspect.h"
|
||||
#include "vesa_lvo.h"
|
||||
#ifdef CONFIG_VIDIX
|
||||
#include "vosub_vidix.h"
|
||||
#endif
|
||||
|
||||
#include "../postproc/swscale.h"
|
||||
#include "../postproc/rgb2rgb.h"
|
||||
|
@ -100,7 +102,9 @@ uint8_t multi_idx=0; /* active buffer */
|
|||
|
||||
/* Linux Video Overlay */
|
||||
static const char *lvo_name = NULL;
|
||||
#ifdef CONFIG_VIDIX
|
||||
static const char *vidix_name = NULL;
|
||||
#endif
|
||||
static int pre_init_err = 0;
|
||||
|
||||
#define HAS_DGA() (win.idx == -1)
|
||||
|
@ -135,7 +139,9 @@ static void vesa_term( void )
|
|||
{
|
||||
int err;
|
||||
if(lvo_name) vlvo_term();
|
||||
#ifdef CONFIG_VIDIX
|
||||
else if(vidix_name) vidix_term();
|
||||
#endif
|
||||
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);
|
||||
|
@ -333,7 +339,11 @@ static void flip_page(void)
|
|||
if(!HAS_DGA()) __vbeCopyData(dga_buffer);
|
||||
flip_trigger = 0;
|
||||
}
|
||||
if(vo_doublebuffering && multi_size > 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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue