mirror of
https://github.com/mpv-player/mpv
synced 2025-01-08 16:10:29 +00:00
Added preinit of lvo stuff
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2972 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
e4c3e3c10a
commit
0cd42028bc
@ -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,
|
||||
int vlvo_preinit(const char *drvname)
|
||||
{
|
||||
lvo_handler = open(drvname,O_RDWR);
|
||||
if(lvo_handler == -1)
|
||||
{
|
||||
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;
|
||||
lvo_handler = open(drvname,O_RDWR);
|
||||
if(lvo_handler == -1)
|
||||
{
|
||||
printf("Couldn't open %s\n",drvname);
|
||||
return -1;
|
||||
}
|
||||
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);
|
||||
|
@ -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 );
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user