Commit 24dddc30 authored by Adrien Maglo's avatar Adrien Maglo Committed by Thomas Guillem

core: remove the 360 video viewpoint zoom

The functionality is provided by the fov parameter.
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent cd022d9c
......@@ -1177,7 +1177,6 @@ typedef struct libvlc_video_viewpoint_t
float f_pitch; /**< view point pitch in degrees */
float f_roll; /**< view point roll in degrees */
float f_field_of_view; /**< field of view in degrees (default 80.0f) */
float f_zoom; /**< zoom factor, [-1.f, 1.f] range, default to 0.f */
} libvlc_video_viewpoint_t;
/**
......
......@@ -230,8 +230,6 @@ typedef enum vlc_action {
/* Viewpoint */
ACTIONID_VIEWPOINT_FOV_IN,
ACTIONID_VIEWPOINT_FOV_OUT,
ACTIONID_VIEWPOINT_ZOOM_IN,
ACTIONID_VIEWPOINT_ZOOM_OUT,
ACTIONID_VIEWPOINT_ROLL_CLOCK,
ACTIONID_VIEWPOINT_ROLL_ANTICLOCK,
/* Combo Actions */
......
......@@ -90,12 +90,11 @@ struct vlc_viewpoint_t {
float pitch; /* pitch in degrees */
float roll; /* roll in degrees */
float fov; /* field of view in degrees */
float zoom; /* zoom factor, [-1.f, 1.f] range, default to 0.f */
};
static inline void vlc_viewpoint_init( vlc_viewpoint_t *p_vp )
{
p_vp->yaw = p_vp->pitch = p_vp->roll = p_vp->zoom = 0.0f;
p_vp->yaw = p_vp->pitch = p_vp->roll = 0.0f;
p_vp->fov = FIELD_OF_VIEW_DEGREES_DEFAULT;
}
......
......@@ -287,8 +287,7 @@ libvlc_video_viewpoint_t *libvlc_video_new_viewpoint(void)
libvlc_video_viewpoint_t *p_vp = malloc(sizeof *p_vp);
if (unlikely(p_vp == NULL))
return NULL;
p_vp->f_yaw = p_vp->f_pitch = p_vp->f_roll = p_vp->f_field_of_view =
p_vp->f_zoom = 0.0f;
p_vp->f_yaw = p_vp->f_pitch = p_vp->f_roll = p_vp->f_field_of_view = 0.0f;
return p_vp;
}
......@@ -301,7 +300,6 @@ int libvlc_video_update_viewpoint( libvlc_media_player_t *p_mi,
.pitch = p_viewpoint->f_pitch,
.roll = p_viewpoint->f_roll,
.fov = p_viewpoint->f_field_of_view,
.zoom = p_viewpoint->f_zoom,
};
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi );
......@@ -323,7 +321,6 @@ int libvlc_video_update_viewpoint( libvlc_media_player_t *p_mi,
p_mi->viewpoint.pitch += p_mi->viewpoint.pitch;
p_mi->viewpoint.roll += p_mi->viewpoint.roll;
p_mi->viewpoint.fov += p_mi->viewpoint.fov;
p_mi->viewpoint.zoom += p_mi->viewpoint.zoom;
}
else
p_mi->viewpoint = update;
......
......@@ -1115,19 +1115,6 @@ static int PutAction( intf_thread_t *p_intf, input_thread_t *p_input,
false );
break;
case ACTIONID_VIEWPOINT_ZOOM_IN:
if( p_vout )
input_UpdateViewpoint( p_input,
&(vlc_viewpoint_t) { .zoom = 0.01f },
false );
break;
case ACTIONID_VIEWPOINT_ZOOM_OUT:
if( p_vout )
input_UpdateViewpoint( p_input,
&(vlc_viewpoint_t) { .zoom = -0.01f },
false );
break;
case ACTIONID_VIEWPOINT_ROLL_CLOCK:
if( p_vout )
input_UpdateViewpoint( p_input,
......
......@@ -944,7 +944,7 @@ static void SetQuadVSProjection(vout_display_t *vd, d3d_quad_t *quad, const vlc_
getXRotMatrix(-RAD(p_vp->pitch), dst_data->RotX);
getYRotMatrix(-RAD(p_vp->yaw), dst_data->RotY);
getZRotMatrix(-RAD(p_vp->roll), dst_data->RotZ);
getZoomMatrix(SPHERE_RADIUS * p_vp->zoom, dst_data->View);
getZoomMatrix(SPHERE_RADIUS, dst_data->View); /* FIXME */
float sar = (float) vd->cfg->display.width / vd->cfg->display.height;
getProjectionMatrix(sar, RAD(p_vp->fov), dst_data->Projection);
#undef RAD
......
......@@ -372,8 +372,6 @@ static const struct action actions[] =
{ "viewpoint-fov-out", ACTIONID_VIEWPOINT_FOV_OUT, },
{ "viewpoint-roll-anticlock", ACTIONID_VIEWPOINT_ROLL_ANTICLOCK, },
{ "viewpoint-roll-clock", ACTIONID_VIEWPOINT_ROLL_CLOCK, },
{ "viewpoint-zoom-in", ACTIONID_VIEWPOINT_ZOOM_IN, },
{ "viewpoint-zoom-out", ACTIONID_VIEWPOINT_ZOOM_OUT, },
{ "vol-down", ACTIONID_VOL_DOWN, },
{ "vol-mute", ACTIONID_VOL_MUTE, },
{ "vol-up", ACTIONID_VOL_UP, },
......
......@@ -1942,7 +1942,6 @@ static bool Control( input_thread_t *p_input,
priv->viewpoint.pitch += p_vp->pitch;
priv->viewpoint.roll += p_vp->roll;
priv->viewpoint.fov += p_vp->fov;
priv->viewpoint.zoom += p_vp->zoom;
}
priv->viewpoint.yaw = fmodf( priv->viewpoint.yaw, 360.f );
......@@ -1951,7 +1950,6 @@ static bool Control( input_thread_t *p_input,
priv->viewpoint.fov = VLC_CLIP( priv->viewpoint.fov,
FIELD_OF_VIEW_DEGREES_MIN,
FIELD_OF_VIEW_DEGREES_MAX );
priv->viewpoint.zoom = VLC_CLIP( priv->viewpoint.zoom, -1.f, 1.f );
vout_thread_t **pp_vout;
size_t i_vout;
......
......@@ -1425,8 +1425,6 @@ static const char *const mouse_wheel_texts[] = {
/* 360° Viewpoint */
#define VIEWPOINT_FOV_IN_KEY_TEXT N_("Shrink the viewpoint field of view (360°)")
#define VIEWPOINT_FOV_OUT_KEY_TEXT N_("Expand the viewpoint field of view (360°)")
#define VIEWPOINT_ZOOM_IN_KEY_TEXT N_("Increase the viewpoint zoom (360°)")
#define VIEWPOINT_ZOOM_OUT_KEY_TEXT N_("Decrease the viewpoint zoom (360°)")
#define VIEWPOINT_ROLL_CLOCK_KEY_TEXT N_("Roll the viewpoint clockwise (360°)")
#define VIEWPOINT_ROLL_ANTICLOCK_KEY_TEXT N_("Roll the viewpoint anti-clockwise (360°)")
......@@ -2582,10 +2580,6 @@ vlc_module_begin ()
VIEWPOINT_FOV_IN_KEY_TEXT, VIEWPOINT_FOV_IN_KEY_TEXT, true )
add_key( "key-viewpoint-fov-out", KEY_VIEWPOINT_FOV_OUT,
VIEWPOINT_FOV_OUT_KEY_TEXT, VIEWPOINT_FOV_OUT_KEY_TEXT, true )
add_key( "key-viewpoint-zoom-in", KEY_VIEWPOINT_ZOOM_IN,
VIEWPOINT_ZOOM_IN_KEY_TEXT, VIEWPOINT_ZOOM_IN_KEY_TEXT, true )
add_key( "key-viewpoint-zoom-out", KEY_VIEWPOINT_ZOOM_OUT,
VIEWPOINT_ZOOM_OUT_KEY_TEXT, VIEWPOINT_ZOOM_OUT_KEY_TEXT, true )
add_key( "key-viewpoint-roll-clock", NULL,
VIEWPOINT_ROLL_CLOCK_KEY_TEXT, VIEWPOINT_ROLL_CLOCK_KEY_TEXT, true )
add_key( "key-viewpoint-roll-anticlock", NULL,
......
......@@ -1224,7 +1224,6 @@ void vout_SetDisplayViewpoint(vout_display_t *vd,
if (osys->viewpoint.yaw != p_viewpoint->yaw ||
osys->viewpoint.pitch != p_viewpoint->pitch ||
osys->viewpoint.roll != p_viewpoint->roll ||
osys->viewpoint.zoom != p_viewpoint->zoom ||
osys->viewpoint.fov != p_viewpoint->fov) {
osys->viewpoint = *p_viewpoint;
......
......@@ -564,7 +564,6 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, cons
cfg->viewpoint.pitch = vout->p->original.pose.f_pitch_degrees;
cfg->viewpoint.roll = vout->p->original.pose.f_roll_degrees;
cfg->viewpoint.fov = vout->p->original.pose.f_fov_degrees;
cfg->viewpoint.zoom = 0.f;
}
cfg->display.title = title;
const int display_width = var_CreateGetInteger(vout, "width");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment