mirror of
https://github.com/mpv-player/mpv
synced 2025-02-26 02:05:31 +00: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:
parent
b587a3d642
commit
9bf9892bd3
@ -1102,7 +1102,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
|
|||||||
else y_offset = 0;
|
else y_offset = 0;
|
||||||
if(vidix_init(width,height,x_offset,y_offset,image_width,
|
if(vidix_init(width,height,x_offset,y_offset,image_width,
|
||||||
image_height,format,fb_bpp,
|
image_height,format,fb_bpp,
|
||||||
fb_xres,fb_yres) != 0)
|
fb_xres,fb_yres,info) != 0)
|
||||||
{
|
{
|
||||||
printf(FBDEV "Can't initialize VIDIX driver\n");
|
printf(FBDEV "Can't initialize VIDIX driver\n");
|
||||||
vidix_name = NULL;
|
vidix_name = NULL;
|
||||||
|
@ -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,
|
if(vidix_init(width,height,x_offset,y_offset,image_width,
|
||||||
image_height,format,video_mode_info.BitsPerPixel,
|
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");
|
printf("vo_vesa: Can't initialize VIDIX driver\n");
|
||||||
vidix_name = NULL;
|
vidix_name = NULL;
|
||||||
|
@ -57,6 +57,7 @@ static vidix_grkey_t gr_key;
|
|||||||
|
|
||||||
/* VIDIX related */
|
/* VIDIX related */
|
||||||
static char *vidix_name;
|
static char *vidix_name;
|
||||||
|
static vo_tune_info_t vtune;
|
||||||
|
|
||||||
/* Image parameters */
|
/* Image parameters */
|
||||||
static uint32_t image_width;
|
static uint32_t image_width;
|
||||||
@ -73,7 +74,7 @@ static Window mRoot;
|
|||||||
static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
|
static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth,
|
||||||
drwDepth, drwcX, drwcY, dwidth, dheight, mFullscreen;
|
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
|
#ifdef HAVE_NEW_GUI
|
||||||
if (vo_window != None)
|
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! */
|
/* FIXME: implement runtime resize/move if possible, this way is very ugly! */
|
||||||
vidix_stop();
|
vidix_stop();
|
||||||
if (vidix_init(image_width, image_height, window_x, window_y,
|
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",
|
mp_msg(MSGT_VO, MSGL_FATAL, "Can't initialize VIDIX driver: %s: %s\n",
|
||||||
vidix_name, strerror(errno));
|
vidix_name, strerror(errno));
|
||||||
@ -363,8 +365,9 @@ else
|
|||||||
vidix_grkey_set(&gr_key);
|
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
|
#ifdef HAVE_NEW_GUI
|
||||||
if (vo_window == None)
|
if (vo_window == None)
|
||||||
#endif
|
#endif
|
||||||
@ -388,7 +391,7 @@ static void check_events(void)
|
|||||||
const int event = vo_x11_check_events(mDisplay);
|
const int event = vo_x11_check_events(mDisplay);
|
||||||
|
|
||||||
if ((event & VO_EVENT_RESIZE) || (event & VO_EVENT_EXPOSE))
|
if ((event & VO_EVENT_RESIZE) || (event & VO_EVENT_EXPOSE))
|
||||||
set_window(0);
|
set_window(0,&vtune);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ int vidix_preinit(const char *drvname,void *server)
|
|||||||
int vidix_init(unsigned src_width,unsigned src_height,
|
int vidix_init(unsigned src_width,unsigned src_height,
|
||||||
unsigned x_org,unsigned y_org,unsigned dst_width,
|
unsigned x_org,unsigned y_org,unsigned dst_width,
|
||||||
unsigned dst_height,unsigned format,unsigned dest_bpp,
|
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;
|
size_t i,awidth;
|
||||||
int err;
|
int err;
|
||||||
@ -166,6 +166,49 @@ int vidix_init(unsigned src_width,unsigned src_height,
|
|||||||
vidix_play.dest.w = dst_width;
|
vidix_play.dest.w = dst_width;
|
||||||
vidix_play.dest.h = dst_height;
|
vidix_play.dest.h = dst_height;
|
||||||
vidix_play.num_frames=NUM_FRAMES;
|
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)
|
if((err=vdlConfigPlayback(vidix_handler,&vidix_play))!=0)
|
||||||
{
|
{
|
||||||
printf("vosub_vidix: Can't configure playback: %s\n",strerror(err));
|
printf("vosub_vidix: Can't configure playback: %s\n",strerror(err));
|
||||||
|
@ -17,7 +17,7 @@ int vidix_preinit(const char *drvname,void *server);
|
|||||||
int vidix_init(unsigned src_width,unsigned src_height,
|
int vidix_init(unsigned src_width,unsigned src_height,
|
||||||
unsigned dest_x,unsigned dest_y,unsigned dst_width,
|
unsigned dest_x,unsigned dest_y,unsigned dst_width,
|
||||||
unsigned dst_height,unsigned format,unsigned dest_bpp,
|
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_start(void);
|
||||||
int vidix_stop(void);
|
int vidix_stop(void);
|
||||||
void vidix_term( void );
|
void vidix_term( void );
|
||||||
|
Loading…
Reference in New Issue
Block a user