changeset 27593:f75481d143ad

Cosmetics: - Convert tabs to spaces - Remove trailing whitespace - Remove useless comments
author syrjala
date Mon, 15 Sep 2008 20:45:17 +0000
parents 6398d845ae76
children 2a014f30d031
files libvo/vo_dfbmga.c
diffstat 1 files changed, 133 insertions(+), 144 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_dfbmga.c	Mon Sep 15 20:43:24 2008 +0000
+++ b/libvo/vo_dfbmga.c	Mon Sep 15 20:45:17 2008 +0000
@@ -49,13 +49,6 @@
 
 const LIBVO_EXTERN(dfbmga)
 
-/******************************
-*	   directfb 	      *
-******************************/
-
-/*
- * (Globals)
- */
 static IDirectFB *dfb;
 
 static IDirectFBDisplayLayer *crtc1;
@@ -110,10 +103,6 @@
 
 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 @@
      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 @@
           return "NV21";
 #endif
      default:
-	  return "Unknown pixel format";
+          return "Unknown pixel format";
      }
 }
 
@@ -170,17 +159,17 @@
 {
      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 @@
           return DSPF_NV21;
 #endif
      default:
-	  return DSPF_UNKNOWN;
+          return DSPF_UNKNOWN;
      }
 }
 
@@ -360,7 +349,7 @@
                     show_help = 1;
                     break;
                }
-               }
+          }
           if (show_help) {
                mp_msg( MSGT_VO, MSGL_ERR,
                        "\nvo_dfbmga command line help:\n"
@@ -389,49 +378,49 @@
           }
      }
      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 @@
                return -1;
           }
      }
-     
+
      return 0;
 }
 
@@ -578,7 +567,7 @@
           bufs[1]->Release( bufs[1] );
      if (bufs[2])
           bufs[2]->Release( bufs[2] );
-     
+
      spicframe = NULL;
      spic = NULL;
      c2frame = NULL;
@@ -594,7 +583,7 @@
         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 @@
           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 @@
 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;
+     case IMGFMT_NV12:
+     case IMGFMT_NV21:
+          if (use_crtc1 || use_crtc2)
+               return 0;
+          break;
 #endif
-          default:
-               return 0;
+     default:
+          return 0;
      }
 
      return  VFCAP_HWSCALE_UP |
@@ -1002,11 +991,11 @@
 
 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 @@
 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 @@
      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 @@
      } 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 @@
                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 @@
           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 @@
 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 @@
 
           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 @@
 
      if (res != DFB_OK)
           return VO_FALSE;
-     
+
      if (!strcasecmp( data, "brightness" ) &&
          (ca.flags & DCAF_BRIGHTNESS))
           *value = (ca.brightness - 0x8000) * factor;
@@ -1484,7 +1473,7 @@
           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 @@
                     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 );