[MPlayer-dev-eng] [PATCH] vo_dfbmga tvnorm + fieldparity verbosity patch

Ville Syrjälä syrjala at sci.fi
Mon Feb 9 10:45:46 CET 2004


Here's the whole vo_dfbmga patch as per Alex's request.

Adds the tvnorm option.
Gives user some feedback about field parity setting.

-- 
Ville Syrjälä
syrjala at sci.fi
http://www.sci.fi/~syrjala/
-------------- next part --------------
Index: libvo/vo_dfbmga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dfbmga.c,v
retrieving revision 1.14
diff -u -r1.14 vo_dfbmga.c
--- libvo/vo_dfbmga.c	28 Jan 2004 10:19:49 -0000	1.14
+++ libvo/vo_dfbmga.c	9 Feb 2004 09:37:31 -0000
@@ -92,6 +92,7 @@
 static int field_parity;
 static int flipping;
 static DFBDisplayLayerBufferMode buffermode;
+static int tvnorm;
 
 static int osd_changed;
 static int osd_dirty;
@@ -242,6 +243,7 @@
      osd_max = 2;
 #endif
      flipping = 1;
+     tvnorm = -1;
 
      use_input = !getenv( "DISPLAY" );
 
@@ -308,6 +310,26 @@
                          break;
                     }
                     opt_no = 0;
+               } else if (!strncmp(vo_subdevice, "tvnorm=", 7)) {
+                    if (opt_no) {
+                         show_help = 1;
+                         break;
+                    }
+                    vo_subdevice += 7;
+                    if (!strncmp(vo_subdevice, "pal", 3)) {
+                         tvnorm = 0;
+                         vo_subdevice += 3;
+                    } else if (!strncmp(vo_subdevice, "ntsc" , 4)) {
+                         tvnorm = 1;
+                         vo_subdevice += 4;
+                    } else if (!strncmp(vo_subdevice, "auto" , 4)) {
+                         tvnorm = 2;
+                         vo_subdevice += 4;
+                    } else {
+                         show_help = 1;
+                         break;
+                    }
+                    opt_no = 0;
                } else if (!strncmp(vo_subdevice, "no", 2)) {
                     if (opt_no) {
                          show_help = 1;
@@ -344,6 +366,10 @@
                        "  fieldparity=(top|bottom)\n"
                        "    top      Top field first\n"
                        "    bottom   Bottom field first\n"
+                       "  tvnorm=(pal|ntsc|auto)\n"
+                       "    pal      Force PAL\n"
+                       "    ntsc     Force NTSC\n"
+                       "    auto     Select according to FPS\n"
                        "\n" );
                return -1;
           }
@@ -366,6 +392,28 @@
           DirectFBSetOption( "no-cursor", "" );
           DirectFBSetOption( "bg-color", "00000000" );
 
+          switch (tvnorm) {
+          case 0:
+               DirectFBSetOption( "matrox-tv-standard", "pal" );
+               mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to PAL\n" );
+               break;
+          case 1:
+               DirectFBSetOption( "matrox-tv-standard", "ntsc" );
+               mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Forced TV standard to NTSC\n" );
+               break;
+          case 2:
+               if (vo_fps > 27) {
+                    DirectFBSetOption( "matrox-tv-standard", "ntsc" );
+                    mp_msg( MSGT_VO, MSGL_INFO,
+                            "vo_dfbmga: Selected TV standard based upon FPS: NTSC\n" );
+               } else {
+                    DirectFBSetOption( "matrox-tv-standard", "pal" );
+                    mp_msg( MSGT_VO, MSGL_INFO,
+                            "vo_dfbmga: Selected TV standard based upon FPS: PAL\n" );
+               }
+               break;
+          }
+
           if ((res = DirectFBCreate( &dfb )) != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR,
                        "vo_dfbmga: DirectFBCreate() failed - %s\n",
@@ -590,6 +638,18 @@
                dlc.options |= DLOP_FIELD_PARITY;
           }
 #endif
+          mp_msg( MSGT_VO, MSGL_INFO, "vo_dfbmga: Field parity set to: ");
+          switch (field_parity) {
+          case -1:
+               mp_msg( MSGT_VO, MSGL_INFO, "Don't care\n");
+               break;
+          case 0:
+               mp_msg( MSGT_VO, MSGL_INFO, "Top field first\n");
+               break;
+          case 1:
+               mp_msg( MSGT_VO, MSGL_INFO, "Bottom field first\n");
+               break;
+          }
 
           switch (dlc.pixelformat) {
           case DSPF_I420:


More information about the MPlayer-dev-eng mailing list