[MPlayer-cvslog] r26762 - in trunk: DOCS/man/en/mplayer.1 DOCS/man/fr/mplayer.1 help/help_mp-en.h libvo/vo_xv.c libvo/vo_xvmc.c

ben subversion at mplayerhq.hu
Tue May 13 19:52:26 CEST 2008


Author: ben
Date: Tue May 13 19:52:25 2008
New Revision: 26762

Log:
Add a new suboption to -vo xv and -vo xvmc that allows selection
of XVideo adaptor to be used (instead of default one, which is #0).

This is useful for example if you'd rather like to use the original
Overlay renderer of your GPU instead of the texture blitting engine
(which is usually default), which is number one cause of nasty
video tearing effects.



Modified:
   trunk/libvo/vo_xv.c
   trunk/libvo/vo_xvmc.c

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1
   trunk/DOCS/man/fr/mplayer.1
   trunk/help/help_mp-en.h

Modified: trunk/libvo/vo_xv.c
==============================================================================
--- trunk/libvo/vo_xv.c	(original)
+++ trunk/libvo/vo_xv.c	Tue May 13 19:52:25 2008
@@ -724,11 +724,13 @@ static int preinit(const char *arg)
     unsigned int i;
     strarg_t ck_src_arg = { 0, NULL };
     strarg_t ck_method_arg = { 0, NULL };
+    int xv_adaptor = -1;
 
     opt_t subopts[] =
     {  
       /* name         arg type     arg var         test */
       {  "port",      OPT_ARG_INT, &xv_port,       (opt_test_f)int_pos },
+      {  "adaptor",   OPT_ARG_INT, &xv_adaptor,    (opt_test_f)int_non_neg },
       {  "ck",        OPT_ARG_STR, &ck_src_arg,    xv_test_ck },
       {  "ck-method", OPT_ARG_STR, &ck_method_arg, xv_test_ckm },
       {  NULL }
@@ -799,6 +801,10 @@ static int preinit(const char *arg)
 
     for (i = 0; i < adaptors && xv_port == 0; i++)
     {
+        /* check if adaptor number has been specified */
+        if (xv_adaptor != -1 && xv_adaptor != i)
+          continue;
+      
         if ((ai[i].type & XvInputMask) && (ai[i].type & XvImageMask))
         {
             for (xv_p = ai[i].base_id;
@@ -806,6 +812,8 @@ static int preinit(const char *arg)
                 if (!XvGrabPort(mDisplay, xv_p, CurrentTime))
                 {
                     xv_port = xv_p;
+                    mp_msg(MSGT_VO, MSGL_INFO,
+                           MSGTR_LIBVO_XV_Adaptor, i, ai[i].name);
                     break;
                 } else
                 {

Modified: trunk/libvo/vo_xvmc.c
==============================================================================
--- trunk/libvo/vo_xvmc.c	(original)
+++ trunk/libvo/vo_xvmc.c	Tue May 13 19:52:25 2008
@@ -57,6 +57,7 @@ static int use_sleep;
 static int first_frame;//draw colorkey on first frame
 static int use_queue;
 static int xv_port_request = 0;
+static int xv_adaptor = -1; 
 static int bob_deinterlace;
 static int top_field_first;
 
@@ -282,6 +283,9 @@ XvMCSurfaceInfo * mc_surf_list;
       printf("vo_xvmc: Querying %d adaptors\n",num_adaptors); }
    for(i=0; i<num_adaptors; i++)
    {
+      /* check if adaptor number has been specified */
+      if (xv_adaptor != -1 && xv_adaptor != i)
+         continue;
       if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) {
          printf("vo_xvmc: Quering adaptor #%d\n",i); }
       if( ai[i].type == 0 ) continue;// we need at least dummy type!
@@ -318,6 +322,7 @@ XvMCSurfaceInfo * mc_surf_list;
                      printf("vo_xvmc: Fail to grab port %ld\n",p); }
 	          continue;
 	       }
+	       printf("vo_xvmc: Using Xv Adaptor #%d (%s)\n", i, ai[i].name);
 	       printf("vo_xvmc: Port %ld grabed\n",p);
 	       xv_port = p;
 	    }
@@ -371,6 +376,7 @@ opt_t subopts [] =
 {  
   /* name         arg type      arg var           test */
   {  "port",      OPT_ARG_INT,  &xv_port_request, (opt_test_f)int_pos },
+  {  "adaptor",   OPT_ARG_INT,  &xv_adaptor,      (opt_test_f)int_non_neg },
   {  "ck",        OPT_ARG_STR,  &ck_src_arg,      xv_test_ck },
   {  "ck-method", OPT_ARG_STR,  &ck_method_arg,   xv_test_ckm },
   {  "benchmark", OPT_ARG_BOOL, &benchmark,       NULL },



More information about the MPlayer-cvslog mailing list