[MPlayer-cvslog] r28468 - trunk/libvo/vo_direct3d.c

gogothebee subversion at mplayerhq.hu
Thu Feb 5 10:06:10 CET 2009


Author: gogothebee
Date: Thu Feb  5 10:06:09 2009
New Revision: 28468

Log:
This patch unifies info/error messages
to a common style: <vo_direct3d> in the beginning of each message and "." at the end. Messages are shorter/more descriptive.

Modified:
   trunk/libvo/vo_direct3d.c

Modified: trunk/libvo/vo_direct3d.c
==============================================================================
--- trunk/libvo/vo_direct3d.c	Wed Feb  4 20:17:03 2009	(r28467)
+++ trunk/libvo/vo_direct3d.c	Thu Feb  5 10:06:09 2009	(r28468)
@@ -190,7 +190,7 @@ static void calc_fs_rect(void)
     }
 
     mp_msg(MSGT_VO, MSGL_V,
-           "<vo_direct3d>Fullscreen Movie Rect: t: %ld, l: %ld, r: %ld, b:%ld\r\n",
+           "<vo_direct3d>Fullscreen movie rectangle: t: %ld, l: %ld, r: %ld, b:%ld\n",
            priv->fs_movie_rect.top,   priv->fs_movie_rect.left,
            priv->fs_movie_rect.right, priv->fs_movie_rect.bottom);
 
@@ -205,7 +205,7 @@ static void calc_fs_rect(void)
  */
 static void destroy_d3d_surfaces(void)
 {
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>destroy_d3d_surfaces called\r\n");
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>destroy_d3d_surfaces called.\n");
     /* Let's destroy the old (if any) D3D Surfaces */
 
     if (priv->locked_rect.pBits)
@@ -238,14 +238,14 @@ static int create_d3d_surfaces(void)
 {
     int osd_width = vo_dwidth, osd_height = vo_dheight;
     int tex_width = osd_width, tex_height = osd_height;
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d><INFO>create_d3d_surfaces called.\n");
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>create_d3d_surfaces called.\n");
 
     if (!priv->d3d_surface &&
         FAILED(IDirect3DDevice9_CreateOffscreenPlainSurface(
                priv->d3d_device, priv->src_width, priv->src_height,
                priv->movie_src_fmt, D3DPOOL_DEFAULT, &priv->d3d_surface, NULL))) {
         mp_msg(MSGT_VO, MSGL_ERR,
-               "<vo_direct3d><INFO>IDirect3D9_CreateOffscreenPlainSurface Failed.\n");
+               "<vo_direct3d>Allocating offscreen surface failed.\n");
         return 0;
     }
 
@@ -253,7 +253,7 @@ static int create_d3d_surfaces(void)
         FAILED(IDirect3DDevice9_GetBackBuffer(priv->d3d_device, 0, 0,
                                               D3DBACKBUFFER_TYPE_MONO,
                                               &priv->d3d_backbuf))) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Back Buffer address get failed\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Allocating backbuffer failed.\n");
         return 0;
     }
 
@@ -284,7 +284,7 @@ static int create_d3d_surfaces(void)
     priv->osd_texture_width  = tex_width;
     priv->osd_texture_height = tex_height;
 
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d><INFO>surface (%d, %d) requested = (%d, %d)\n",
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>OSD texture size (%dx%d), requested (%dx%d).\n",
            vo_dwidth, vo_dheight, priv->osd_texture_width, priv->osd_texture_height);
 
     /* create OSD */
@@ -299,7 +299,7 @@ static int create_d3d_surfaces(void)
                                               &priv->d3d_texture_system,
                                               NULL))) {
         mp_msg(MSGT_VO,MSGL_ERR,
-               "<vo_direct3d><INFO>IDirect3DDevice9_CreateTexture Failed (d3d_texture_system).\n");
+               "<vo_direct3d>Allocating OSD texture in system RAM failed.\n");
         return 0;
     }
 
@@ -316,7 +316,7 @@ static int create_d3d_surfaces(void)
                                                   &priv->d3d_texture_osd,
                                                   NULL))) {
             mp_msg(MSGT_VO,MSGL_ERR,
-                   "<vo_direct3d><INFO>IDirect3DDevice9_CreateTexture Failed (d3d_texture_osd).\n");
+                   "<vo_direct3d>Allocating OSD texture in video RAM failed.\n");
             return 0;
         }
     }
@@ -383,19 +383,19 @@ static int change_d3d_backbuffer(back_bu
                                        D3DCREATE_SOFTWARE_VERTEXPROCESSING,
                                        &present_params, &priv->d3d_device))) {
             mp_msg(MSGT_VO, MSGL_ERR,
-                   "<vo_direct3d><INFO>Could not create the D3D device\n");
+                   "<vo_direct3d>Creating Direct3D device failed.\n");
         return 0;
     }
 
     if (action == BACKBUFFER_RESET &&
         FAILED(IDirect3DDevice9_Reset(priv->d3d_device, &present_params))) {
             mp_msg(MSGT_VO, MSGL_ERR,
-                   "<vo_direct3d><INFO>Could not reset the D3D device\n");
+                   "<vo_direct3d>Reseting Direct3D device failed.\n");
         return 0;
     }
 
     mp_msg(MSGT_VO, MSGL_V,
-           "<vo_direct3d><INFO>New backbuffer: Width: %d, Height:%d. VO Dest Width:%d, Height: %d\n",
+           "<vo_direct3d>New backbuffer (%dx%d), VO (%dx%d)\n",
            present_params.BackBufferWidth, present_params.BackBufferHeight,
            vo_dwidth, vo_dheight);
 
@@ -411,7 +411,7 @@ static int configure_d3d(void)
     D3DDISPLAYMODE disp_mode;
     D3DVIEWPORT9 vp = {0, 0, vo_dwidth, vo_dheight, 0, 1};
 
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d><INFO>configure_d3d called\n");
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>configure_d3d called.\n");
 
     destroy_d3d_surfaces();
 
@@ -421,7 +421,7 @@ static int configure_d3d(void)
                                                 D3DADAPTER_DEFAULT,
                                                 &disp_mode))) {
         mp_msg(MSGT_VO, MSGL_ERR,
-               "<vo_direct3d><INFO>Could not read adapter display mode.\n");
+               "<vo_direct3d>Reading adapter display mode failed.\n");
         return 0;
     }
 
@@ -436,7 +436,7 @@ static int configure_d3d(void)
 
     if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device,
                                             &vp))) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Unable to set the viewport\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Setting viewport failed.\n");
         return 0;
     }
 
@@ -451,7 +451,7 @@ static int configure_d3d(void)
  */
 static int reconfigure_d3d(void)
 {
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d><INFO>reconfigure_d3d called.\n");
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>reconfigure_d3d called.\n");
 
     /* Destroy the offscreen, OSD and backbuffer surfaces */
     destroy_d3d_surfaces();
@@ -467,7 +467,7 @@ static int reconfigure_d3d(void)
     /* Initialize Direct3D from the beginning */
     priv->d3d_handle = Direct3DCreate9(D3D_SDK_VERSION);
     if (!priv->d3d_handle) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Unable to initialize Direct3D\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Initializing Direct3D failed.\n");
         return 0;
     }
 
@@ -485,7 +485,7 @@ static int resize_d3d(void)
 {
     D3DVIEWPORT9 vp = {0, 0, vo_dwidth, vo_dheight, 0, 1};
 
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d><INFO>resize_d3d called.\n");
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>resize_d3d called.\n");
 
     /* Make sure that backbuffer is large enough to accomodate the new
        viewport dimensions. Grow it if necessary. */
@@ -519,7 +519,7 @@ static int resize_d3d(void)
 
     if (FAILED(IDirect3DDevice9_SetViewport(priv->d3d_device,
                                             &vp))) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Unable to set the viewport\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Setting viewport failed.\n");
         return 0;
     }
 
