[vlc-devel] [PATCH] es_format: display orientation with video format

Thomas Guillem thomas at gllm.fr
Fri Jan 22 14:41:29 UTC 2021


+1

On Fri, Jan 22, 2021, at 15:37, Alexandre Janniaux wrote:
> ---
>  src/misc/es_format.c | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/src/misc/es_format.c b/src/misc/es_format.c
> index 77c512a90a..f6e2671e80 100644
> --- a/src/misc/es_format.c
> +++ b/src/misc/es_format.c
> @@ -374,16 +374,36 @@ bool video_format_IsSimilar( const video_format_t 
> *f1,
>      }
>      return true;
>  }
> +
> +static const char *OrientToString(video_orientation_t orient)
> +{
> +    switch(orient)
> +    {
> +        case ORIENT_NORMAL: return "normal";
> +        case ORIENT_TRANSPOSED: return "transposed";
> +        case ORIENT_ANTI_TRANSPOSED: return "antitransposed";
> +        case ORIENT_HFLIPPED: return "hflip";
> +        case ORIENT_VFLIPPED: return "vflip";
> +        case ORIENT_ROTATED_180: return "80";
> +        case ORIENT_ROTATED_270: return "270";
> +        case ORIENT_ROTATED_90: return "90";
> +        default:
> +            vlc_assert_unreachable();
> +    }
> +}
> +
>  void video_format_Print( vlc_object_t *p_this,
>                           const char *psz_text, const video_format_t 
> *fmt )
>  {
> +    const char *orient = OrientToString(fmt->orientation);
>      msg_Dbg( p_this,
> -             "%s sz %ux%u, of (%u,%u), vsz %ux%u, 4cc %4.4s, sar 
> %u:%u, msk r0x%" PRIx32 " g0x%" PRIx32 " b0x%" PRIx32,
> +             "%s sz %ux%u, of (%u,%u), vsz %ux%u, 4cc %4.4s, sar 
> %u:%u, orient: %s, msk r0x%" PRIx32 " g0x%" PRIx32 " b0x%" PRIx32,
>               psz_text,
>               fmt->i_width, fmt->i_height, fmt->i_x_offset, 
> fmt->i_y_offset,
>               fmt->i_visible_width, fmt->i_visible_height,
>               (char*)&fmt->i_chroma,
>               fmt->i_sar_num, fmt->i_sar_den,
> +             orient,
>               fmt->i_rmask, fmt->i_gmask, fmt->i_bmask );
>  }
>  
> -- 
> 2.30.0
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list