1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

Use new tune info

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4435 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nick 2002-01-31 10:23:39 +00:00
parent b587a3d642
commit 9bf9892bd3
5 changed files with 55 additions and 9 deletions

View File

@ -1102,7 +1102,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
else y_offset = 0;
if(vidix_init(width,height,x_offset,y_offset,image_width,
image_height,format,fb_bpp,
fb_xres,fb_yres) != 0)
fb_xres,fb_yres,info) != 0)
{
printf(FBDEV "Can't initialize VIDIX driver\n");
vidix_name = NULL;

View File

@ -897,7 +897,7 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
{
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)
video_mode_info.XResolution,video_mode_info.YResolution,info) != 0)
{
printf("vo_vesa: Can't initialize VIDIX driver\n");
vidix_name = NULL;

View File

@ -57,6 +57,7 @@ static vidix_grkey_t gr_key;
/* VIDIX related */
static char *vidix_name;
static vo_tune_info_t vtune;
/* Image parameters */
static uint32_t image_width;
@ -73,7 +74,7 @@ static Window mRoot;
static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
drwDepth, drwcX, drwcY, dwidth, dheight, mFullscreen;
static void set_window(int force_update)
static void set_window(int force_update,const vo_tune_info_t *info)
{
#ifdef HAVE_NEW_GUI
if (vo_window != None)
@ -154,7 +155,8 @@ static void set_window(int force_update)
/* FIXME: implement runtime resize/move if possible, this way is very ugly! */
vidix_stop();
if (vidix_init(image_width, image_height, window_x, window_y,
window_width, window_height, image_format, vo_depthonscreen, vo_screenwidth, vo_screenheight) != 0)
window_width, window_height, image_format, vo_depthonscreen,
vo_screenwidth, vo_screenheight,info) != 0)
{
mp_msg(MSGT_VO, MSGL_FATAL, "Can't initialize VIDIX driver: %s: %s\n",
vidix_name, strerror(errno));
@ -363,8 +365,9 @@ else
vidix_grkey_set(&gr_key);
}
set_window(1);
set_window(1,info);
if(info) memcpy(&vtune,info,sizeof(vo_tune_info_t));
else memset(&vtune,0,sizeof(vo_tune_info_t));
#ifdef HAVE_NEW_GUI
if (vo_window == None)
#endif
@ -388,7 +391,7 @@ static void check_events(void)
const int event = vo_x11_check_events(mDisplay);
if ((event & VO_EVENT_RESIZE) || (event & VO_EVENT_EXPOSE))
set_window(0);
set_window(0,&vtune);
return;
}

View File

@ -100,7 +100,7 @@ int vidix_preinit(const char *drvname,void *server)
int vidix_init(unsigned src_width,unsigned src_height,
unsigned x_org,unsigned y_org,unsigned dst_width,
unsigned dst_height,unsigned format,unsigned dest_bpp,
unsigned vid_w,unsigned vid_h)
unsigned vid_w,unsigned vid_h,const void *info)
{
size_t i,awidth;
int err;
@ -166,6 +166,49 @@ int vidix_init(unsigned src_width,unsigned src_height,
vidix_play.dest.w = dst_width;
vidix_play.dest.h = dst_height;
vidix_play.num_frames=NUM_FRAMES;
vidix_play.src.pitch.y = vidix_play.src.pitch.u = vidix_play.src.pitch.v = 0;
if(info)
{
switch(((const vo_tune_info_t *)info)->pitch[0])
{
case 2:
case 4:
case 8:
case 16:
case 32:
case 64:
case 128:
case 256: vidix_play.src.pitch.y = ((const vo_tune_info_t *)info)->pitch[0];
break;
default: break;
}
switch(((const vo_tune_info_t *)info)->pitch[1])
{
case 2:
case 4:
case 8:
case 16:
case 32:
case 64:
case 128:
case 256: vidix_play.src.pitch.u = ((const vo_tune_info_t *)info)->pitch[1];
break;
default: break;
}
switch(((const vo_tune_info_t *)info)->pitch[2])
{
case 2:
case 4:
case 8:
case 16:
case 32:
case 64:
case 128:
case 256: vidix_play.src.pitch.v = ((const vo_tune_info_t *)info)->pitch[2];
break;
default: break;
}
}
if((err=vdlConfigPlayback(vidix_handler,&vidix_play))!=0)
{
printf("vosub_vidix: Can't configure playback: %s\n",strerror(err));

View File

@ -17,7 +17,7 @@ int vidix_preinit(const char *drvname,void *server);
int vidix_init(unsigned src_width,unsigned src_height,
unsigned dest_x,unsigned dest_y,unsigned dst_width,
unsigned dst_height,unsigned format,unsigned dest_bpp,
unsigned vid_w,unsigned vid_h);
unsigned vid_w,unsigned vid_h,const void *info);
int vidix_start(void);
int vidix_stop(void);
void vidix_term( void );