Browse Source

libvlc: media_player: add projection-mode API

pull/176/head
Alexandre Janniaux 2 years ago
committed by Steve Lhomme
parent
commit
9e5e5ca612
  1. 24
      include/vlc/libvlc_media_player.h
  2. 2
      lib/libvlc.sym
  3. 1
      lib/media_player.c
  4. 32
      lib/video.c

24
include/vlc/libvlc_media_player.h

@ -7,6 +7,7 @@
* Jean-Paul Saman <jpsaman@videolan.org>
* Pierre d'Herbemont <pdherbemont@videolan.org>
* Maxime Chapelet <umxprime at videolabs dot io>
* Alexandre Janniaux <ajanni@videolabs.io>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
@ -2432,6 +2433,29 @@ LIBVLC_API float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
*/
LIBVLC_API void libvlc_video_set_adjust_float( libvlc_media_player_t *p_mi,
unsigned option, float value );
/**
* Change the projection mode used for rendering the source.
*
* This changes how the source is mapped to the output w.r.t. 360 playback.
*
* \param p_mi libvlc media player instance
* \param projection_mode the considered projection mode for the source
* \version LibVLC 4.0.0 and later.
*/
LIBVLC_API void
libvlc_video_set_projection_mode(libvlc_media_player_t *player,
libvlc_video_projection_t projection_mode);
/**
* Remove previously set projection mode.
*
* Remove the effects from previous call to libvlc_video_set_projection_mode.
*
* \param p_mi libvlc media player instance
* \version LibVLC 4.0.0 and later.
*/
LIBVLC_API void
libvlc_video_unset_projection_mode(libvlc_media_player_t *player);
/** @} video */

2
lib/libvlc.sym

@ -267,6 +267,8 @@ libvlc_video_set_logo_string
libvlc_video_set_marquee_int
libvlc_video_set_marquee_string
libvlc_video_set_mouse_input
libvlc_video_set_projection_mode
libvlc_video_unset_projection_mode
libvlc_video_set_scale
libvlc_video_set_spu_delay
libvlc_video_set_spu_text_scale

1
lib/media_player.c

@ -695,6 +695,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, "projection-mode", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT);
var_Create (mp, "vbi-page", VLC_VAR_INTEGER);
var_SetInteger (mp, "vbi-page", 100);

32
lib/video.c

@ -8,6 +8,7 @@
* Filippo Carone <littlejohn@videolan.org>
* Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
* Damien Fouilleul <damienf a_t videolan dot org>
* Alexandre Janniaux <ajanni@videolabs.io>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
@ -863,3 +864,34 @@ float libvlc_video_get_adjust_float( libvlc_media_player_t *p_mi,
{
return get_float( p_mi, "adjust", adjust_option_bynumber(option) );
}
void libvlc_video_unset_projection_mode(libvlc_media_player_t *player)
{
var_SetInteger(player, "projection-mode", -1);
/* Apply to current video outputs (if any) */
size_t n;
vout_thread_t **pp_vouts = GetVouts(player, &n);
for (size_t i = 0; i < n; i++)
{
var_SetInteger(pp_vouts[i], "projection-mode", -1);
vout_Release(pp_vouts[i]);
}
free (pp_vouts);
}
void libvlc_video_set_projection_mode(libvlc_media_player_t *player,
libvlc_video_projection_t projection_mode)
{
var_SetInteger(player, "projection-mode", projection_mode);
/* Apply to current video outputs (if any) */
size_t n;
vout_thread_t **pp_vouts = GetVouts(player, &n);
for (size_t i = 0; i < n; i++)
{
var_SetInteger(pp_vouts[i], "projection-mode", projection_mode);
vout_Release(pp_vouts[i]);
}
free (pp_vouts);
}

Loading…
Cancel
Save