[vlc-devel] [PATCH] fribidi: use version 1.0

Thomas Guillem thomas at gllm.fr
Mon Feb 26 09:05:03 CET 2018


Merged, thanks!

On Sun, Feb 25, 2018, at 16:04, Shaleen Jain wrote:
> 
> Hello,
> 
> On Sun, Feb 25, 2018, 4:57 PM Thomas Guillem <thomas at gllm.fr> wrote:
>> Hello,
>> 
>>  On Fri, Feb 23, 2018, at 15:48, Shaleen Jain wrote:
>>  > update functions deprecated in version 1.0
>>  > ---
>>  >  Not tested with complex script subtitles
>>  >
>>  >  configure.ac                                 |  2 +-
>>  >  modules/text_renderer/freetype/text_layout.c | 11 ++++++++++-
>>  >  2 files changed, 11 insertions(+), 2 deletions(-)
>>  >
>>  > diff --git a/configure.ac b/configure.ac
>>  > index 6573e9b99a..b8a5ed76f0 100644
>>  > --- a/configure.ac
>>  > +++ b/configure.ac
>>  > @@ -3227,7 +3227,7 @@ if test "${enable_freetype}" != "no"; then
>>  >
>>  >        dnl fribidi support
>>  >        if test "${enable_fribidi}" != "no"; then
>>  > -        PKG_CHECK_MODULES(FRIBIDI, fribidi, [
>>  > +        PKG_CHECK_MODULES(FRIBIDI, [fribidi >= 1.0], [
>> 
>>  You can't do that, this will break build for most OSses (Debian
>>  stable is still on 0.19.7 for example). You also need to update the
>>  fribidi contrib and make sure it builds for other OSes.>> 
>>  I'm not sure if we want to force fribidi 1.0 for VLC 4.0. This need
>>  to be discussed with everyone.>>  In the meantime, you can add 1.0 specific functions inside a #ifdef
>>  that check the fribidi version.> 
>> 
> Thanks for the review. I have sent an updated patch which
> conditionally adds support for fribidi version 1 and above.>> 
>> >            have_fribidi="yes"
>>  >            VLC_ADD_CPPFLAGS([skins2], [${FRIBIDI_CFLAGS} -
>>  > DHAVE_FRIBIDI])
>>  >            VLC_ADD_LIBS([skins2], [${FRIBIDI_LIBS}])
>>  > diff --git a/modules/text_renderer/freetype/text_layout.c
>>  > b/modules/>>  > text_renderer/freetype/text_layout.c
>>  > index 13efd567b4..476c273ef8 100644
>>  > --- a/modules/text_renderer/freetype/text_layout.c
>>  > +++ b/modules/text_renderer/freetype/text_layout.c
>>  > @@ -153,6 +153,7 @@ typedef struct paragraph_t
>>  >
>>  >  #ifdef HAVE_FRIBIDI
>>  >      FriBidiCharType     *p_types;
>>  > +    FriBidiBracketType  *p_btypes;
>>  >      FriBidiLevel        *p_levels;
>>  >      FriBidiStrIndex     *pi_reordered_indices;
>>  >      FriBidiParType       paragraph_type;
>>  > @@ -361,6 +362,7 @@ static paragraph_t *NewParagraph( filter_t
>>  > *p_filter,
>>  >  #ifdef HAVE_FRIBIDI
>>  >      p_paragraph->p_levels = vlc_alloc( i_size, sizeof( *p_paragraph->>  > >p_levels ) );
>>  >      p_paragraph->p_types = vlc_alloc( i_size, sizeof( *p_paragraph->>  > >p_types ) );
>>  > +    p_paragraph->p_btypes = vlc_alloc( i_size, sizeof( *p_paragraph->>  > >p_btypes ) );
>>  >      p_paragraph->pi_reordered_indices =
>>  >              vlc_alloc( i_size, sizeof( *p_paragraph-
>>  > >pi_reordered_indices ) );
>>  >
>>  > @@ -398,6 +400,7 @@ error:
>>  >  #ifdef HAVE_FRIBIDI
>>  >      if( p_paragraph->p_levels ) free( p_paragraph->p_levels );
>>  >      if( p_paragraph->p_types ) free( p_paragraph->p_types );
>>  > +    if( p_paragraph->p_btypes ) free( p_paragraph->p_btypes );
>>  >      if( p_paragraph->pi_reordered_indices )
>>  >          free( p_paragraph->pi_reordered_indices );
>>  >  #endif
>>  > @@ -424,6 +427,7 @@ static void FreeParagraph( paragraph_t
>>  > *p_paragraph )>>  >  #ifdef HAVE_FRIBIDI
>>  >      free( p_paragraph->pi_reordered_indices );
>>  >      free( p_paragraph->p_types );
>>  > +    free( p_paragraph->p_btypes );
>>  >      free( p_paragraph->p_levels );
>>  >  #endif
>>  >
>>  > @@ -436,7 +440,12 @@ static int AnalyzeParagraph( paragraph_t
>>  > *p_paragraph )>>  >      fribidi_get_bidi_types(  p_paragraph->p_code_points,
>>  >                               p_paragraph->i_size,
>>  >                               p_paragraph->p_types );
>>  > -    fribidi_get_par_embedding_levels( p_paragraph->p_types,
>>  > +    fribidi_get_bracket_types( p_paragraph->p_code_points,
>>  > +                               p_paragraph->i_size,
>>  > +                               p_paragraph->p_types,
>>  > +                               p_paragraph->p_btypes );
>>  > +    fribidi_get_par_embedding_levels_ex( p_paragraph->p_types,
>>  > +                                      p_paragraph->p_btypes,
>>  >                                        p_paragraph->i_size,
>>  >                                        &p_paragraph-
>>  >                                        >paragraph_type,>>  >                                        p_paragraph->p_levels );
>>  > --
>>  > 2.16.2
>>  > _______________________________________________
>>  > vlc-devel mailing list
>>  > To unsubscribe or modify your subscription options:
>>  > https://mailman.videolan.org/listinfo/vlc-devel
>>  _______________________________________________
>>  vlc-devel mailing list
>>  To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> -- 
> Regards,


> Shaleen Jain


> _________________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180226/93e23fd1/attachment-0001.html>


More information about the vlc-devel mailing list