#include <vlc_filter.h>
#include <vlc_image.h>
#include <vlc_block.h>
+#include <vlc_picture_fifo.h>
+#include <vlc_picture_pool.h>
#include "vout_pictures.h"
#include "vout_internal.h"
* thread which direct buffer needs to be displayed.
*/
picture_t *vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
- subpicture_t *p_subpic, bool b_paused )
+ subpicture_t *p_subpic, mtime_t render_date )
{
if( p_pic == NULL )
return NULL;
spu_RenderSubpictures( p_vout->p_spu,
PP_OUTPUTPICTURE[0], &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in, b_paused );
+ p_subpic, &p_vout->fmt_in, render_date );
vout_UnlockPicture( p_vout, PP_OUTPUTPICTURE[0] );
picture_Copy( PP_OUTPUTPICTURE[0], p_pic );
spu_RenderSubpictures( p_vout->p_spu,
PP_OUTPUTPICTURE[0], &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in, b_paused );
+ p_subpic, &p_vout->fmt_in, render_date );
vout_UnlockPicture( p_vout, PP_OUTPUTPICTURE[0] );
/* Render subpictures on the first direct buffer */
spu_RenderSubpictures( p_vout->p_spu,
p_tmp_pic, &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in, b_paused );
+ p_subpic, &p_vout->fmt_in, render_date );
if( vout_LockPicture( p_vout, &p_vout->p_picture[0] ) )
return NULL;
/* Render subpictures on the first direct buffer */
spu_RenderSubpictures( p_vout->p_spu,
&p_vout->p_picture[0], &p_vout->fmt_out,
- p_subpic, &p_vout->fmt_in, b_paused );
+ p_subpic, &p_vout->fmt_in, render_date );
}
vout_UnlockPicture( p_vout, &p_vout->p_picture[0] );
vlc_fourcc_t i_chroma,
int i_width, int i_height, int i_aspect )
{
+ VLC_UNUSED(p_this);
int i_bytes, i_index, i_width_aligned, i_height_aligned;
/* Make sure the real dimensions are a multiple of 16 */
picture_Delete( p_picture );
}
+/*****************************************************************************
+ *
+ *****************************************************************************/
+void picture_Reset( picture_t *p_picture )
+{
+ /* */
+ p_picture->date = VLC_TS_INVALID;
+ p_picture->b_force = false;
+ p_picture->b_progressive = false;
+ p_picture->i_nb_fields = 0;
+ p_picture->b_top_field_first = false;
+ picture_CleanupQuant( p_picture );
+}
+
/*****************************************************************************
*
*****************************************************************************/
p_picture->p->i_visible_lines = i_height;
p_picture->p->i_pitch = i_width_aligned;
p_picture->p->i_visible_pitch = i_width;
- p_picture->p->i_pixel_pitch = 8;
+ p_picture->p->i_pixel_pitch = 1;
p_picture->i_planes = 1;
break;
p_picture->p->i_visible_lines = i_height;
p_picture->p->i_pitch = i_width_aligned * 2;
p_picture->p->i_visible_pitch = i_width * 2;
- p_picture->p->i_pixel_pitch = 4;
+ p_picture->p->i_pixel_pitch = 2;
p_picture->i_planes = 1;
break;
/*****************************************************************************
*
*****************************************************************************/
-picture_t *picture_New( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect )
+picture_t *picture_NewFromResource( const video_format_t *p_fmt, const picture_resource_t *p_resource )
{
+ video_format_t fmt = *p_fmt;
+
+ /* It is needed to be sure all informations are filled */
+ video_format_Setup( &fmt, p_fmt->i_chroma,
+ p_fmt->i_width, p_fmt->i_height, p_fmt->i_aspect );
+
+ /* */
picture_t *p_picture = calloc( 1, sizeof(*p_picture) );
if( !p_picture )
return NULL;
- if( __vout_AllocatePicture( NULL, p_picture,
- i_chroma, i_width, i_height, i_aspect ) )
+ if( p_resource )
{
- free( p_picture );
- return NULL;
- }
+ if( picture_Setup( p_picture, fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect ) )
+ {
+ free( p_picture );
+ return NULL;
+ }
+ p_picture->p_sys = p_resource->p_sys;
+ for( int i = 0; i < p_picture->i_planes; i++ )
+ {
+ p_picture->p[i].p_pixels = p_resource->p[i].p_pixels;
+ p_picture->p[i].i_lines = p_resource->p[i].i_lines;
+ p_picture->p[i].i_pitch = p_resource->p[i].i_pitch;
+ }
+ }
+ else
+ {
+ if( __vout_AllocatePicture( NULL, p_picture,
+ fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect ) )
+ {
+ free( p_picture );
+ return NULL;
+ }
+ }
+ /* */
+ p_picture->format = fmt;
p_picture->i_refcount = 1;
p_picture->pf_release = PictureReleaseCallback;
p_picture->i_status = RESERVED_PICTURE;
return p_picture;
}
+picture_t *picture_NewFromFormat( const video_format_t *p_fmt )
+{
+ return picture_NewFromResource( p_fmt, NULL );
+}
+picture_t *picture_New( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect )
+{
+ video_format_t fmt;
+
+ memset( &fmt, 0, sizeof(fmt) );
+ video_format_Setup( &fmt, i_chroma, i_width, i_height, i_aspect );
+
+ return picture_NewFromFormat( &fmt );
+}
/*****************************************************************************
*
return VLC_SUCCESS;
}
-/*****************************************************************************
- *
- *****************************************************************************/