X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Frawvideo.c;h=fd71d99dd5fce5710584a3646732f570f4f32892;hb=dc272d02ae532dcad26b327cae93d5c62755a2ac;hp=d6998325d1d73fb7cdd63c013a5dba9b417ac706;hpb=78d87996ccb92d1dc91c9987685f976ed3be08a6;p=vlc diff --git a/modules/codec/rawvideo.c b/modules/codec/rawvideo.c index d6998325d1..fd71d99dd5 100644 --- a/modules/codec/rawvideo.c +++ b/modules/codec/rawvideo.c @@ -92,9 +92,13 @@ static int OpenDecoder( vlc_object_t *p_this ) { /* Planar YUV */ case VLC_CODEC_I444: + case VLC_CODEC_J444: case VLC_CODEC_I422: + case VLC_CODEC_J422: case VLC_CODEC_I420: + case VLC_CODEC_J420: case VLC_CODEC_YV12: + case VLC_CODEC_YV9: case VLC_CODEC_I411: case VLC_CODEC_I410: case VLC_CODEC_GREY: @@ -159,14 +163,15 @@ static int OpenDecoder( vlc_object_t *p_this ) 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_dec->fmt_in.video.i_sar_num, + p_dec->fmt_in.video.i_sar_den ); 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; - if( !p_dec->fmt_in.video.i_aspect ) + if( !p_dec->fmt_in.video.i_sar_num || !p_dec->fmt_in.video.i_sar_den ) { - p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * - p_dec->fmt_out.video.i_width / p_dec->fmt_out.video.i_height; + p_dec->fmt_out.video.i_sar_num = 1; + p_dec->fmt_out.video.i_sar_den = 1; } /* Set callbacks */ @@ -205,7 +210,8 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) 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 ); @@ -213,11 +219,11 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_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 @@ -298,7 +304,17 @@ static picture_t *DecodeFrame( decoder_t *p_dec, block_t *p_block ) 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; @@ -322,7 +338,7 @@ static block_t *SendFrame( decoder_t *p_dec, block_t *p_block ) /* 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 ) {