Commit 816d3cc4 authored by Laurent Aimar's avatar Laurent Aimar

Merged vout_DatePicture into vout_DisplayPicture.

parent 96588cbc
......@@ -245,34 +245,45 @@ struct picture_heap_t
* Flags used to describe the status of a picture
*****************************************************************************/
/* Picture type */
#define EMPTY_PICTURE 0 /* empty buffer */
#define MEMORY_PICTURE 100 /* heap-allocated buffer */
#define DIRECT_PICTURE 200 /* direct buffer */
/* Picture type
* FIXME are the values meaningfull ? */
enum
{
EMPTY_PICTURE = 0, /* empty buffer */
MEMORY_PICTURE = 100, /* heap-allocated buffer */
DIRECT_PICTURE = 200, /* direct buffer */
};
/* Picture status */
#define FREE_PICTURE 0 /* free and not allocated */
#define RESERVED_PICTURE 1 /* allocated and reserved */
#define RESERVED_DATED_PICTURE 2 /* waiting for DisplayPicture */
#define RESERVED_DISP_PICTURE 3 /* waiting for a DatePicture */
#define READY_PICTURE 4 /* ready for display */
#define DISPLAYED_PICTURE 5 /* been displayed but is linked */
#define DESTROYED_PICTURE 6 /* allocated but no more used */
enum
{
FREE_PICTURE, /* free and not allocated */
RESERVED_PICTURE, /* allocated and reserved */
READY_PICTURE, /* ready for display */
DISPLAYED_PICTURE, /* been displayed but is linked */
DESTROYED_PICTURE, /* allocated but no more used */
};
/* Quantification type */
#define QTYPE_MPEG1 0
#define QTYPE_MPEG2 1
#define QTYPE_H264 2
enum
{
QTYPE_MPEG1,
QTYPE_MPEG2,
QTYPE_H264,
};
/*****************************************************************************
* Shortcuts to access image components
*****************************************************************************/
/* Plane indices */
#define Y_PLANE 0
#define U_PLANE 1
#define V_PLANE 2
#define A_PLANE 3
enum
{
Y_PLANE = 0,
U_PLANE = 1,
V_PLANE = 2,
A_PLANE = 3,
};
/* Shortcuts */
#define Y_PIXELS p[Y_PLANE].p_pixels
......@@ -655,7 +666,6 @@ VLC_EXPORT( picture_t *, vout_CreatePicture, ( vout_thread_t *, bool, bool,
VLC_EXPORT( void, vout_InitFormat, ( video_frame_format_t *, uint32_t, int, int, int ) );
VLC_EXPORT( void, vout_DestroyPicture, ( vout_thread_t *, picture_t * ) );
VLC_EXPORT( void, vout_DisplayPicture, ( vout_thread_t *, picture_t * ) );
VLC_EXPORT( void, vout_DatePicture, ( vout_thread_t *, picture_t *, mtime_t ) );
VLC_EXPORT( void, vout_LinkPicture, ( vout_thread_t *, picture_t * ) );
VLC_EXPORT( void, vout_UnlinkPicture, ( vout_thread_t *, picture_t * ) );
VLC_EXPORT( void, vout_PlacePicture, ( vout_thread_t *, unsigned int, unsigned int, unsigned int *, unsigned int *, unsigned int *, unsigned int * ) );
......
......@@ -337,8 +337,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ],
p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ], p_outpic );
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
......
......@@ -513,7 +513,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
vout_LinkPicture( p_vout->p_sys->p_vout, p_outpic );
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
......
......@@ -511,7 +511,7 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_vout->p_sys->p_vout, pp_outpic[0], p_pic->date );
pp_outpic[0]->date = p_pic->date;
/* If we are using double rate, get an additional new picture */
if( p_vout->p_sys->b_double_rate )
......@@ -531,15 +531,9 @@ static void Render ( vout_thread_t *p_vout, picture_t *p_pic )
/* 20ms is a bit arbitrary, but it's only for the first image we get */
if( !p_vout->p_sys->last_date )
{
vout_DatePicture( p_vout->p_sys->p_vout, pp_outpic[1],
p_pic->date + 20000 );
}
pp_outpic[1]->date = p_pic->date + 20000;
else
{
vout_DatePicture( p_vout->p_sys->p_vout, pp_outpic[1],
(3 * p_pic->date - p_vout->p_sys->last_date) / 2 );
}
pp_outpic[1]->date = (3 * p_pic->date - p_vout->p_sys->last_date) / 2;
p_vout->p_sys->last_date = p_pic->date;
}
......
......@@ -584,13 +584,12 @@ static void Render( vout_thread_t *p_vout, picture_t *p_inpic )
}
picture_Copy( p_outpic, p_inpic );
vout_DatePicture( p_sys->p_vout, p_outpic, p_inpic->date );
if( p_pic )
p_sys->p_blend->pf_video_blend( p_sys->p_blend, p_outpic,
p_pic, p_sys->posx, p_sys->posy,
p_logo->i_alpha != -1 ? p_logo->i_alpha
: p_logo_list->i_alpha );
p_sys->p_blend->pf_video_blend( p_sys->p_blend, p_outpic,
p_pic, p_sys->posx, p_sys->posy,
p_logo->i_alpha != -1 ? p_logo->i_alpha
: p_logo_list->i_alpha );
vout_DisplayPicture( p_sys->p_vout, p_outpic );
}
......
......@@ -256,8 +256,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_sys->p_vout, p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
vlc_mutex_lock( &p_sys->lock );
const bool b_visible = p_sys->b_visible;
......
......@@ -589,7 +589,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
msg_Dbg( p_vout, "Render took %2.4f seconds\n", duration );
ReleaseImages(p_vout);
vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
vout_UnlinkPicture( p_vout->p_sys->p_vout, p_outpic );
vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
......
......@@ -960,7 +960,7 @@ static void RenderPlanarYUV( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_entry->p_vout, p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
vout_LinkPicture( p_entry->p_vout, p_outpic );
for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
......@@ -1262,8 +1262,7 @@ static void RenderPackedRGB( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
p_outpic );
......@@ -1598,8 +1597,7 @@ static void RenderPackedYUV( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
p_outpic );
......
......@@ -366,7 +366,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
for( i_plane = 0; i_plane < p_outpic->i_planes; i_plane++ )
{
......
......@@ -324,7 +324,7 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
p_outpic->date = p_pic->date;
vout_LinkPicture( p_vout->p_sys->p_vout, p_outpic );
p_vout->p_sys->pf_filter( p_vout, p_pic, p_outpic );
......
......@@ -522,9 +522,8 @@ static void Render( vout_thread_t *p_vout, picture_t *p_pic )
msleep( VOUT_OUTMEM_SLEEP );
}
p_outpic->date = p_pic->date;
vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
p_outpic, p_pic->date );
vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
p_outpic );
......
......@@ -370,8 +370,8 @@ static void* Thread( vlc_object_t *p_this )
if( p_pic == NULL ) break;
memcpy( p_pic->p[0].p_pixels, plane, width.i_int * height.i_int * 4 );
vout_DatePicture( p_thread->p_vout, p_pic,
aout_DateGet( &i_pts ) + GOOM_DELAY );
p_pic->date = aout_DateGet( &i_pts ) + GOOM_DELAY;
vout_DisplayPicture( p_thread->p_vout, p_pic );
}
......
......@@ -370,8 +370,7 @@ static void DoWork( aout_instance_t *p_aout, aout_filter_t *p_filter,
#undef p_effect
}
vout_DatePicture( p_sys->p_vout, p_outpic,
( p_in_buf->start_date + p_in_buf->end_date ) / 2 );
p_outpic->date = ( p_in_buf->start_date + p_in_buf->end_date ) / 2;
vout_DisplayPicture( p_sys->p_vout, p_outpic );
}
......
......@@ -1260,8 +1260,6 @@ static void DecoderPlayVideo( decoder_t *p_dec, picture_t *p_picture,
p_owner->i_last_rate = i_rate;
}
vout_DatePicture( p_vout, p_picture, p_picture->date );
vout_DisplayPicture( p_vout, p_picture );
}
else
......
......@@ -519,7 +519,6 @@ vout_Close
vout_ControlWindow
__vout_Create
vout_CreatePicture
vout_DatePicture
vout_DestroyPicture
vout_DisplayPicture
vout_EnableFilter
......
......@@ -43,56 +43,20 @@
* Display a picture
*
* Remove the reservation flag of a picture, which will cause it to be ready
* for display. The picture won't be displayed until vout_DatePicture has been
* called.
* for display.
*/
void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
{
vlc_mutex_lock( &p_vout->picture_lock );
switch( p_pic->i_status )
if( p_pic->i_status == RESERVED_PICTURE )
{
case RESERVED_PICTURE:
p_pic->i_status = RESERVED_DISP_PICTURE;
break;
case RESERVED_DATED_PICTURE:
p_pic->i_status = READY_PICTURE;
break;
default:
msg_Err( p_vout, "picture to display %p has invalid status %d",
p_pic, p_pic->i_status );
break;
}
vlc_mutex_unlock( &p_vout->picture_lock );
}
/**
* Date a picture
*
* Remove the reservation flag of a picture, which will cause it to be ready
* for display. The picture won't be displayed until vout_DisplayPicture has
* been called.
* \param p_vout The vout in question
* \param p_pic The picture to date
* \param date The date to display the picture
*/
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 )
else
{
case RESERVED_PICTURE:
p_pic->i_status = RESERVED_DATED_PICTURE;
break;
case RESERVED_DISP_PICTURE:
p_pic->i_status = READY_PICTURE;
break;
default:
msg_Err( p_vout, "picture to date %p has invalid status %d",
msg_Err( p_vout, "picture to display %p has invalid status %d",
p_pic, p_pic->i_status );
break;
}
vlc_mutex_unlock( &p_vout->picture_lock );
......@@ -252,9 +216,7 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic )
#ifndef NDEBUG
/* Check if picture status is valid */
if( (p_pic->i_status != RESERVED_PICTURE) &&
(p_pic->i_status != RESERVED_DATED_PICTURE) &&
(p_pic->i_status != RESERVED_DISP_PICTURE) )
if( p_pic->i_status != RESERVED_PICTURE )
{
msg_Err( p_vout, "picture to destroy %p has invalid status %d",
p_pic, p_pic->i_status );
......
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