Commit 5a5410f6 authored by Matthias Keiser's avatar Matthias Keiser Committed by Rémi Denis-Courmont

Make most video filters bail if the inputand output orientation doesn't match.

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 47b703a0
......@@ -72,7 +72,8 @@ static int Activate( vlc_object_t *p_this )
}
if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height
|| p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation )
return -1;
switch( p_filter->fmt_in.video.i_chroma )
......
......@@ -113,6 +113,11 @@ static int Activate( vlc_object_t *p_this )
return VLC_EGENERIC;
}
if( p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation )
{
return VLC_EGENERIC;
}
switch( p_filter->fmt_in.video.i_chroma )
{
case VLC_CODEC_YV12:
......
......@@ -128,7 +128,8 @@ static int Activate( vlc_object_t *p_this )
}
if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height
|| p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation )
return -1;
switch( p_filter->fmt_in.video.i_chroma )
......
......@@ -74,7 +74,8 @@ static int Activate( vlc_object_t *p_this )
}
if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height
|| p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation )
return -1;
switch( p_filter->fmt_in.video.i_chroma )
......
......@@ -104,6 +104,11 @@ static int Activate( vlc_object_t *p_this )
return -1;
}
if( p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation )
{
return VLC_EGENERIC;
}
switch( p_filter->fmt_in.video.i_chroma )
{
case VLC_CODEC_I422:
......
......@@ -249,6 +249,9 @@ static int Open (vlc_object_t *obj)
{
filter_t *filter = (filter_t *)obj;
if (filter->fmt_in.video.orientation != filter->fmt_out.video.orientation)
return VLC_EGENERIC;
if ((filter->fmt_in.video.i_width != filter->fmt_out.video.i_width)
|| (filter->fmt_in.video.i_height != filter->fmt_out.video.i_height))
return OpenScaler (obj);
......
......@@ -63,7 +63,8 @@ static int OpenFilter( vlc_object_t *p_this )
}
if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height
|| p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation)
return -1;
p_filter->pf_video_filter = Filter;
......
......@@ -355,12 +355,16 @@ static int Init( filter_t *p_filter )
const video_format_t *p_fmti = &p_filter->fmt_in.video;
video_format_t *p_fmto = &p_filter->fmt_out.video;
if( p_fmti->orientation != p_fmto->orientation )
return VLC_EGENERIC;
if( video_format_IsSimilar( p_fmti, &p_sys->fmt_in ) &&
video_format_IsSimilar( p_fmto, &p_sys->fmt_out ) &&
p_sys->ctx )
{
return VLC_SUCCESS;
}
Clean( p_filter );
/* Init with new parameters */
......
......@@ -76,7 +76,8 @@ static int Activate( vlc_object_t *p_this )
}
if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height
|| p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation)
return -1;
switch( p_filter->fmt_out.video.i_chroma )
......
......@@ -75,7 +75,8 @@ static int Activate( vlc_object_t *p_this )
}
if( p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
|| p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height
|| p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation)
return -1;
switch( p_filter->fmt_out.video.i_chroma )
......
......@@ -68,6 +68,9 @@ static int OpenFilter( vlc_object_t *p_this )
return VLC_EGENERIC;
}
if( p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation )
return VLC_EGENERIC;
video_format_ScaleCropAr( &p_filter->fmt_out.video, &p_filter->fmt_in.video );
p_filter->pf_video_filter = Filter;
......
......@@ -69,7 +69,8 @@ static int Open( vlc_object_t *p_this )
p_filter->fmt_out.video.i_chroma != VLC_CODEC_RGBA &&
p_filter->fmt_out.video.i_chroma != VLC_CODEC_ARGB ) ||
p_filter->fmt_in.video.i_width != p_filter->fmt_out.video.i_width ||
p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height )
p_filter->fmt_in.video.i_height != p_filter->fmt_out.video.i_height ||
p_filter->fmt_in.video.orientation != p_filter->fmt_out.video.orientation )
{
return VLC_EGENERIC;
}
......
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