Commit dabae790 authored by Vincent Seguin's avatar Vincent Seguin

Ajout d'une fonction de deboguage � UnlinkPicture

VS: ----------------------------------------------------------------------
parent 27e0b63d
......@@ -288,9 +288,6 @@
* 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
......
......@@ -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 );
}
/*
......@@ -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
......
......@@ -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 )
{
p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
intf_DbgMsg("resizing window\n");
p_vout->i_changes &= ~VOUT_SIZE_CHANGE;
/* 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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment