[vlc-devel] [PATCH] lib: add libvlc_video_set_spu_text_scale API

Alexandre Janniaux ajanni at videolabs.io
Mon Apr 20 12:22:41 CEST 2020


Hi,

LGTM, thank you for adding example for the user!

Regards,
--
Alexandre Janniaux
Videolabs

On Mon, Apr 20, 2020 at 10:40:53AM +0100, Mark Lee wrote:
> ---
>  include/vlc/libvlc_media_player.h | 14 ++++++++++++++
>  lib/libvlc.sym                    |  1 +
>  lib/video.c                       | 11 +++++++++++
>  3 files changed, 26 insertions(+)
>
> diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
> index 5e0255a10a..e6fa389781 100644
> --- a/include/vlc/libvlc_media_player.h
> +++ b/include/vlc/libvlc_media_player.h
> @@ -1544,6 +1544,20 @@ LIBVLC_API int libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu );
>   */
>  LIBVLC_API int64_t libvlc_video_get_spu_delay( libvlc_media_player_t *p_mi );
>
> +/**
> + * Set the subtitle text scale.
> + *
> + * The scale factor is a value relative to the default value of 100.
> + *
> + * A factor of 50 would result in text half the normal size, a factor of 200
> + * would result in text twice the normal size.
> + *
> + * \param p_mi media player
> + * \param scale scale factor in the range [10;500] (default: 100)
> + * \version LibVLC 4.0.0 or later
> + */
> +LIBVLC_API void libvlc_video_set_spu_text_scale( libvlc_media_player_t *p_mi, unsigned scale );
> +
>  /**
>   * Set the subtitle delay. This affects the timing of when the subtitle will
>   * be displayed. Positive values result in subtitles being displayed later,
> diff --git a/lib/libvlc.sym b/lib/libvlc.sym
> index 67e4dcf748..5623ec87d5 100644
> --- a/lib/libvlc.sym
> +++ b/lib/libvlc.sym
> @@ -248,6 +248,7 @@ libvlc_video_set_mouse_input
>  libvlc_video_set_scale
>  libvlc_video_set_spu
>  libvlc_video_set_spu_delay
> +libvlc_video_set_spu_text_scale
>  libvlc_video_set_teletext
>  libvlc_video_set_track
>  libvlc_video_take_snapshot
> diff --git a/lib/video.c b/lib/video.c
> index 6f8e6d7f59..8a020c3dd7 100644
> --- a/lib/video.c
> +++ b/lib/video.c
> @@ -362,6 +362,17 @@ int libvlc_video_set_spu_delay( libvlc_media_player_t *p_mi,
>      return 0;
>  }
>
> +void libvlc_video_set_spu_text_scale( libvlc_media_player_t *p_mi,
> +                                      unsigned scale)
> +{
> +    vlc_player_t *player = p_mi->player;
> +    vlc_player_Lock(player);
> +
> +    vlc_player_SetSubtitleTextScale(player, scale);
> +
> +    vlc_player_Unlock(player);
> +}
> +
>  static void libvlc_video_set_crop(libvlc_media_player_t *mp,
>                                    const char *geometry)
>  {
> --
> 2.17.1
>
> _______________________________________________
> 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