* with picture_Hold and picture_Release. This default management will release
* p_sys, p_q, p_data_orig fields if non NULL.
*/
-VLC_EXPORT( picture_t *, picture_New, ( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
+VLC_EXPORT( picture_t *, picture_New, ( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den ) );
/**
* This function will create a new picture using the given format.
*
* It can be usefull to get the properties of planes.
*/
-VLC_EXPORT( int, picture_Setup, ( picture_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect ) );
+VLC_EXPORT( int, picture_Setup, ( picture_t *, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den ) );
/*****************************************************************************
* Flags used to describe the status of a picture
* \param i_height the wanted height for the picture.
* \param i_aspect the wanted aspect ratio for the picture.
*/
-#define vout_AllocatePicture(a,b,c,d,e,f) \
- __vout_AllocatePicture(VLC_OBJECT(a),b,c,d,e,f)
-VLC_EXPORT( int, __vout_AllocatePicture,( vlc_object_t *p_this, picture_t *p_pic, uint32_t i_chroma, int i_width, int i_height, int i_aspect ) );
+#define vout_AllocatePicture(a,b,c,d,e,f,g) \
+ __vout_AllocatePicture(VLC_OBJECT(a),b,c,d,e,f,g)
+VLC_EXPORT( int, __vout_AllocatePicture,( vlc_object_t *p_this, picture_t *p_pic, uint32_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den ) );
/**
i_height = p_sys->height;
if( picture_Setup( &p_sys->pic, VLC_CODEC_UYVY,
- i_width, i_height,
- i_width * VOUT_ASPECT_FACTOR / i_height ) )
+ i_width, i_height, 1, 1 ) )
{
msg_Err( p_demux ,"unknown chroma" );
Close( p_this );
p_sys->fmt.video.i_chroma,
p_sys->fmt.video.i_width,
p_sys->fmt.video.i_height,
- p_sys->fmt.video.i_aspect );
+ p_sys->fmt.video.i_aspect * p_sys->fmt.video.i_height,
+ VOUT_ASPECT_FACTOR * p_sys->fmt.video.i_width );
if( !p_sys->p_blend )
{
p_sys->p_blend = vlc_object_create( p_demux, sizeof(filter_t) );
{
/* Fill in picture_t fields */
if( picture_Setup( &p_sys->pic, p_sys->i_fourcc,
- p_sys->i_width, p_sys->i_height, p_sys->i_width *
- VOUT_ASPECT_FACTOR / p_sys->i_height ) )
+ p_sys->i_width, p_sys->i_height,
+ 1, 1 ) )
{
msg_Err( p_demux, "unsupported chroma" );
goto vdev_failed;
/* Fill in picture_t fields */
picture_Setup( &pic, p_dec->fmt_out.i_codec,
p_dec->fmt_out.video.i_width,
- p_dec->fmt_out.video.i_height, VOUT_ASPECT_FACTOR );
+ p_dec->fmt_out.video.i_height, 0, 1 );
if( !pic.i_planes )
{
p_new_pic = picture_New( p_pic->format.i_chroma,
p_pic->format.i_width, p_pic->format.i_height,
- p_sys->p_decoder->fmt_out.video.i_aspect );
+ p_sys->p_decoder->fmt_out.video.i_aspect * p_pic->format.i_height,
+ VOUT_ASPECT_FACTOR * p_pic->format.i_width );
if( !p_new_pic )
{
picture_Release( p_pic );
}
if( picture_Setup( p_pic, VLC_CODEC_I420,
- i_width, i_height,
- i_width * VOUT_ASPECT_FACTOR / i_height ) )
+ i_width, i_height, 1, 1 ) )
{
msg_Err( p_stream, "unknown chroma" );
return -1;
moinsDix = 0.32*scale + 20;
moinsVingt = 0.1*scale + 20;
- p_pic = picture_New(VLC_FOURCC('Y','U','V','A'), i_width+20, scale+30, VOUT_ASPECT_FACTOR * (i_width+20)/(scale+30));
+ p_pic = picture_New(VLC_FOURCC('Y','U','V','A'), i_width+20, scale+30, 1, 1);
// blacken the whole picture
for( i = 0 ; i < p_pic->i_planes ; i++ )
1, 1 );
if( vout_AllocatePicture( p_filter, p_ovl->data.p_pic,
p_ovl->format.i_chroma, p_params->i_width,
- p_params->i_height, p_ovl->format.i_aspect ) )
+ p_params->i_height,
+ p_ovl->format.i_aspect * p_params->i_height,
+ VOUT_ASPECT_FACTOR * p_params->i_width ) )
{
msg_Err( p_filter, "Unable to allocate picture" );
free( p_ovl->data.p_pic );
vout_AllocatePicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma,
p_vout->output.i_width,
p_vout->output.i_height,
- p_vout->output.i_aspect );
+ p_vout->output.i_aspect * p_vout->output.i_height,
+ VOUT_ASPECT_FACTOR * p_vout->output.i_width );
if( !p_pic->i_planes )
break;
/* Create an empty picture for VNC the data */
vlc_mutex_lock( &p_sys->lock );
p_sys->p_pic = picture_New( VLC_CODEC_YUVA,
- p_sys->i_vnc_width, p_sys->i_vnc_height, VOUT_ASPECT_FACTOR );
+ p_sys->i_vnc_width, p_sys->i_vnc_height, 1, 1 );
if( !p_sys->p_pic )
{
vlc_mutex_unlock( &p_sys->lock );
}
if( p_sys->ctxA )
{
- p_sys->p_src_a = picture_New( VLC_CODEC_GREY, i_fmti_width, p_fmti->i_height, 0 );
- p_sys->p_dst_a = picture_New( VLC_CODEC_GREY, i_fmto_width, p_fmto->i_height, 0 );
+ p_sys->p_src_a = picture_New( VLC_CODEC_GREY, i_fmti_width, p_fmti->i_height, 0, 1 );
+ p_sys->p_dst_a = picture_New( VLC_CODEC_GREY, i_fmto_width, p_fmto->i_height, 0, 1 );
}
if( p_sys->i_extend_factor != 1 )
{
- p_sys->p_src_e = picture_New( p_fmti->i_chroma, i_fmti_width, p_fmti->i_height, 0 );
- p_sys->p_dst_e = picture_New( p_fmto->i_chroma, i_fmto_width, p_fmto->i_height, 0 );
+ p_sys->p_src_e = picture_New( p_fmti->i_chroma, i_fmti_width, p_fmti->i_height, 0, 1 );
+ p_sys->p_dst_e = picture_New( p_fmto->i_chroma, i_fmto_width, p_fmto->i_height, 0, 1 );
memset( p_sys->p_src_e->p[0].p_pixels, 0, p_sys->p_src_e->p[0].i_pitch * p_sys->p_src_e->p[0].i_lines );
memset( p_sys->p_dst_e->p[0].p_pixels, 0, p_sys->p_dst_e->p[0].i_pitch * p_sys->p_dst_e->p[0].i_lines );
/* Fill in picture_t fields */
picture_Setup( p_pic, p_vout->output.i_chroma,
p_vout->output.i_width, p_vout->output.i_height,
- p_vout->output.i_aspect );
+ p_vout->output.i_aspect * p_vout->output.i_height,
+ VOUT_ASPECT_FACTOR * p_vout->output.i_width );
p_pic->p_sys->p_image = new CascadeSharedMemZone();
if( p_pic->p_sys->p_image == NULL )
vout_AllocatePicture( p_vout, p_pic, p_vout->output.i_chroma,
p_vout->output.i_width, p_vout->output.i_height,
- p_vout->output.i_aspect );
+ p_vout->output.i_aspect * p_vout->output.i_height,
+ VOUT_ASPECT_FACTOR * p_vout->output.i_width );
if( p_pic->i_planes == 0 )
{
vout_AllocatePicture(VLC_OBJECT(vd), picture,
vd->source.i_chroma,
vd->source.i_width, vd->source.i_height,
- vd->source.i_aspect);
+ vd->source.i_aspect * vd->source.i_height,
+ VOUT_ASPECT_FACTOR * vd->source.i_width);
if (!picture->i_planes)
break;
picture->p_sys->direct = NULL;
if (!p_sys->pool)
{
picture_t *pic = picture_New (vd->fmt.i_chroma, p_sys->att->width,
- p_sys->att->height, 0);
+ p_sys->att->height, 0, 1);
if (!pic)
return NULL;
vout_AllocatePicture( VLC_OBJECT(p_vout),
p_freepic, p_vout->render.i_chroma,
p_vout->render.i_width, p_vout->render.i_height,
- p_vout->render.i_aspect );
+ p_vout->render.i_aspect * p_vout->render.i_height,
+ VOUT_ASPECT_FACTOR * p_vout->render.i_width);
if( p_freepic->i_planes )
{
p_tmp_pic, p_vout->fmt_out.i_chroma,
p_vout->fmt_out.i_width,
p_vout->fmt_out.i_height,
- p_vout->fmt_out.i_aspect );
+ p_vout->fmt_out.i_aspect * p_vout->fmt_out.i_height,
+ VOUT_ASPECT_FACTOR * p_vout->fmt_out.i_width );
p_tmp_pic->i_type = MEMORY_PICTURE;
p_tmp_pic->i_status = RESERVED_PICTURE;
}
*/
int __vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
vlc_fourcc_t i_chroma,
- int i_width, int i_height, int i_aspect )
+ int i_width, int i_height,
+ int i_sar_num, int i_sar_den )
{
VLC_UNUSED(p_this);
int i_index, i_width_aligned, i_height_aligned;
i_width_aligned = (i_width + 15) >> 4 << 4;
i_height_aligned = (i_height + 15) >> 4 << 4;
- if( picture_Setup( p_pic, i_chroma,
- i_width, i_height, i_aspect ) != VLC_SUCCESS )
+ if( picture_Setup( p_pic, i_chroma, i_width, i_height,
+ i_sar_num, i_sar_den ) != VLC_SUCCESS )
{
p_pic->i_planes = 0;
return VLC_EGENERIC;
/*****************************************************************************
*
*****************************************************************************/
-int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect )
+int picture_Setup( picture_t *p_picture, vlc_fourcc_t i_chroma,
+ int i_width, int i_height, int i_sar_num, int i_sar_den )
{
int i_index, i_width_aligned, i_height_aligned;
p_picture->p_q = NULL;
video_format_Setup( &p_picture->format, i_chroma, i_width, i_height,
- i_aspect * i_height, VOUT_ASPECT_FACTOR * i_width );
+ i_sar_num, i_sar_den );
/* Make sure the real dimensions are a multiple of 16 */
i_width_aligned = (i_width + 15) >> 4 << 4;
if( p_resource )
{
- if( picture_Setup( p_picture, fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect ) )
+ if( picture_Setup( p_picture, fmt.i_chroma, fmt.i_width, fmt.i_height,
+ fmt.i_sar_num, fmt.i_sar_den ) )
{
free( p_picture );
return NULL;
else
{
if( __vout_AllocatePicture( NULL, p_picture,
- fmt.i_chroma, fmt.i_width, fmt.i_height, fmt.i_aspect ) )
+ fmt.i_chroma, fmt.i_width, fmt.i_height,
+ fmt.i_sar_num, fmt.i_sar_den ) )
{
free( p_picture );
return NULL;
{
return picture_NewFromResource( p_fmt, NULL );
}
-picture_t *picture_New( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_aspect )
+picture_t *picture_New( vlc_fourcc_t i_chroma, int i_width, int i_height, int i_sar_num, int i_sar_den )
{
video_format_t fmt;
memset( &fmt, 0, sizeof(fmt) );
video_format_Setup( &fmt, i_chroma, i_width, i_height,
- i_aspect * i_height, VOUT_ASPECT_FACTOR * i_width );
+ i_sar_num, i_sar_den );
return picture_NewFromFormat( &fmt );
}