[vlc-commits] es: merge vlc_viewpoint_t and video_format_t.pose
Thomas Guillem
git at videolan.org
Tue Jul 25 16:42:25 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 25 09:02:28 2017 +0200| [ff8c3a932ace95bb06953f3ed7436120226aa6cd] | committer: Thomas Guillem
es: merge vlc_viewpoint_t and video_format_t.pose
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ff8c3a932ace95bb06953f3ed7436120226aa6cd
---
include/vlc_es.h | 9 ++-------
lib/media.c | 8 ++++----
modules/codec/jpeg.c | 14 +++++++-------
modules/demux/mkv/matroska_segment_parse.cpp | 6 +++---
modules/demux/mp4/essetup.c | 9 +++------
src/input/es_out.c | 8 ++++----
src/video_output/video_output.c | 7 +------
7 files changed, 24 insertions(+), 37 deletions(-)
diff --git a/include/vlc_es.h b/include/vlc_es.h
index 0d1088fb5c..d7d5a7ea2b 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -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 );
}
/**
diff --git a/lib/media.c b/lib/media.c
index 0ca4627da7..419e48389a 100644
--- a/lib/media.c
+++ b/lib/media.c
@@ -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;
diff --git a/modules/codec/jpeg.c b/modules/codec/jpeg.c
index b7e38fbc75..d517ba839a 100644
--- a/modules/codec/jpeg.c
+++ b/modules/codec/jpeg.c
@@ -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);
}
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index f00dfef3e3..77ffe4e5b1 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -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
diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index f94cb1f88a..6f995568a7 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -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" );
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 16e966b91c..6a2e1cd83e 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -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 )
{
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index fc294f231a..9c2653d19c 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -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");
More information about the vlc-commits
mailing list