[MPlayer-cvslog] r27625 - trunk/libvo/vo_dfbmga.c

syrjala subversion at mplayerhq.hu
Mon Sep 15 22:45:17 CEST 2008


Author: syrjala
Date: Mon Sep 15 22:45:17 2008
New Revision: 27625

Log:
Cosmetics:
- Convert tabs to spaces
- Remove trailing whitespace
- Remove useless comments


Modified:
   trunk/libvo/vo_dfbmga.c

Modified: trunk/libvo/vo_dfbmga.c
==============================================================================
--- trunk/libvo/vo_dfbmga.c	(original)
+++ trunk/libvo/vo_dfbmga.c	Mon Sep 15 22:45:17 2008
@@ -49,13 +49,6 @@ static const vo_info_t info = {
 
 const LIBVO_EXTERN(dfbmga)
 
-/******************************
-*	   directfb 	      *
-******************************/
-
-/*
- * (Globals)
- */
 static IDirectFB *dfb;
 
 static IDirectFBDisplayLayer *crtc1;
@@ -110,10 +103,6 @@ static int osd_max;
 
 static int is_g200;
 
-/******************************
-*	    vo_dfbmga         *
-******************************/
-
 #if DIRECTFBVERSION < DFB_VERSION(0,9,18)
  #define DSPF_ALUT44 DSPF_LUT8
  #define DLBM_TRIPLE ~0
@@ -141,19 +130,19 @@ pixelformat_name( DFBSurfacePixelFormat 
      case DSPF_RGB32:
           return "RGB32";
      case DSPF_RGB16:
-	  return "RGB16";
+          return "RGB16";
      case DSPF_ARGB1555:
-	  return "ARGB1555";
+          return "ARGB1555";
      case DSPF_YUY2:
-	  return "YUY2";
+          return "YUY2";
      case DSPF_UYVY:
-	  return "UYVY";
+          return "UYVY";
      case DSPF_YV12:
-	  return "YV12";
+          return "YV12";
      case DSPF_I420:
-	  return "I420";
+          return "I420";
      case DSPF_ALUT44:
-	  return "ALUT44";
+          return "ALUT44";
 #if DIRECTFBVERSION > DFB_VERSION(0,9,21)
      case DSPF_NV12:
           return "NV12";
@@ -161,7 +150,7 @@ pixelformat_name( DFBSurfacePixelFormat 
           return "NV21";
 #endif
      default:
-	  return "Unknown pixel format";
+          return "Unknown pixel format";
      }
 }
 
@@ -170,17 +159,17 @@ imgfmt_to_pixelformat( uint32_t format )
 {
      switch (format) {
      case IMGFMT_BGR32:
-	  return DSPF_RGB32;
+          return DSPF_RGB32;
      case IMGFMT_BGR16:
-	  return DSPF_RGB16;
+          return DSPF_RGB16;
      case IMGFMT_BGR15:
-	  return DSPF_ARGB1555;
+          return DSPF_ARGB1555;
      case IMGFMT_YUY2:
-	  return DSPF_YUY2;
+          return DSPF_YUY2;
      case IMGFMT_UYVY:
-	  return DSPF_UYVY;
+          return DSPF_UYVY;
      case IMGFMT_YV12:
-	  return DSPF_YV12;
+          return DSPF_YV12;
      case IMGFMT_I420:
      case IMGFMT_IYUV:
           return DSPF_I420;
@@ -191,7 +180,7 @@ imgfmt_to_pixelformat( uint32_t format )
           return DSPF_NV21;
 #endif
      default:
-	  return DSPF_UNKNOWN;
+          return DSPF_UNKNOWN;
      }
 }
 
@@ -360,7 +349,7 @@ preinit( const char *arg )
                     show_help = 1;
                     break;
                }
-               }
+          }
           if (show_help) {
                mp_msg( MSGT_VO, MSGL_ERR,
                        "\nvo_dfbmga command line help:\n"
@@ -389,49 +378,49 @@ preinit( const char *arg )
           }
      }
      if (!use_bes && !use_crtc1 && !use_crtc2) {
-	  mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: No output selected\n" );
+          mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: No output selected\n" );
           return -1;
      }
      if (use_bes && use_crtc1) {
-	  mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Both BES and CRTC1 outputs selected\n" );
+          mp_msg( MSGT_VO, MSGL_ERR, "vo_dfbmga: Both BES and CRTC1 outputs selected\n" );
           return -1;
      }
 
-          if ((res = DirectFBInit( NULL, NULL )) != DFB_OK) {
-               mp_msg( MSGT_VO, MSGL_ERR,
-                       "vo_dfbmga: DirectFBInit() failed - %s\n",
-                       DirectFBErrorString( res ) );
-               return -1;
-          }
+     if ((res = DirectFBInit( NULL, NULL )) != DFB_OK) {
+          mp_msg( MSGT_VO, MSGL_ERR,
+                  "vo_dfbmga: DirectFBInit() failed - %s\n",
+                  DirectFBErrorString( res ) );
+          return -1;
+     }
 
-          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:
+     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: 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;
+               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",
-                       DirectFBErrorString( res ) );
-               return -1;
-          }
+     if ((res = DirectFBCreate( &dfb )) != DFB_OK) {
+          mp_msg( MSGT_VO, MSGL_ERR,
+                  "vo_dfbmga: DirectFBCreate() failed - %s\n",
+                  DirectFBErrorString( res ) );
+          return -1;
+     }
 
      if (use_crtc1 || use_bes) {
           struct layer_enum l = {
@@ -556,7 +545,7 @@ preinit( const char *arg )
                return -1;
           }
      }
-     
+
      return 0;
 }
 
@@ -578,7 +567,7 @@ static void release_config( void )
           bufs[1]->Release( bufs[1] );
      if (bufs[2])
           bufs[2]->Release( bufs[2] );
-     
+
      spicframe = NULL;
      spic = NULL;
      c2frame = NULL;
@@ -594,7 +583,7 @@ config( uint32_t width, uint32_t height,
         uint32_t d_width, uint32_t d_height,
         uint32_t flags,
         char *title,
-	uint32_t format )
+        uint32_t format )
 {
      DFBResult res;
 
@@ -666,7 +655,7 @@ config( uint32_t width, uint32_t height,
           dlc.flags       = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT | DLCONF_BUFFERMODE;
           dlc.width       = besrect.w + besrect.x * 2;
           dlc.height      = besrect.h + besrect.y * 2;
-               dlc.buffermode = buffermode;
+          dlc.buffermode  = buffermode;
 
           if ((res = bes->TestConfiguration( bes, &dlc, &failed )) != DFB_OK) {
                mp_msg( MSGT_VO, MSGL_ERR,
@@ -964,33 +953,33 @@ static int
 query_format( uint32_t format )
 {
      switch (format) {
-          case IMGFMT_YV12:
-          case IMGFMT_I420:
-          case IMGFMT_IYUV:
-               if (is_g200 || use_crtc1)
-                    return 0;
-               break;
-          case IMGFMT_BGR32:
-          case IMGFMT_BGR16:
-          case IMGFMT_BGR15:
-               if (is_g200 && use_bes)
-                    return 0;
-               break;
-          case IMGFMT_UYVY:
-               if (is_g200)
-                    return 0;
-               break;
-          case IMGFMT_YUY2:
-               break;
+     case IMGFMT_YV12:
+     case IMGFMT_I420:
+     case IMGFMT_IYUV:
+          if (is_g200 || use_crtc1)
+               return 0;
+          break;
+     case IMGFMT_BGR32:
+     case IMGFMT_BGR16:
+     case IMGFMT_BGR15:
+          if (is_g200 && use_bes)
+               return 0;
+          break;
+     case IMGFMT_UYVY:
+          if (is_g200)
+               return 0;
+          break;
+     case IMGFMT_YUY2:
+          break;
 #if DIRECTFBVERSION > DFB_VERSION(0,9,21)
-          case IMGFMT_NV12:
-          case IMGFMT_NV21:
-               if (use_crtc1 || use_crtc2)
-                    return 0;
-               break;
-#endif
-          default:
+     case IMGFMT_NV12:
+     case IMGFMT_NV21:
+          if (use_crtc1 || use_crtc2)
                return 0;
+          break;
+#endif
+     default:
+          return 0;
      }
 
      return  VFCAP_HWSCALE_UP |
@@ -1002,11 +991,11 @@ query_format( uint32_t format )
 
 static void
 vo_draw_alpha_alut44( int w, int h,
-                    unsigned char* src,
-                    unsigned char *srca,
-                    int srcstride,
-                    unsigned char* dst,
-                    int dststride )
+                      unsigned char* src,
+                      unsigned char *srca,
+                      int srcstride,
+                      unsigned char* dst,
+                      int dststride )
 {
      int x;
 
@@ -1033,7 +1022,7 @@ static void
 draw_alpha( int x0, int y0,
             int w, int h,
             unsigned char *src,
-	    unsigned char *srca,
+            unsigned char *srca,
             int stride )
 {
      uint8_t *dst;
@@ -1060,44 +1049,44 @@ draw_alpha( int x0, int y0,
      case DSPF_ALUT44:
           vo_draw_alpha_alut44( w, h, src, srca, stride,
                                 dst + pitch * y0 + x0,
-                              pitch );
+                                pitch );
           break;
      case DSPF_RGB32:
      case DSPF_ARGB:
-	  vo_draw_alpha_rgb32( w, h, src, srca, stride,
+          vo_draw_alpha_rgb32( w, h, src, srca, stride,
                                dst + pitch * y0 + 4 * x0,
                                pitch );
-	  break;
+          break;
      case DSPF_RGB16:
-	  vo_draw_alpha_rgb16( w, h, src, srca, stride,
+          vo_draw_alpha_rgb16( w, h, src, srca, stride,
                                dst + pitch * y0 + 2 * x0,
                                pitch );
-	  break;
+          break;
      case DSPF_ARGB1555:
-	  vo_draw_alpha_rgb15( w, h, src, srca, stride,
+          vo_draw_alpha_rgb15( w, h, src, srca, stride,
                                dst + pitch * y0 + 2 * x0,
                                pitch );
-	  break;
+          break;
      case DSPF_YUY2:
-	  vo_draw_alpha_yuy2( w, h, src, srca, stride,
+          vo_draw_alpha_yuy2( w, h, src, srca, stride,
                               dst + pitch * y0 + 2 * x0,
                               pitch );
-	  break;
+          break;
      case DSPF_UYVY:
-	  vo_draw_alpha_yuy2( w, h, src, srca, stride,
+          vo_draw_alpha_yuy2( w, h, src, srca, stride,
                               dst + pitch * y0 + 2 * x0 + 1,
                               pitch );
-	  break;
+          break;
 #if DIRECTFBVERSION > DFB_VERSION(0,9,21)
      case DSPF_NV12:
      case DSPF_NV21:
 #endif
      case DSPF_I420:
      case DSPF_YV12:
-	  vo_draw_alpha_yv12( w, h, src, srca, stride,
+          vo_draw_alpha_yv12( w, h, src, srca, stride,
                               dst + pitch * y0 + x0,
                               pitch );
-	  break;
+          break;
      }
 
      subframe->Unlock( subframe );
@@ -1135,25 +1124,25 @@ draw_slice( uint8_t * src[], int stride[
      } else
 #endif
      {
-     x /= 2;
-     w /= 2;
-     pitch /= 2;
+          x /= 2;
+          w /= 2;
+          pitch /= 2;
 
-     if (frame_format == DSPF_I420 )
-          memcpy_pic( dst + pitch * y + x, src[1],
-                      w, h, pitch, stride[1] );
-     else 
-          memcpy_pic( dst + pitch * y + x, src[2],
-                      w, h, pitch, stride[2] );
+          if (frame_format == DSPF_I420 )
+               memcpy_pic( dst + pitch * y + x, src[1],
+                           w, h, pitch, stride[1] );
+          else
+               memcpy_pic( dst + pitch * y + x, src[2],
+                           w, h, pitch, stride[2] );
 
-     dst += pitch * buf_height / 2;
+          dst += pitch * buf_height / 2;
 
-     if (frame_format == DSPF_I420 )
-          memcpy_pic( dst + pitch * y + x, src[2],
-                      w, h, pitch, stride[2] );
-     else
-          memcpy_pic( dst + pitch * y + x, src[1],
-                      w, h, pitch, stride[1] );
+          if (frame_format == DSPF_I420 )
+               memcpy_pic( dst + pitch * y + x, src[2],
+                           w, h, pitch, stride[2] );
+          else
+               memcpy_pic( dst + pitch * y + x, src[1],
+                           w, h, pitch, stride[1] );
      }
 
      frame->Unlock( frame );
@@ -1196,9 +1185,9 @@ blit_to_screen( void )
                crtc2->WaitForSync( crtc2 );
 #endif
 
-     if (c2stretch)
+          if (c2stretch)
                c2frame->StretchBlit( c2frame, blitsrc, srect, &c2rect );
-     else
+          else
                c2frame->Blit( c2frame, blitsrc, srect, c2rect.x, c2rect.y );
      }
 }
@@ -1232,8 +1221,8 @@ draw_osd( void )
           osd_dirty &= ~osd_current;
      }
 
-          blit_to_screen();
-          blit_done = 1;
+     blit_to_screen();
+     blit_done = 1;
 
      vo_remove_text( sub_width, sub_height, clear_alpha );
      vo_draw_text( sub_width, sub_height, draw_alpha );
@@ -1249,8 +1238,8 @@ draw_osd( void )
 static void
 flip_page( void )
 {
-          if (!blit_done)
-               blit_to_screen();
+     if (!blit_done)
+          blit_to_screen();
 
      if (flipping) {
           if (use_crtc2)
@@ -1341,17 +1330,17 @@ get_image( mp_image_t *mpi )
 
           if (mpi->flags & MP_IMGFLAG_PLANAR) {
                if (mpi->num_planes > 2) {
-               mpi->stride[1] = mpi->stride[2] = pitch / 2;
+                    mpi->stride[1] = mpi->stride[2] = pitch / 2;
 
-               if (mpi->flags & MP_IMGFLAG_SWAPPED) {
-                    /* I420 */
-                    mpi->planes[1] = dst + buf_height * pitch;
-                    mpi->planes[2] = mpi->planes[1] + buf_height * pitch / 4;
-               } else {
-                    /* YV12 */
-                    mpi->planes[2] = dst + buf_height * pitch;
-                    mpi->planes[1] = mpi->planes[2] + buf_height * pitch / 4;
-               }
+                    if (mpi->flags & MP_IMGFLAG_SWAPPED) {
+                         /* I420 */
+                         mpi->planes[1] = dst + buf_height * pitch;
+                         mpi->planes[2] = mpi->planes[1] + buf_height * pitch / 4;
+                    } else {
+                         /* YV12 */
+                         mpi->planes[2] = dst + buf_height * pitch;
+                         mpi->planes[1] = mpi->planes[2] + buf_height * pitch / 4;
+                    }
                } else {
                     /* NV12/NV21 */
                     mpi->stride[1] = pitch;
@@ -1458,7 +1447,7 @@ get_equalizer( char *data, int *value )
 
      if (res != DFB_OK)
           return VO_FALSE;
-     
+
      if (!strcasecmp( data, "brightness" ) &&
          (ca.flags & DCAF_BRIGHTNESS))
           *value = (ca.brightness - 0x8000) * factor;
@@ -1484,7 +1473,7 @@ control( uint32_t request, void *data, .
           return VO_TRUE;
 
      case VOCTRL_QUERY_FORMAT:
-	  return query_format( *((uint32_t *) data) );
+          return query_format( *((uint32_t *) data) );
 
      case VOCTRL_GET_IMAGE:
           return get_image( data );
@@ -1597,7 +1586,7 @@ check_events( void )
                     mplayer_put_key( KEY_PREV );
                     break;
                case DIKS_VOLUME_UP:
-                     mplayer_put_key( KEY_VOLUME_UP );
+                    mplayer_put_key( KEY_VOLUME_UP );
                     break;
                case DIKS_VOLUME_DOWN:
                     mplayer_put_key( KEY_VOLUME_DOWN );



More information about the MPlayer-cvslog mailing list