[vlc-devel] [PATCH 5/9] libvlc: add get/set functions for libVLC stereo mode

Steve Lhomme robux4 at ycbcr.xyz
Sat Oct 27 10:26:43 CEST 2018


On Sat, Oct 27, 2018, at 08:46, Steve Lhomme wrote:
> From: "Mohammed (Shaan) Huzaifa Danish" <shaan3 at gmail.com>
> 
> Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> ---
> include/vlc/libvlc_media_player.h | 28 ++++++++++++++++++++++++++++
> lib/libvlc.sym                    |  2 ++
> lib/media_player.c                |  1 +
> lib/video.c                       | 27 +++++++++++++++++++++++++++
> 4 files changed, 58 insertions(+)
> 
> diff --git a/include/vlc/libvlc_media_player.h
> b/include/vlc/libvlc_media_player.h> index 73dadda3ba..ae308df4fa 100644
> --- a/include/vlc/libvlc_media_player.h
> +++ b/include/vlc/libvlc_media_player.h
> @@ -1296,6 +1296,34 @@ LIBVLC_API int libvlc_video_update_viewpoint(
> libvlc_media_player_t *p_mi,>                                               const libvlc_video_view-
>                                               point_t *p_viewpoint,>                                               bool b_absolute);
>  
> +/**
> + * Video stereo modes
> + */
> +typedef enum libvlc_video_stereo_mode_t {
> +    libvlc_VideoStereoAuto = 0,
> +    libvlc_VideoStereoOriginal,
> +    libvlc_VideoStereoLeftEye,
> +    libvlc_VideoStereoRightEye,
> +} libvlc_video_stereo_mode_t;
> +
> +/**
> + * Get current video stereo mode.
> + *
> + * \param p_mi the media player
> + * \return the video stereo mode.
> + */
> +LIBVLC_API libvlc_video_stereo_mode_t
> libvlc_video_get_video_stereo_mode(> +                                              libvlc_media_player_t
>                                                *p_mi );
too many video in the name.

> +
> +/**
> + * Set new video stereo mode.
> + *
> + * \param p_mi the media player
> + * \param i_mode new video stereo mode
> + */
> +LIBVLC_API void libvlc_video_set_video_stereo_mode(
> libvlc_media_player_t *p_mi,> +                                      const
>                                        libvlc_video_stereo_mode_t
>                                        i_mode );> +
> /**
>   * Get current video subtitle.
>   *
> diff --git a/lib/libvlc.sym b/lib/libvlc.sym
> index 9a896ce7b2..1d34bd6b2d 100644
> --- a/lib/libvlc.sym
> +++ b/lib/libvlc.sym
> @@ -235,6 +235,7 @@ libvlc_video_get_teletext
> libvlc_video_get_track
> libvlc_video_get_track_count
> libvlc_video_get_track_description
> +libvlc_video_get_video_stereo_mode
> libvlc_video_set_adjust_float
> libvlc_video_set_adjust_int
> libvlc_video_set_aspect_ratio
> @@ -255,6 +256,7 @@ libvlc_video_set_spu
> libvlc_video_set_spu_delay
> libvlc_video_set_teletext
> libvlc_video_set_track
> +libvlc_video_set_video_stereo_mode
> libvlc_video_take_snapshot
> libvlc_video_new_viewpoint
> libvlc_video_update_viewpoint
> diff --git a/lib/media_player.c b/lib/media_player.c
> index 4f4cb70291..5d277396de 100644
> --- a/lib/media_player.c
> +++ b/lib/media_player.c
> @@ -670,6 +670,7 @@ libvlc_media_player_new( libvlc_instance_t
> *instance )>     var_Create (mp, "crop", VLC_VAR_STRING);
>     var_Create (mp, "deinterlace", VLC_VAR_INTEGER |
>     VLC_VAR_DOINHERIT);>     var_Create (mp, "deinterlace-mode", VLC_VAR_STRING |
>     VLC_VAR_DOINHERIT);> +    var_Create (mp, "video-stereo-mode", VLC_VAR_INTEGER);
>  
>     var_Create (mp, "vbi-page", VLC_VAR_INTEGER);
>     var_SetInteger (mp, "vbi-page", 100);
> diff --git a/lib/video.c b/lib/video.c
> index e5796ec2c8..bb8af0328f 100644
> --- a/lib/video.c
> +++ b/lib/video.c
> @@ -315,6 +315,33 @@ int libvlc_video_update_viewpoint(
> libvlc_media_player_t *p_mi,>     return 0;
> }
>  
> +libvlc_video_stereo_mode_t
> libvlc_video_get_video_stereo_mode(libvlc_media_player_t *p_mi)> +{
> +    static_assert( libvlc_VideoStereoAuto       ==
>      VIDEO_STEREO_OUTPUT_AUTO &&> +                   libvlc_VideoStereoOriginal   ==
>                     VIDEO_STEREO_OUTPUT_ORIGINAL &&> +                   libvlc_VideoStereoLeftEye    ==
>                     VIDEO_STEREO_OUTPUT_LEFT_ONLY &&> +                   libvlc_VideoStereoRightEye   ==
>                     VIDEO_STEREO_OUTPUT_RIGHT_ONLY,> +                   "stereo mode mismatch" );
> +
> +    return var_GetInteger(p_mi, "video-stereo-mode");
> +}
> +
> +void libvlc_video_set_video_stereo_mode(libvlc_media_player_t *p_mi,> +                                       const
>                                         libvlc_video_stereo_mode_t
>                                         i_mode)> +{
> +    input_thread_t *p_input_thread = libvlc_get_input_thread(p_mi);
> +
> +    if (p_input_thread)
> +    {
> +        var_SetInteger(p_input_thread, "video-stereo-mode", i_mode);> +        vlc_object_release(p_input_thread);
> +    }
> +    else
> +    {
> +        libvlc_printerr("No active input");
> +    }
> +}
> +
> int libvlc_video_get_spu( libvlc_media_player_t *p_mi )
> {
>     input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi );> --
> 2.17.0
> 
> _________________________________________________
> 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/20181027/5d9d6a18/attachment.html>


More information about the vlc-devel mailing list