+ /* 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;
+ 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;
+
+ /* Initialize locks */
+ vlc_mutex_init( p_vout, &p_vout->picture_lock );
+ vlc_mutex_init( p_vout, &p_vout->change_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 );