* vout_pictures.c : picture management functions
*****************************************************************************
* Copyright (C) 2000 VideoLAN
- * $Id: vout_pictures.c,v 1.34 2003/01/22 10:44:50 fenrir Exp $
+ * $Id: vout_pictures.c,v 1.38 2003/04/27 17:53:21 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
if( p_pic->i_refcount < 0 )
{
- msg_Err( p_vout, "picture refcount is %i", p_pic->i_refcount );
+ msg_Err( p_vout, "picture %p refcount is %i",
+ p_pic, p_pic->i_refcount );
p_pic->i_refcount = 0;
}
/* Picture is not in a direct buffer, but is exactly the
* same size as the direct buffers. A memcpy() is enough,
* then render the subtitles. */
+
+ if( PP_OUTPUTPICTURE[0]->pf_lock )
+ if( PP_OUTPUTPICTURE[0]->pf_lock( p_vout, PP_OUTPUTPICTURE[0] ) )
+ {
+ if( PP_OUTPUTPICTURE[0]->pf_unlock )
+ PP_OUTPUTPICTURE[0]->pf_unlock( p_vout, PP_OUTPUTPICTURE[0] );
+
+ return NULL;
+ }
+
CopyPicture( p_vout, p_pic, PP_OUTPUTPICTURE[0] );
vout_RenderSubPictures( p_vout, PP_OUTPUTPICTURE[0], p_subpic );
+ if( PP_OUTPUTPICTURE[0]->pf_unlock )
+ PP_OUTPUTPICTURE[0]->pf_unlock( p_vout, PP_OUTPUTPICTURE[0] );
+
return PP_OUTPUTPICTURE[0];
}
* well. This usually means software YUV, or hardware YUV with a
* different chroma. */
+ if( p_vout->p_picture[0].pf_lock )
+ if( p_vout->p_picture[0].pf_lock( p_vout, &p_vout->p_picture[0] ) )
+ return NULL;
+
/* Convert image to the first direct buffer */
p_vout->chroma.pf_convert( p_vout, p_pic, &p_vout->p_picture[0] );
/* Render subpictures on the first direct buffer */
vout_RenderSubPictures( p_vout, &p_vout->p_picture[0], p_subpic );
+ if( p_vout->p_picture[0].pf_unlock )
+ p_vout->p_picture[0].pf_unlock( p_vout, &p_vout->p_picture[0] );
+
return &p_vout->p_picture[0];
}
/* Calculate coordinates */
switch( i_chroma )
{
+ case FOURCC_I411:
+ p_pic->p[ Y_PLANE ].i_lines = i_height;
+ p_pic->p[ Y_PLANE ].i_pitch = i_width;
+ p_pic->p[ Y_PLANE ].i_visible_pitch = p_pic->p[ Y_PLANE ].i_pitch;
+ p_pic->p[ U_PLANE ].i_lines = i_height;
+ p_pic->p[ U_PLANE ].i_pitch = i_width / 4;
+ p_pic->p[ U_PLANE ].i_visible_pitch = p_pic->p[ U_PLANE ].i_pitch;
+ p_pic->p[ V_PLANE ].i_lines = i_height;
+ p_pic->p[ V_PLANE ].i_pitch = i_width / 4;
+ p_pic->p[ V_PLANE ].i_visible_pitch = p_pic->p[ V_PLANE ].i_pitch;
+ p_pic->i_planes = 3;
+ break;
+
case FOURCC_I410:
p_pic->p[ Y_PLANE ].i_lines = i_height;
p_pic->p[ Y_PLANE ].i_pitch = i_width;
p_pic->i_planes = 1;
break;
+ case FOURCC_RV24:
+ p_pic->p->i_lines = i_height;
+ p_pic->p->i_pitch = i_width * 3;
+ p_pic->p->i_visible_pitch = p_pic->p->i_pitch;
+ p_pic->p->i_pixel_pitch = 3;
+/* FIXME: p_heap isn't always reachable
+ p_pic->p_heap->i_rmask = 0xff0000;
+ p_pic->p_heap->i_gmask = 0x00ff00;
+ p_pic->p_heap->i_bmask = 0x0000ff; */
+ p_pic->i_planes = 1;
+ break;
+
case FOURCC_RV32:
p_pic->p->i_lines = i_height;
p_pic->p->i_pitch = i_width * 4;