[vlc-devel] [PATCH] lib: add libvlc_video_get_spu_text_scale API
Alexandre Janniaux
ajanni at videolabs.io
Mon Jan 25 08:53:24 UTC 2021
Hi,
I have a few question relative to how the scaling value will
change the behaviour:
- Is the scaling continue or should it cap the scaling to
avoid aliasing of the text on multiple pixels?
- Would the scaling work on text rendered with a column/row
settings, like CEA-6/708 captions iirc?
- Should the scaling work on some bitmaps format too?
Regards,
--
Alexandre Janniaux
Videolabs
On Tue, Oct 27, 2020 at 12:08:10PM +0100, Felix Paul Kühne wrote:
> From: Felix Paul Kühne <felix at feepk.net>
>
> This complements 67c4ffd5.
> ---
> include/vlc/libvlc_media_player.h | 11 +++++++++++
> lib/libvlc.sym | 1 +
> lib/video.c | 12 ++++++++++++
> 3 files changed, 24 insertions(+)
>
> diff --git a/include/vlc/libvlc_media_player.h b/include/vlc/libvlc_media_player.h
> index fea7034644..a017d6c1cf 100644
> --- a/include/vlc/libvlc_media_player.h
> +++ b/include/vlc/libvlc_media_player.h
> @@ -1648,6 +1648,17 @@ LIBVLC_API int libvlc_video_update_viewpoint( libvlc_media_player_t *p_mi,
> */
> LIBVLC_API int64_t libvlc_video_get_spu_delay( libvlc_media_player_t *p_mi );
>
> +/**
> + * Get the current subtitle text scale
> + *
> + * The scale factor is expressed as a percentage of the default size, where
> + * 1.0 represents 100 percent.
> + *
> + * \param p_mi media player
> + * \version LibVLC 4.0.0 or later
> + */
> +LIBVLC_API float libvlc_video_get_spu_text_scale( libvlc_media_player_t *p_mi );
> +
> /**
> * Set the subtitle text scale.
> *
> diff --git a/lib/libvlc.sym b/lib/libvlc.sym
> index 2bb67eccf8..5d9713cdb3 100644
> --- a/lib/libvlc.sym
> +++ b/lib/libvlc.sym
> @@ -239,6 +239,7 @@ libvlc_video_get_spu
> libvlc_video_get_spu_count
> libvlc_video_get_spu_delay
> libvlc_video_get_spu_description
> +libvlc_video_get_spu_text_scale
> libvlc_video_get_teletext
> libvlc_video_get_track
> libvlc_video_get_track_count
> diff --git a/lib/video.c b/lib/video.c
> index e06adf143b..d3cba035d8 100644
> --- a/lib/video.c
> +++ b/lib/video.c
> @@ -368,6 +368,18 @@ int libvlc_video_set_spu_delay( libvlc_media_player_t *p_mi,
> return 0;
> }
>
> +float libvlc_video_get_spu_text_scale( libvlc_media_player_t *p_mi )
> +{
> + vlc_player_t *player = p_mi->player;
> + vlc_player_Lock(player);
> +
> + unsigned scale = vlc_player_GetSubtitleTextScale(player);
> +
> + vlc_player_Unlock(player);
> +
> + return scale / 100.f;
> +}
> +
> void libvlc_video_set_spu_text_scale( libvlc_media_player_t *p_mi,
> float f_scale )
> {
> --
> 2.24.3 (Apple Git-128)
>
> _______________________________________________
> 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