summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-18 15:06:32 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-18 15:06:32 +0000
commit0cd42028bccf221e4cc896183f6d41c9fbf3f686 (patch)
tree1c400ac5a6f91942a2d888801ccc855474be765a /libvo
parente4c3e3c10a5f3b18b9de90a68073441fd765e2dd (diff)
downloadmpv-0cd42028bccf221e4cc896183f6d41c9fbf3f686.tar.bz2
mpv-0cd42028bccf221e4cc896183f6d41c9fbf3f686.tar.xz
Added preinit of lvo stuff
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2972 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vesa_lvo.c19
-rw-r--r--libvo/vesa_lvo.h4
-rw-r--r--libvo/vo_vesa.c23
3 files changed, 34 insertions, 12 deletions
diff --git a/libvo/vesa_lvo.c b/libvo/vesa_lvo.c
index debe2d3d89..f4c5622857 100644
--- a/libvo/vesa_lvo.c
+++ b/libvo/vesa_lvo.c
@@ -40,17 +40,22 @@ extern int verbose;
#define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) )
#define IMAGE_LINE_SIZE(pixel_size) (image_width*(pixel_size))
-int vlvo_init(const char *drvname,unsigned src_width,unsigned src_height,
- unsigned x_org,unsigned y_org,unsigned dst_width,
- unsigned dst_height,unsigned format,unsigned dest_bpp)
+int vlvo_preinit(const char *drvname)
{
- size_t i,awidth;
lvo_handler = open(drvname,O_RDWR);
if(lvo_handler == -1)
{
- printf("Couldn't open %s\n",drvname);
+ printf("vesa_lvo: Couldn't open '%s'\n",drvname);
return -1;
}
+ return 0;
+}
+
+int vlvo_init(unsigned src_width,unsigned src_height,
+ unsigned x_org,unsigned y_org,unsigned dst_width,
+ unsigned dst_height,unsigned format,unsigned dest_bpp)
+{
+ size_t i,awidth;
image_width = src_width;
image_height = src_height;
mga_vid_config.version=MGA_VID_VERSION;
@@ -99,8 +104,8 @@ int vlvo_init(const char *drvname,unsigned src_width,unsigned src_height,
mga_vid_config.num_frames=NUM_FRAMES;
if (ioctl(lvo_handler,MGA_VID_CONFIG,&mga_vid_config))
{
- perror("Error in mga_vid_config ioctl()");
- printf("Your mga_vid driver version is incompatible with this MPlayer version!\n");
+ perror("vesa_lvo: Error in mga_vid_config ioctl()");
+ printf("vesa_lvo: Your fb_vid driver version is incompatible with this MPlayer version!\n");
return -1;
}
ioctl(lvo_handler,MGA_VID_ON,0);
diff --git a/libvo/vesa_lvo.h b/libvo/vesa_lvo.h
index cbff4e0810..4beed9a224 100644
--- a/libvo/vesa_lvo.h
+++ b/libvo/vesa_lvo.h
@@ -12,7 +12,9 @@
#ifndef __VESA_LVO_INCLUDED
#define __VESA_LVO_INCLUDED
-int vlvo_init(const char *drvname,unsigned src_width,unsigned src_height,
+int vlvo_preinit(
+const char *drvname);
+int vlvo_init(unsigned src_width,unsigned src_height,
unsigned x_org,unsigned y_org,unsigned dst_width,
unsigned dst_height,unsigned format,unsigned dest_bpp);
void vlvo_term( void );
diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c
index 68c6ca2223..ef651a25dd 100644
--- a/libvo/vo_vesa.c
+++ b/libvo/vo_vesa.c
@@ -98,6 +98,7 @@ uint8_t multi_idx=0; /* active buffer */
/* Linux Video Overlay */
static const char *lvo_name = NULL;
+static int pre_init_err = 0;
#define HAS_DGA() (win.idx == -1)
#define MOVIE_MODE (MODE_ATTR_COLOR | MODE_ATTR_GRAPHICS)
@@ -412,14 +413,23 @@ static uint32_t parseSubDevice(const char *sd)
return flags;
}
-
static uint32_t query_format(uint32_t format)
{
+ static int first = 1;
uint32_t retval;
if(verbose > 2)
printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format));
- if(vo_subdevice) parseSubDevice(vo_subdevice);
- if(lvo_name) return 1;
+ if(first)
+ {
+ if(verbose > 2)
+ 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);
+ 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);
switch(format)
{
case IMGFMT_YV12:
@@ -543,6 +553,11 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3
fs_mode = 0;
rgb2rgb_fnc = NULL;
sd_flags = 0;
+ if(pre_init_err)
+ {
+ printf("vo_vesa: initialization have been terminated due wrong preinitialization\n");
+ return -1;
+ }
if(vo_subdevice) sd_flags = parseSubDevice(vo_subdevice);
if(sd_flags == -1) return -1;
if(flags & 0x8)
@@ -850,7 +865,7 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3
}
if(lvo_name)
{
- if(vlvo_init(lvo_name,width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0)
+ if(vlvo_init(width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0)
{
printf("vo_vesa: Can't initialize Linux Video Overlay\n");
lvo_name = NULL;