Commit dd84476a authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Paul Saman

davinci resizer : Handle resolution change in the middle of a stream

Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jean-paul.saman@m2x.nl>
parent 733d2fc7
...@@ -77,7 +77,8 @@ struct decoder_sys_t ...@@ -77,7 +77,8 @@ struct decoder_sys_t
/* resizer */ /* resizer */
int i_fd_resizer; int i_fd_resizer;
vlc_bool_t b_resizer_init; unsigned int i_height;
unsigned int i_width;
#endif #endif
}; };
...@@ -428,7 +429,7 @@ int OpenVideoDecoder( vlc_object_t *p_this ) ...@@ -428,7 +429,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
goto error; goto error;
} }
p_sys->b_resizer_init = VLC_FALSE; p_sys->i_height = p_sys->i_width = 0;
#endif #endif
/* Set callbacks */ /* Set callbacks */
...@@ -692,12 +693,14 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i ...@@ -692,12 +693,14 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
} }
#else #else
if( !p_sys->b_resizer_init ) /* Sets resizer parameters when video starts or when resolution changes */
if( p_sys->i_width != p_dec->fmt_out.video.i_width ||
p_sys->i_height != p_dec->fmt_out.video.i_height )
{ {
rsz_params_t rsz_params; rsz_params_t rsz_params;
memset( &rsz_params, 0, sizeof( rsz_params ) ); memset( &rsz_params, 0, sizeof( rsz_params ) );
rsz_params.in_hsize = p_dec->fmt_out.video.i_width; rsz_params.in_hsize = p_sys->i_width = p_dec->fmt_out.video.i_width;
rsz_params.in_vsize = p_dec->fmt_out.video.i_height; rsz_params.in_vsize = p_sys->i_height = p_dec->fmt_out.video.i_height;
rsz_params.in_pitch = rsz_params.in_pitch =
(p_dec->fmt_out.video.i_width * BPP / 8 + 31) & ~31; (p_dec->fmt_out.video.i_width * BPP / 8 + 31) & ~31;
rsz_params.inptyp = RSZ_INTYPE_YCBCR422_16BIT; rsz_params.inptyp = RSZ_INTYPE_YCBCR422_16BIT;
...@@ -756,8 +759,6 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i ...@@ -756,8 +759,6 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
goto error; goto error;
} }
p_sys->b_resizer_init = VLC_TRUE;
} }
rsz_resize_t rsz; rsz_resize_t rsz;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment