Commit 1346af34 authored by Vincent Seguin's avatar Vincent Seguin

API vout_DatePicture termin�e.

parent 4c7b5876
......@@ -74,9 +74,11 @@ typedef struct picture_s
/* Pictures status */
#define FREE_PICTURE 0 /* picture is free and not allocated */
#define RESERVED_PICTURE 1 /* picture is allocated and reserved */
#define READY_PICTURE 2 /* picture is ready for display */
#define DISPLAYED_PICTURE 3 /* picture has been displayed but is linked */
#define DESTROYED_PICTURE 4 /* picture is allocated but no more used */
#define RESERVED_DATED_PICTURE 2 /* picture is waiting for DisplayPicture */
#define RESERVED_DISP_PICTURE 3 /* picture is waiting for a DatePixture */
#define READY_PICTURE 4 /* picture is ready for display */
#define DISPLAYED_PICTURE 5 /* picture has been displayed but is linked */
#define DESTROYED_PICTURE 6 /* picture is allocated but no more used */
/* Aspect ratios (ISO/IEC 13818-2 section 6.3.3, table 6-3) */
#define AR_SQUARE_PICTURE 1 /* square pixels */
......
......@@ -248,31 +248,30 @@ void vout_DestroySubtitle( vout_thread_t *p_vout, subtitle_t *p_sub )
* vout_DisplayPicture: display a picture
*******************************************************************************
* Remove the reservation flag of a picture, which will cause it to be ready for
* display. The picture does not need to be locked, since it is ignored by
* the output thread if is reserved. The picture won't be displayed until
* vout_DatePicture has been called.
* display. The picture won't be displayed until vout_DatePicture has been
* called.
*******************************************************************************/
void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
#ifdef DEBUG_VIDEO
char psz_date[MSTRTIME_MAX_SIZE]; /* buffer for date string */
#endif
#ifdef DEBUG
/* Check if picture status is valid */
if( p_pic->i_status != RESERVED_PICTURE )
vlc_mutex_lock( &p_vout->picture_lock );
switch( p_pic->i_status )
{
intf_DbgMsg("error: picture %p has invalid status %d\n", p_pic, p_pic->i_status );
}
case RESERVED_PICTURE:
p_pic->i_status = RESERVED_DISP_PICTURE;
break;
case RESERVED_DATED_PICTURE:
p_pic->i_status = READY_PICTURE;
break;
#ifdef DEBUG
default:
intf_DbgMsg("error: picture %p has invalid status %d\n", p_pic, p_pic->i_status );
break;
#endif
/* Remove reservation flag */
p_pic->i_status = READY_PICTURE;
}
vlc_mutex_unlock( &p_vout->picture_lock );
#ifdef DEBUG_VIDEO
/* Send picture informations */
intf_DbgMsg("picture %p: type=%d, %dx%d, date=%s\n", p_pic, p_pic->i_type,
p_pic->i_width,p_pic->i_height, mstrtime( psz_date, p_pic->date ) );
intf_DbgMsg("picture %p\n", p_pic );
#endif
}
......@@ -280,13 +279,32 @@ void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
* vout_DatePicture: date a picture
*******************************************************************************
* Remove the reservation flag of a picture, which will cause it to be ready for
* display. The picture does not need to be locked, since it is ignored by
* the output thread if is reserved. The picture won't be displayed until
* vout_DisplayPicture has been called.
* display. The picture won't be displayed until vout_DisplayPicture has been
* called.
*******************************************************************************/
void vout_DatePicture( vout_thread_t *p_vout, picture_t *p_pic, mtime_t date )
{
//??
vlc_mutex_lock( &p_vout->picture_lock );
p_pic->date = date;
switch( p_pic->i_status )
{
case RESERVED_PICTURE:
p_pic->i_status = RESERVED_DATED_PICTURE;
break;
case RESERVED_DISP_PICTURE:
p_pic->i_status = READY_PICTURE;
break;
#ifdef DEBUG
default:
intf_DbgMsg("error: picture %p has invalid status %d\n", p_pic, p_pic->i_status );
break;
#endif
}
vlc_mutex_unlock( &p_vout->picture_lock );
#ifdef DEBUG_VIDEO
intf_DbgMsg("picture %p\n", p_pic);
#endif
}
/*******************************************************************************
......@@ -447,7 +465,9 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
#ifdef DEBUG
/* Check if picture status is valid */
if( p_pic->i_status != RESERVED_PICTURE )
if( (p_pic->i_status != RESERVED_PICTURE) &&
(p_pic->i_status != RESERVED_DATED_PICTURE) &&
(p_pic->i_status != RESERVED_DISP_PICTURE) )
{
intf_DbgMsg("error: picture %p has invalid status %d\n", p_pic, p_pic->i_status );
}
......@@ -1020,6 +1040,8 @@ static int RenderInfo( vout_thread_t *p_vout, boolean_t b_blank )
switch( p_vout->p_picture[i_picture].i_status )
{
case RESERVED_PICTURE:
case RESERVED_DATED_PICTURE:
case RESERVED_DISP_PICTURE:
i_reserved_pic++;
break;
case READY_PICTURE:
......
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