Commit c95c8ab4 authored by Rafaël Carré's avatar Rafaël Carré

vout_Snapshot(): hability to specify width & height when the snapshot isn't taken by an object.

Value of 0 for width OR height means that we want to keep the original aspect ratio.
parent b879f3e1
......@@ -705,6 +705,20 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
free( val.psz_string );
free( format.psz_string );
fmt_out.i_width = var_GetInteger( p_vout, "snapshot-width" );
fmt_out.i_height = var_GetInteger( p_vout, "snapshot-height" );
if( fmt_out.i_width == 0 && fmt_out.i_height > 0 )
{
float f = (float)p_vout->fmt_in.i_height / fmt_out.i_height;
fmt_out.i_width = p_vout->fmt_in.i_width / f;
}
else if( fmt_out.i_height == 0 && fmt_out.i_width > 0 )
{
float f = (float)p_vout->fmt_in.i_width / fmt_out.i_width;
fmt_out.i_height = p_vout->fmt_in.i_height / f;
}
/* Save the snapshot */
fmt_in = p_vout->fmt_in;
fmt_out.i_sar_num = fmt_out.i_sar_den = 1;
......
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