]> git.sesse.net Git - vlc/commitdiff
Ajout d'une fonction de deboguage � UnlinkPicture
authorVincent Seguin <seguin@videolan.org>
Wed, 19 Jan 2000 10:52:47 +0000 (10:52 +0000)
committerVincent Seguin <seguin@videolan.org>
Wed, 19 Jan 2000 10:52:47 +0000 (10:52 +0000)
VS: ----------------------------------------------------------------------

include/config.h
src/video_output/video_output.c
src/video_output/video_x11.c

index 57008cdb918f8945d4044bddf82823aa93edf5b0..73254fe5700ab30a45515ece0e55450926c7e834 100644 (file)
  * X11 settings 
  */
 
-/* Allow use of X11 XShm (shared memory) extension if possible */
-#define VOUT_XSHM                       1
-
 /* Font maximum and minimum characters - characters outside this range are not
  * printed - maximum range is 1-256 */
 #define VOUT_MIN_CHAR                   1
index cf6685a64813d4f989a8921687cf2b8dc6d2ec69..36186e5255494f6220e131b20e326b62c53ff978 100644 (file)
@@ -476,6 +476,15 @@ void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
     vlc_mutex_lock( &p_vout->picture_lock );
     p_pic->i_refcount--;
+
+#ifdef DEBUG_VIDEO
+    if( p_pic->i_refcount < 0 )
+    {
+        intf_DbgMsg("error: refcount < 0\n");
+        p_pic->i_refcount = 0;        
+    }    
+#endif
+
     if( (p_pic->i_refcount == 0) && (p_pic->i_status == DISPLAYED_PICTURE) )
     {
        p_pic->i_status = DESTROYED_PICTURE;
@@ -760,6 +769,7 @@ static void EndThread( vout_thread_t *p_vout )
  *******************************************************************************/
 static void RenderBlank( vout_thread_t *p_vout )
 {
+    //?? toooooo slow
     int  i_index;                                    /* current 32 bits sample */    
     int  i_width;                                 /* number of 32 bits samples */    
     u32 *p_pic;                                  /* pointer to 32 bits samples */
@@ -804,13 +814,18 @@ static void RenderBlank( vout_thread_t *p_vout )
  *******************************************************************************/
 static int RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, boolean_t b_blank )
 {
+#ifdef STATS
+    /* Start recording render time */
+    p_vout->render_time = mdate();
+#endif
+
     /* Mark last picture date */
     p_vout->last_picture_date = p_pic->date;    
 
     /* Blank screen if required */
     if( b_blank )
     {
-        RenderBlank( p_vout );
+// ?????       RenderBlank( p_vout );
     }
 
     /* 
@@ -846,7 +861,7 @@ static int RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, boolean_t b_b
  /* ??? p_vout->p_convert_yuv_420( p_vout, 
                                    p_pic->p_y, p_pic->p_u, p_pic->p_v,
                                    i_chroma_width, i_chroma_height,
-                                   p_vout->i_width / 2, p_vout->i_height,
+                                    p_vout->i_width / 2, p_vout->i_height,
                                    p_vout->i_bytes_per_line,
                                    0, 0, 0 );
   */      break;        
@@ -870,11 +885,13 @@ static int RenderPicture( vout_thread_t *p_vout, picture_t *p_pic, boolean_t b_b
      */
     //??
 
+#ifdef STATS
+    /* End recording render time */
+    p_vout->render_time = mdate() - p_vout->render_time;
+#endif
     return( 1 );    
 }
 
-
-
 /*******************************************************************************
  * RenderPictureInfo: print additionnal informations on a picture
  *******************************************************************************
@@ -909,17 +926,17 @@ static int RenderPictureInfo( vout_thread_t *p_vout, picture_t *p_pic, boolean_t
     /*
      * Print picture information in lower right corner
      */
-    sprintf( psz_buffer, "%s picture (mc=%d) %dx%d (%dx%d%+d%+d ar=%s)",
+    sprintf( psz_buffer, "%s picture %dx%d (%dx%d%+d%+d %s)",
              (p_pic->i_type == YUV_420_PICTURE) ? "4:2:0" :
              ((p_pic->i_type == YUV_422_PICTURE) ? "4:2:2" :
-              ((p_pic->i_type == YUV_444_PICTURE) ? "4:4:4" : "?")),
-             p_pic->i_matrix_coefficients, p_pic->i_width, p_pic->i_height,
+              ((p_pic->i_type == YUV_444_PICTURE) ? "4:4:4" : "ukn-type")),
+             p_pic->i_width, p_pic->i_height,
              p_pic->i_display_width, p_pic->i_display_height,
              p_pic->i_display_horizontal_offset, p_pic->i_display_vertical_offset,
-             (p_pic->i_aspect_ratio == AR_SQUARE_PICTURE) ? "square" :
+             (p_pic->i_aspect_ratio == AR_SQUARE_PICTURE) ? "sq" :
              ((p_pic->i_aspect_ratio == AR_3_4_PICTURE) ? "4:3" :
               ((p_pic->i_aspect_ratio == AR_16_9_PICTURE) ? "16:9" :
-               ((p_pic->i_aspect_ratio == AR_221_1_PICTURE) ? "2.21:1" : "?" ))));    
+               ((p_pic->i_aspect_ratio == AR_221_1_PICTURE) ? "2.21:1" : "ukn-ar" ))));    
     vout_SysPrint( p_vout, p_vout->i_width, p_vout->i_height, 1, 1, psz_buffer );
 #endif
     
index 2b552c30c78a5e025d62ec10c5ed1b97d3fd305a..c080b6d9eb0726a1a02806246afe094a44c65c8a 100644 (file)
@@ -136,7 +136,7 @@ int vout_SysInit( vout_thread_t *p_vout )
         }
         if( i_err )                                        /* an error occured */
         {                        
-            intf_Msg("warning: XShm video extension desactivated\n" );
+            intf_Msg("Video: XShm extension desactivated\n" );
             p_vout->p_sys->b_shm = 0;
         }
     }
@@ -146,14 +146,14 @@ int vout_SysInit( vout_thread_t *p_vout )
     {
         if( X11CreateImage( p_vout, &p_vout->p_sys->p_ximage[0] ) )
         {
-            intf_Msg("error: can't create images\n");
+            intf_ErrMsg("error: can't create images\n");
             p_vout->p_sys->p_ximage[0] = NULL;
             p_vout->p_sys->p_ximage[1] = NULL;
             return( 1 );
         }
         if( X11CreateImage( p_vout, &p_vout->p_sys->p_ximage[1] ) )
         {
-            intf_Msg("error: can't create images\n");
+            intf_ErrMsg("error: can't create images\n");
             X11DestroyImage( p_vout->p_sys->p_ximage[0] );
             p_vout->p_sys->p_ximage[0] = NULL;
             p_vout->p_sys->p_ximage[1] = NULL;
@@ -213,8 +213,8 @@ int vout_SysManage( vout_thread_t *p_vout )
 {
     if( p_vout->i_changes & VOUT_SIZE_CHANGE ) 
     {        
+        intf_DbgMsg("resizing window\n");      
         p_vout->i_changes &= ~VOUT_SIZE_CHANGE;        
-        intf_DbgMsg("resizing window\n");        
 
         /* Resize window */
         XResizeWindow( p_vout->p_sys->p_display, p_vout->p_sys->window, 
@@ -224,7 +224,12 @@ int vout_SysManage( vout_thread_t *p_vout )
         vout_SysEnd( p_vout );
 
         /* Recreate XImages. If SysInit failed, the thread can't go on. */
-        return( vout_SysInit( p_vout ) );
+        if( vout_SysInit( p_vout ) )
+        {
+            intf_ErrMsg("error: can't resize display\n");
+            return( 1 );            
+        }
+        intf_Msg("Video: display resized to %dx%d\n", p_vout->i_width, p_vout->i_height);            
     }
     
     return 0;
@@ -379,9 +384,12 @@ static int X11OpenDisplay( vout_thread_t *p_vout, char *psz_display, Window root
 
     /* Initialize structure */
     p_vout->p_sys->root_window  = root_window;
-    p_vout->p_sys->b_shm        = VOUT_XSHM && 
-        (XShmQueryExtension(p_vout->p_sys->p_display) == True);
+    p_vout->p_sys->b_shm        = (XShmQueryExtension(p_vout->p_sys->p_display) == True);
     p_vout->p_sys->i_screen     = DefaultScreen( p_vout->p_sys->p_display );
+    if( !p_vout->p_sys->b_shm )
+    {        
+        intf_Msg("Video: XShm extension is not available\n");    
+    }    
 
     /* Get the screen depth */
     p_vout->i_screen_depth = DefaultDepth( p_vout->p_sys->p_display,