@@ -539,7 +539,7 @@ static int resize_d3d(void)
  */
 static void uninit_d3d(void)
 {
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>uninit_d3d called\r\n");
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>uninit_d3d called.\n");
 
     destroy_d3d_surfaces();
 
@@ -550,7 +550,7 @@ static void uninit_d3d(void)
 
     /* Stop the whole D3D. */
     if (priv->d3d_handle) {
-        mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Calling IDirect3D9_Release\r\n");
+        mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Stopping Direct3D.\n");
         IDirect3D9_Release(priv->d3d_handle);
     }
     priv->d3d_handle = NULL;
@@ -583,7 +583,7 @@ static uint32_t render_d3d_frame(mp_imag
     if (!priv->locked_rect.pBits) {
         if (FAILED(IDirect3DSurface9_LockRect(priv->d3d_surface,
                                               &priv->locked_rect, NULL, 0))) {
-            mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Surface lock failure\n");
+            mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Surface lock failed.\n");
             return VO_ERROR;
         }
     }
@@ -594,13 +594,13 @@ static uint32_t render_d3d_frame(mp_imag
 skip_upload:
     /* This unlock is used for both slice_draw path and render_d3d_frame path. */
     if (FAILED(IDirect3DSurface9_UnlockRect(priv->d3d_surface))) {
-        mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Surface unlock failure\n");
+        mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Surface unlock failed.\n");
         return VO_ERROR;
     }
     priv->locked_rect.pBits = NULL;
 
     if (FAILED(IDirect3DDevice9_BeginScene(priv->d3d_device))) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>BeginScene failed\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>BeginScene failed.\n");
         return VO_ERROR;
     }
 
@@ -617,12 +617,12 @@ skip_upload:
                                             &priv->fs_movie_rect,
                                             D3DTEXF_LINEAR))) {
         mp_msg(MSGT_VO, MSGL_ERR,
-               "<vo_direct3d>Unable to copy the frame to the back buffer\n");
+               "<vo_direct3d>Copying frame to the backbuffer failed.\n");
         return VO_ERROR;
     }
 
     if (FAILED(IDirect3DDevice9_EndScene(priv->d3d_device))) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>EndScene failed\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>EndScene failed.\n");
         return VO_ERROR;
     }
 
@@ -693,7 +693,7 @@ static int preinit(const char *arg)
     /* Set to zero all global variables. */
     priv = calloc(1, sizeof(struct global_priv));
     if (!priv) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Not enough memory\r\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Allocating private memory failed.\n");
         return -1;
     }
 
@@ -704,14 +704,14 @@ static int preinit(const char *arg)
 
     priv->d3d_handle = Direct3DCreate9(D3D_SDK_VERSION);
     if (!priv->d3d_handle) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Unable to initialize Direct3D\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Initializing Direct3D failed.\n");
         return -1;
     }
 
     if (FAILED(IDirect3D9_GetAdapterDisplayMode(priv->d3d_handle,
                                                 D3DADAPTER_DEFAULT,
                                                 &disp_mode))) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Could not read display mode\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Reading display mode failed.\n");
         return -1;
     }
 
@@ -720,14 +720,14 @@ static int preinit(const char *arg)
     priv->cur_backbuf_width = disp_mode.Width;
     priv->cur_backbuf_height = disp_mode.Height;
 
-    mp_msg(MSGT_VO, MSGL_V, "Setting backbuffer to the screen width: %d, height: %d\n",
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Setting backbuffer dimensions to (%dx%d).\n",
            disp_mode.Width, disp_mode.Height);
 
     if (FAILED(IDirect3D9_GetDeviceCaps(priv->d3d_handle,
                                         D3DADAPTER_DEFAULT,
                                         D3DDEVTYPE_HAL,
                                         &disp_caps))) {
-        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Could not read display capabilities\n");
+        mp_msg(MSGT_VO, MSGL_ERR, "<vo_direct3d>Reading display capabilities failed.\n");
         return -1;
     }
 
@@ -752,7 +752,7 @@ static int preinit(const char *arg)
      * fullscreen dimensions and does other useful stuff.
      */
     if (!vo_w32_init()) {
-        mp_msg(MSGT_VO, MSGL_V, "Unable to configure onscreen window\r\n");
+        mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Configuring onscreen window failed.\n");
         return -1;
     }
 
@@ -771,7 +771,7 @@ static int control(uint32_t request, voi
         return query_format(*(uint32_t*) data);
     case VOCTRL_GET_IMAGE: /* Direct Rendering. Not implemented yet. */
         mp_msg(MSGT_VO, MSGL_V,
-               "<vo_direct3d>Direct Rendering request. Not implemented yet\n");
+               "<vo_direct3d>Direct Rendering request. Not implemented yet.\n");
         return VO_NOTIMPL;
     case VOCTRL_DRAW_IMAGE:
         return render_d3d_frame(data);
