[Mplayer-cvslog] CVS: main/libvo Makefile,1.26,1.27 vo_vesa.c,1.54,1.55 vo_fbdev.c,1.51,1.52
Nick Kurshev
nick at mplayer.dev.hu
Fri Jan 11 18:20:45 CET 2002
Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv23869/main/libvo
Modified Files:
Makefile vo_vesa.c vo_fbdev.c
Log Message:
Configurable VIDIX usage
Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/Makefile,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- Makefile 11 Jan 2002 16:06:45 -0000 1.26
+++ Makefile 11 Jan 2002 17:20:43 -0000 1.27
@@ -3,10 +3,17 @@
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
Index: vo_vesa.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_vesa.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- vo_vesa.c 10 Jan 2002 18:01:19 -0000 1.54
+++ vo_vesa.c 11 Jan 2002 17:20:43 -0000 1.55
@@ -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 @@
/* 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 @@
{
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
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 @@
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 @@
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 @@
}
else printf("vo_vesa: Using video overlay: %s\n",lvo_name);
}
+#ifdef CONFIG_VIDIX
else
if(vidix_name)
{
@@ -892,6 +929,7 @@
}
else printf("vo_vesa: Using VIDIX\n");
}
+#endif
}
else
{
Index: vo_fbdev.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- vo_fbdev.c 10 Jan 2002 18:02:45 -0000 1.51
+++ vo_fbdev.c 11 Jan 2002 17:20:43 -0000 1.52
@@ -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 @@
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 @@
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 @@
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 @@
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 @@
}
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 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 @@
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 @@
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
}
More information about the MPlayer-cvslog
mailing list