changeset 4434:e956fa7f79c7

Use new tune info
author nick
date Thu, 31 Jan 2002 10:23:39 +0000
parents df8e0f71cc3c
children c012c026d0e8
files libvo/vo_fbdev.c libvo/vo_vesa.c libvo/vo_xvidix.c libvo/vosub_vidix.c libvo/vosub_vidix.h
diffstat 5 files changed, 55 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_fbdev.c	Thu Jan 31 09:57:13 2002 +0000
+++ b/libvo/vo_fbdev.c	Thu Jan 31 10:23:39 2002 +0000
@@ -1102,7 +1102,7 @@
 		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;
--- a/libvo/vo_vesa.c	Thu Jan 31 09:57:13 2002 +0000
+++ b/libvo/vo_vesa.c	Thu Jan 31 10:23:39 2002 +0000
@@ -897,7 +897,7 @@
 		{
 		  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;
--- a/libvo/vo_xvidix.c	Thu Jan 31 09:57:13 2002 +0000
+++ b/libvo/vo_xvidix.c	Thu Jan 31 10:23:39 2002 +0000
@@ -57,6 +57,7 @@
 
 /* VIDIX related */
 static char *vidix_name;
+static vo_tune_info_t vtune;
 
 /* Image parameters */
 static uint32_t image_width;
@@ -73,7 +74,7 @@
 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 @@
 	/* 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 @@
 	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 @@
     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;
 }
--- a/libvo/vosub_vidix.c	Thu Jan 31 09:57:13 2002 +0000
+++ b/libvo/vosub_vidix.c	Thu Jan 31 10:23:39 2002 +0000
@@ -100,7 +100,7 @@
 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 @@
 	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));
--- a/libvo/vosub_vidix.h	Thu Jan 31 09:57:13 2002 +0000
+++ b/libvo/vosub_vidix.h	Thu Jan 31 10:23:39 2002 +0000
@@ -17,7 +17,7 @@
 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 );