summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-07 09:28:22 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-01-07 09:28:22 +0000
commit75c0b3169b79bfa85c905f87f0c77c07f04f29ad (patch)
treec2b7106529d50e759883d278bda6744af7318381 /libvo
parentcb6aa3b4a8629a9678b212c51d057171e6a19bd8 (diff)
downloadmpv-75c0b3169b79bfa85c905f87f0c77c07f04f29ad.tar.bz2
mpv-75c0b3169b79bfa85c905f87f0c77c07f04f29ad.tar.xz
Embedding vidix
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4031 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/Makefile4
-rw-r--r--libvo/vo_vesa.c40
2 files changed, 34 insertions, 10 deletions
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
{