@@ -835,7 +835,7 @@ static int config(uint32_t width, uint32
      * the given coordinates.
      */
     if (!vo_w32_config(d_width, d_height, options)) {
-        mp_msg(MSGT_VO, MSGL_V, "Unable to create onscreen window\r\n");
+        mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Creating onscreen window failed.\n");
         return VO_ERROR;
     }
 
@@ -881,7 +881,7 @@ static void flip_page(void)
  */
 static void uninit(void)
 {
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Uninitialization\r\n");
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>uninit called.\n");
 
     uninit_d3d();
     vo_w32_uninit(); /* w32_common framework call */
@@ -924,7 +924,7 @@ static int draw_slice(uint8_t *src[], in
     if (!priv->locked_rect.pBits) {
         if (FAILED(IDirect3DSurface9_LockRect(priv->d3d_surface,
                                               &priv->locked_rect, NULL, 0))) {
-            mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Surface lock failure\n");
+            mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>Surface lock failure.\n");
             return VO_FALSE;
         }
     }
@@ -971,7 +971,7 @@ static int draw_slice(uint8_t *src[], in
  */
 static int draw_frame(uint8_t *src[])
 {
-    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>draw_frame called\n");
+    mp_msg(MSGT_VO, MSGL_V, "<vo_direct3d>draw_frame called.\n");
     return VO_FALSE;
 }
 
@@ -1008,7 +1008,7 @@ static void draw_alpha(int x0, int y0, i
 
     if (FAILED(IDirect3DTexture9_LockRect(priv->d3d_texture_system, 0,
                                           &locked_rect, NULL, 0))) {
-        mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>IDirect3DTexture9_LockRect failure.\n");
+        mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>OSD texture lock failed.\n");
         return;
     }
 
@@ -1017,7 +1017,7 @@ static void draw_alpha(int x0, int y0, i
 
     /* this unlock is used for both slice_draw path and D3DRenderFrame path */
     if (FAILED(IDirect3DTexture9_UnlockRect(priv->d3d_texture_system, 0))) {
-        mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>IDirect3DTexture9_UnlockRect failure.\n");
+        mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>OSD texture unlock failed.\n");
         return;
     }
 
@@ -1039,7 +1039,7 @@ static void draw_osd(void)
         /* clear the OSD */
         if (FAILED(IDirect3DTexture9_LockRect(priv->d3d_texture_system, 0,
                                               &locked_rect, NULL, 0))) {
-            mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>IDirect3DTexture9_LockRect failure.\n");
+            mp_msg(MSGT_VO,MSGL_ERR, "<vo_direct3d>OSD texture lock failed.\n");
             return;
         }
 
@@ -1048,7 +1048,7 @@ static void draw_osd(void)
 
         /* this unlock is used for both slice_draw path and D3DRenderFrame path */
         if (FAILED(IDirect3DTexture9_UnlockRect(priv->d3d_texture_system, 0))) {
-            mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>IDirect3DTexture9_UnlockRect failure.\n");
+            mp_msg(MSGT_VO,MSGL_ERR, "<vo_direct3d>OSD texture unlock failed.\n");
             return;
         }
 
@@ -1064,7 +1064,7 @@ static void draw_osd(void)
             if (FAILED(IDirect3DDevice9_UpdateTexture(priv->d3d_device,
                                                       (IDirect3DBaseTexture9 *)priv->d3d_texture_system,
                                                       (IDirect3DBaseTexture9 *)priv->d3d_texture_osd))) {
-                mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>IDirect3DDevice9_UpdateTexture failure.\n");
+                mp_msg(MSGT_VO,MSGL_ERR, "<vo_direct3d>OSD texture transfer failed.\n");
                 return;
             }
         }
@@ -1088,7 +1088,7 @@ static void draw_osd(void)
             osd_quad_vb[3].tv = (float)priv->osd_height / priv->osd_texture_height;
 
         if (FAILED(IDirect3DDevice9_BeginScene(priv->d3d_device))) {
-            mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>BeginScene failed\n");
+            mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>BeginScene failed.\n");
             return;
         }
 
@@ -1109,7 +1109,7 @@ static void draw_osd(void)
         IDirect3DDevice9_SetRenderState(priv->d3d_device, D3DRS_ALPHABLENDENABLE, FALSE);
 
         if (FAILED(IDirect3DDevice9_EndScene(priv->d3d_device))) {
-            mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>EndScene failed\n");
+            mp_msg(MSGT_VO,MSGL_ERR,"<vo_direct3d>EndScene failed.\n");
             return;
         }
     }



More information about the MPlayer-cvslog mailing list