[vlc-devel] [PATCH 10/15] libvlc: add the API needed to set/get the viewpoint in 360° videos

Rémi Denis-Courmont remi at remlab.net
Sat Nov 5 09:48:44 CET 2016


Le perjantaina 4. marraskuuta 2016, 18.08.53 EET Steve Lhomme a écrit :
> --
> replaces https://patches.videolan.org/patch/14608/
> * only use vout 0 in libvlc_video_get_viewpoint()
> * libvlc_video_get_viewpoint() returns 0 on success
> ---
>  include/vlc/libvlc_media_player.h | 52 ++++++++++++++++++++++
>  lib/libvlc.sym                    |  3 ++
>  lib/media_player.c                | 10 +++++
>  lib/media_player_internal.h       |  2 +
>  lib/video.c                       | 49 ++++++++++++++++++++
>  test/Makefile.am                  |  2 +-
>  test/libvlc/media_player.c        | 94
> +++++++++++++++++++++++++++++++++++++++ 7 files changed, 211 insertions(+),
> 1 deletion(-)
> 
> diff --git a/include/vlc/libvlc_media_player.h
> b/include/vlc/libvlc_media_player.h index 9a73b4f..ebd83bd 100644
> --- a/include/vlc/libvlc_media_player.h
> +++ b/include/vlc/libvlc_media_player.h
> @@ -1167,6 +1167,58 @@ LIBVLC_API char *libvlc_video_get_aspect_ratio(
> libvlc_media_player_t *p_mi ); LIBVLC_API void
> libvlc_video_set_aspect_ratio( libvlc_media_player_t *p_mi, const char
> *psz_aspect );
> 
>  /**
> + * Viewpoint for video outputs
> + *
> + * \warning allocate using libvlc_video_new_viewpoint()
> + */
> +typedef struct libvlc_video_viewpoint_t
> +{
> +    float f_yaw;           /**< view point yaw in radians */
> +    float f_pitch;         /**< view point pitch in radians */
> +    float f_roll;          /**< view point roll in radians */
> +} libvlc_video_viewpoint_t;
> +
> +/**
> + * Create a video viewpoint structure.
> + *
> + * \version LibVLC 3.0.0 and later
> + *
> + * \return video viewpoint or NULL
> + *         (the result must be released with free() or libvlc_free()).
> + */
> +LIBVLC_API libvlc_video_viewpoint_t *libvlc_video_new_viewpoint(void);
> +
> +/**
> + * Get current video viewpoint.
> + *
> + * \version LibVLC 3.0.0 and later
> + *
> + * \param p_mi the media player
> + * \param p_viewpoint video viewpoint allocated via
> libvlc_video_new_viewpoint()
> + *                    that will be filled
> with the vout value if it is found
> + *                    or the default
> value for the media player
> + * \return -1 if an error was detected, 0 otherwise
> + * \warning the call is synchronous and may not return the value used by
> the vout yet.
> + */

You can use \retval here. Ditto below.

> +LIBVLC_API int libvlc_video_get_viewpoint( libvlc_media_player_t *p_mi,
> +                                           libvlc_video_viewpoint_t
> *p_viewpoint ); +
> +/**
> + * Set new video viewpoint information.
> + *
> + * \version LibVLC 3.0.0 and later
> + *
> + * \param p_mi the media player
> + * \param p_viewpoint new video viewpoint allocated via
> libvlc_video_new_viewpoint() + *                    or NULL to reset to
> default.
> + * \return -1 if an error was detected, 0 otherwise.
> + *
> + * \note the values are set asynchronously, it will be used by the next
> frame displayed. + */
> +LIBVLC_API int libvlc_video_set_viewpoint( libvlc_media_player_t *p_mi,
> +                                           const libvlc_video_viewpoint_t
> *p_viewpoint ); +
> +/**
>   * Get current video subtitle.
>   *
>   * \param p_mi the media player

-- 
Rémi Denis-Courmont
http://www.remlab.net/



More information about the vlc-devel mailing list