* 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
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 * ) );
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++ )
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++ )
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 )
/* 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;
}
}
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 );
}
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;
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 );
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++ )
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 );
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 );
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++ )
{
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 );
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 );
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 );
}
#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 );
}
p_owner->i_last_rate = i_rate;
}
- vout_DatePicture( p_vout, p_picture, p_picture->date );
-
vout_DisplayPicture( p_vout, p_picture );
}
else
vout_ControlWindow
__vout_Create
vout_CreatePicture
-vout_DatePicture
vout_DestroyPicture
vout_DisplayPicture
vout_EnableFilter
* 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 );
#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 );