#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_codec.h>
-#include <vlc_vout.h>
/*****************************************************************************
* decoder_sys_t : raw video decoder descriptor
}
/* Find out p_vdec->i_raw_size */
- vout_InitFormat( &p_dec->fmt_out.video, p_dec->fmt_in.i_codec,
- p_dec->fmt_in.video.i_width,
- p_dec->fmt_in.video.i_height,
- p_dec->fmt_in.video.i_aspect );
+ video_format_Setup( &p_dec->fmt_out.video, p_dec->fmt_in.i_codec,
+ p_dec->fmt_in.video.i_width,
+ p_dec->fmt_in.video.i_height,
+ p_dec->fmt_in.video.i_aspect );
p_sys->i_raw_size = p_dec->fmt_out.video.i_bits_per_pixel *
p_dec->fmt_out.video.i_width * p_dec->fmt_out.video.i_height / 8;
p_block = *pp_block;
- if( !p_block->i_pts && !p_block->i_dts && !date_Get( &p_sys->pts ) )
+ if( p_block->i_pts <= VLC_TS_INVALID && p_block->i_dts <= VLC_TS_INVALID &&
+ !date_Get( &p_sys->pts ) )
{
/* We've just started the stream, wait for the first PTS. */
block_Release( p_block );
}
/* Date management: If there is a pts avaliable, use that. */
- if( p_block->i_pts )
+ if( p_block->i_pts > VLC_TS_INVALID )
{
date_Set( &p_sys->pts, p_block->i_pts );
}
- else if( p_block->i_dts )
+ else if( p_block->i_dts > VLC_TS_INVALID )
{
/* NB, davidf doesn't quite agree with this in general, it is ok
* for rawvideo since it is in order (ie pts=dts), however, it
FillPicture( p_dec, p_block, p_pic );
p_pic->date = date_Get( &p_sys->pts );
- p_pic->b_progressive = true;
+ if( p_block->i_flags & BLOCK_FLAG_INTERLACED_MASK )
+ {
+ p_pic->b_progressive = false;
+ p_pic->i_nb_fields = 2;
+ if( p_block->i_flags & BLOCK_FLAG_TOP_FIELD_FIRST )
+ p_pic->b_top_field_first = true;
+ else
+ p_pic->b_top_field_first = false;
+ }
+ else
+ p_pic->b_progressive = true;
block_Release( p_block );
return p_pic;
int i, j;
/* Fill in picture_t fields */
- vout_InitPicture( VLC_OBJECT(p_dec), &pic, p_dec->fmt_out.i_codec,
- p_dec->fmt_out.video.i_width,
- p_dec->fmt_out.video.i_height, VOUT_ASPECT_FACTOR );
+ 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 );
if( !pic.i_planes )
{