Commit fb9ba9cb authored by Steve Lhomme's avatar Steve Lhomme Committed by Rémi Denis-Courmont

core: merge the video format pose fields in a struct

Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 3bf60326
......@@ -321,10 +321,12 @@ struct video_format_t
video_multiview_mode_t multiview_mode; /** Multiview mode, 2D, 3D */
video_projection_mode_t projection_mode; /**< projection mode */
float f_pose_yaw_degrees; /**< view point yaw in degrees ]-180;180] */
float f_pose_pitch_degrees; /**< view point pitch in degrees ]-90;90] */
float f_pose_roll_degrees; /**< view point roll in degrees ]-180;180] */
float f_pose_fov_degrees; /**< view point fov in degrees ]0;180[ */
struct {
float f_yaw_degrees; /**< view point yaw in degrees ]-180;180] */
float f_pitch_degrees; /**< view point pitch in degrees ]-90;90] */
float f_roll_degrees; /**< view point roll in degrees ]-180;180] */
float f_fov_degrees; /**< view point fov in degrees ]0;180[ */
} pose;
uint32_t i_cubemap_padding; /**< padding in pixels of the cube map faces */
};
......@@ -338,7 +340,7 @@ static inline void video_format_Init( video_format_t *p_src, vlc_fourcc_t i_chro
memset( p_src, 0, sizeof( video_format_t ) );
p_src->i_chroma = i_chroma;
p_src->i_sar_num = p_src->i_sar_den = 1;
p_src->f_pose_fov_degrees = DEFAULT_FIELD_OF_VIEW_DEGREES;
p_src->pose.f_fov_degrees = DEFAULT_FIELD_OF_VIEW_DEGREES;
}
/**
......
......@@ -302,26 +302,26 @@ static void jpeg_GetProjection(j_decompress_ptr cinfo, video_format_t *fmt)
/* pose handling */
float value;
if (getRDFFloat(psz_rdf, &value, "PoseHeadingDegrees=\""))
fmt->f_pose_yaw_degrees = value;
fmt->pose.f_yaw_degrees = value;
if (getRDFFloat(psz_rdf, &value, "PosePitchDegrees=\""))
fmt->f_pose_pitch_degrees = value;
fmt->pose.f_pitch_degrees = value;
if (getRDFFloat(psz_rdf, &value, "PoseRollDegrees=\""))
fmt->f_pose_roll_degrees = value;
fmt->pose.f_roll_degrees = value;
/* initial view */
if (getRDFFloat(psz_rdf, &value, "InitialViewHeadingDegrees=\""))
fmt->f_pose_yaw_degrees = value;
fmt->pose.f_yaw_degrees = value;
if (getRDFFloat(psz_rdf, &value, "InitialViewPitchDegrees=\""))
fmt->f_pose_pitch_degrees = value;
fmt->pose.f_pitch_degrees = value;
if (getRDFFloat(psz_rdf, &value, "InitialViewRollDegrees=\""))
fmt->f_pose_roll_degrees = value;
fmt->pose.f_roll_degrees = value;
if (getRDFFloat(psz_rdf, &value, "InitialHorizontalFOVDegrees=\""))
fmt->f_pose_fov_degrees = value;
fmt->pose.f_fov_degrees = value;
free(psz_rdf);
}
......
......@@ -379,11 +379,11 @@ int SetupVideoES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
const MP4_Box_t *p_prhd = MP4_BoxGet( p_sample, "sv3d/proj/prhd" );
if (p_prhd && BOXDATA(p_prhd))
{
p_track->fmt.video.f_pose_yaw_degrees
p_track->fmt.video.pose.f_yaw_degrees
= BOXDATA(p_prhd)->f_pose_yaw_degrees;
p_track->fmt.video.f_pose_pitch_degrees
p_track->fmt.video.pose.f_pitch_degrees
= BOXDATA(p_prhd)->f_pose_pitch_degrees;
p_track->fmt.video.f_pose_roll_degrees
p_track->fmt.video.pose.f_roll_degrees
= BOXDATA(p_prhd)->f_pose_roll_degrees;
}
......
......@@ -3070,13 +3070,13 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
_(c_loc_names[fmt->video.projection_mode]) );
info_category_AddInfo( p_cat, _("Yaw"), "%.2f",
fmt->video.f_pose_yaw_degrees );
fmt->video.pose.f_yaw_degrees );
info_category_AddInfo( p_cat, _("Pitch"), "%.2f",
fmt->video.f_pose_pitch_degrees );
fmt->video.pose.f_pitch_degrees );
info_category_AddInfo( p_cat, _("Roll"), "%.2f",
fmt->video.f_pose_roll_degrees );
fmt->video.pose.f_roll_degrees );
info_category_AddInfo( p_cat, _("Field of view"), "%.2f",
fmt->video.f_pose_fov_degrees );
fmt->video.pose.f_fov_degrees );
}
break;
......
......@@ -560,10 +560,10 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, cons
cfg->viewpoint = *p_viewpoint;
else
{
cfg->viewpoint.yaw = vout->p->original.f_pose_yaw_degrees;
cfg->viewpoint.pitch = vout->p->original.f_pose_pitch_degrees;
cfg->viewpoint.roll = vout->p->original.f_pose_roll_degrees;
cfg->viewpoint.fov = vout->p->original.f_pose_fov_degrees;
cfg->viewpoint.yaw = vout->p->original.pose.f_yaw_degrees;
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;
......
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