Commit ff8c3a93 authored by Thomas Guillem's avatar Thomas Guillem

es: merge vlc_viewpoint_t and video_format_t.pose

parent 26f09915
......@@ -352,12 +352,7 @@ struct video_format_t
video_multiview_mode_t multiview_mode; /** Multiview mode, 2D, 3D */
video_projection_mode_t projection_mode; /**< projection mode */
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;
vlc_viewpoint_t pose;
struct {
/* similar to SMPTE ST 2086 mastering display color volume */
uint16_t primaries[3*2]; /* G,B,R / x,y */
......@@ -382,7 +377,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->pose.f_fov_degrees = FIELD_OF_VIEW_DEGREES_DEFAULT;
vlc_viewpoint_init( &p_src->pose );
}
/**
......
......@@ -1025,10 +1025,10 @@ libvlc_media_tracks_get( libvlc_media_t *p_md, libvlc_media_track_t *** pp_es )
( p_es->video.projection_mode == PROJECTION_MODE_CUBEMAP_LAYOUT_STANDARD ) );
p_mes->video->i_projection = (int) p_es->video.projection_mode;
p_mes->video->pose.f_yaw_degrees = p_es->video.pose.f_yaw_degrees;
p_mes->video->pose.f_pitch_degrees = p_es->video.pose.f_pitch_degrees;
p_mes->video->pose.f_roll_degrees = p_es->video.pose.f_roll_degrees;
p_mes->video->pose.f_fov_degrees = p_es->video.pose.f_fov_degrees;
p_mes->video->pose.f_yaw_degrees = p_es->video.pose.yaw;
p_mes->video->pose.f_pitch_degrees = p_es->video.pose.pitch;
p_mes->video->pose.f_roll_degrees = p_es->video.pose.roll;
p_mes->video->pose.f_fov_degrees = p_es->video.pose.fov;
break;
case AUDIO_ES:
p_mes->i_type = libvlc_track_audio;
......
......@@ -316,26 +316,26 @@ static void jpeg_GetProjection(j_decompress_ptr cinfo, video_format_t *fmt)
/* pose handling */
float value;
if (getRDFFloat(psz_rdf, &value, "PoseHeadingDegrees"))
fmt->pose.f_yaw_degrees = value;
fmt->pose.yaw = value;
if (getRDFFloat(psz_rdf, &value, "PosePitchDegrees"))
fmt->pose.f_pitch_degrees = value;
fmt->pose.pitch = value;
if (getRDFFloat(psz_rdf, &value, "PoseRollDegrees"))
fmt->pose.f_roll_degrees = value;
fmt->pose.roll = value;
/* initial view */
if (getRDFFloat(psz_rdf, &value, "InitialViewHeadingDegrees"))
fmt->pose.f_yaw_degrees = value;
fmt->pose.yaw = value;
if (getRDFFloat(psz_rdf, &value, "InitialViewPitchDegrees"))
fmt->pose.f_pitch_degrees = value;
fmt->pose.pitch = value;
if (getRDFFloat(psz_rdf, &value, "InitialViewRollDegrees"))
fmt->pose.f_roll_degrees = value;
fmt->pose.roll = value;
if (getRDFFloat(psz_rdf, &value, "InitialHorizontalFOVDegrees"))
fmt->pose.f_fov_degrees = value;
fmt->pose.fov = value;
free(psz_rdf);
}
......
......@@ -543,15 +543,15 @@ void matroska_segment_c::ParseTrackEntry( const KaxTrackEntry *m )
}
E_CASE( KaxVideoProjectionPoseYaw, pose )
{
vars.tk->fmt.video.pose.f_yaw_degrees = static_cast<float>( pose );
vars.tk->fmt.video.pose.yaw = static_cast<float>( pose );
}
E_CASE( KaxVideoProjectionPosePitch, pose )
{
vars.tk->fmt.video.pose.f_pitch_degrees = static_cast<float>( pose );
vars.tk->fmt.video.pose.pitch = static_cast<float>( pose );
}
E_CASE( KaxVideoProjectionPoseRoll, pose )
{
vars.tk->fmt.video.pose.f_roll_degrees = static_cast<float>( pose );
vars.tk->fmt.video.pose.roll = static_cast<float>( pose );
}
#endif
E_CASE( KaxVideoFlagInterlaced, fint ) // UNUSED
......
......@@ -382,12 +382,9 @@ 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.pose.f_yaw_degrees
= BOXDATA(p_prhd)->f_pose_yaw_degrees;
p_track->fmt.video.pose.f_pitch_degrees
= BOXDATA(p_prhd)->f_pose_pitch_degrees;
p_track->fmt.video.pose.f_roll_degrees
= BOXDATA(p_prhd)->f_pose_roll_degrees;
p_track->fmt.video.pose.yaw = BOXDATA(p_prhd)->f_pose_yaw_degrees;
p_track->fmt.video.pose.pitch = BOXDATA(p_prhd)->f_pose_pitch_degrees;
p_track->fmt.video.pose.roll = BOXDATA(p_prhd)->f_pose_roll_degrees;
}
const MP4_Box_t *p_equi = MP4_BoxGet( p_sample, "sv3d/proj/equi" );
......
......@@ -3217,13 +3217,13 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
info_category_AddInfo( p_cat, _("Projection"), "%s", _(psz_loc_name) );
info_category_AddInfo( p_cat, _("Yaw"), "%.2f",
fmt->video.pose.f_yaw_degrees );
fmt->video.pose.yaw );
info_category_AddInfo( p_cat, _("Pitch"), "%.2f",
fmt->video.pose.f_pitch_degrees );
fmt->video.pose.pitch );
info_category_AddInfo( p_cat, _("Roll"), "%.2f",
fmt->video.pose.f_roll_degrees );
fmt->video.pose.roll );
info_category_AddInfo( p_cat, _("Field of view"), "%.2f",
fmt->video.pose.f_fov_degrees );
fmt->video.pose.fov );
}
if ( fmt->video.mastering.max_luminance )
{
......
......@@ -566,12 +566,7 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, cons
if (p_viewpoint != NULL)
cfg->viewpoint = *p_viewpoint;
else
{
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 = vout->p->original.pose;
cfg->display.title = title;
const int display_width = var_GetInteger(vout, "width");
const int display_height = var_GetInteger(vout, "height");
......
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