-#ifdef DEBUG_VIDEO
- intf_DbgMsg("picture %p\n", p_pic);
-#endif
- vlc_mutex_unlock( &p_vout->picture_lock );
-}
-
-/*****************************************************************************
- * vout_DatePicture: 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.
- *****************************************************************************/
-void vout_DatePicture( vout_thread_t *p_vout, picture_t *p_pic, mtime_t date )
-{
-#ifdef DEBUG_VIDEO
- char psz_date[MSTRTIME_MAX_SIZE]; /* date */
-#endif
-
- 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
+ /* Initialize pictures - translation tables and functions
+ * will be initialized later in InitThread */
+ for( i_index = 0; i_index < 2 * VOUT_MAX_PICTURES + 1; i_index++)
+ {
+ p_vout->p_picture[i_index].pf_lock = NULL;
+ p_vout->p_picture[i_index].pf_unlock = NULL;
+ p_vout->p_picture[i_index].i_status = FREE_PICTURE;
+ p_vout->p_picture[i_index].i_type = EMPTY_PICTURE;
+ p_vout->p_picture[i_index].b_slow = 0;
+ }
+
+ /* No images in the heap */
+ p_vout->i_heap_size = 0;
+
+ /* Initialize the rendering heap */
+ I_RENDERPICTURES = 0;
+
+ vlc_ureduce( &p_fmt->i_sar_num, &p_fmt->i_sar_den,
+ p_fmt->i_sar_num, p_fmt->i_sar_den, 50000 );
+ p_vout->fmt_render = *p_fmt; /* FIXME palette */
+ p_vout->fmt_in = *p_fmt; /* FIXME palette */
+
+ p_vout->render.i_width = i_width;
+ p_vout->render.i_height = i_height;
+ p_vout->render.i_chroma = i_chroma;
+ p_vout->render.i_aspect = i_aspect;
+
+ p_vout->render.i_rmask = 0;
+ p_vout->render.i_gmask = 0;
+ p_vout->render.i_bmask = 0;
+
+ p_vout->render.i_last_used_pic = -1;
+ p_vout->render.b_allow_modify_pics = 1;
+
+ /* Zero the output heap */
+ I_OUTPUTPICTURES = 0;
+ p_vout->output.i_width = 0;
+ p_vout->output.i_height = 0;
+ p_vout->output.i_chroma = 0;
+ p_vout->output.i_aspect = 0;
+
+ p_vout->output.i_rmask = 0;
+ p_vout->output.i_gmask = 0;
+ p_vout->output.i_bmask = 0;
+
+ /* Initialize misc stuff */
+ p_vout->i_changes = 0;
+ p_vout->f_gamma = 0;
+ p_vout->b_grayscale = 0;
+ p_vout->b_info = 0;
+ p_vout->b_interface = 0;
+ p_vout->b_scale = 1;
+ p_vout->b_fullscreen = 0;
+ p_vout->i_alignment = 0;
+ p_vout->render_time = 10;
+ p_vout->c_fps_samples = 0;
+ p_vout->b_filter_change = 0;
+ p_vout->pf_control = 0;
+ p_vout->p_parent_intf = 0;
+ p_vout->i_par_num = p_vout->i_par_den = 1;
+
+ /* Initialize locks */
+ vlc_mutex_init( p_vout, &p_vout->picture_lock );
+ vlc_mutex_init( p_vout, &p_vout->change_lock );
+ vlc_mutex_init( p_vout, &p_vout->vfilter_lock );
+
+ /* Mouse coordinates */
+ var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER );
+ var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER );
+ var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
+ var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL );
+ var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER );
+
+ /* Initialize subpicture unit */
+ p_vout->p_spu = spu_Create( p_vout );
+ spu_Attach( p_vout->p_spu, p_parent, VLC_TRUE );
+
+ /* Attach the new object now so we can use var inheritance below */
+ vlc_object_attach( p_vout, p_parent );
+
+ spu_Init( p_vout->p_spu );
+
+ /* Take care of some "interface/control" related initialisations */
+ vout_IntfInit( p_vout );
+
+ /* If the parent is not a VOUT object, that means we are at the start of
+ * the video output pipe */
+ if( p_parent->i_object_type != VLC_OBJECT_VOUT )
+ {
+ /* Look for the default filter configuration */
+ var_Create( p_vout, "vout-filter", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_Get( p_vout, "vout-filter", &val );
+ p_vout->psz_filter_chain = val.psz_string;
+
+ /* Apply video filter2 objects on the first vout */
+ var_Create( p_vout, "video-filter",
+ VLC_VAR_STRING | VLC_VAR_DOINHERIT );
+ var_Get( p_vout, "video-filter", &val );
+ ParseVideoFilter2Chain( p_vout, val.psz_string );
+ free( val.psz_string );