[vlc-devel] [PATCH 2/4] core: add a field of view field to video_format_t

Steve Lhomme robux4 at videolabs.io
Thu Nov 10 17:59:58 CET 2016


default to 80°

--
replaces https://patches.videolan.org/patch/14995/
- share the default value with the rest of the code
---
 include/vlc_es.h     | 3 +++
 src/input/es_out.c   | 2 ++
 src/misc/es_format.c | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index bb86b40..11d3795 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -282,6 +282,8 @@ typedef enum video_chroma_location_t
     CHROMA_LOCATION_BOTTOM_CENTER,
 } video_chroma_location_t;
 
+#define DEFAULT_FIELD_OF_VIEW_DEGREES  80.f
+
 /**
  * video format description
  */
@@ -322,6 +324,7 @@ struct video_format_t
     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[ */
     uint32_t i_cubemap_padding; /**< padding in pixels of the cube map faces */
 };
 
diff --git a/src/input/es_out.c b/src/input/es_out.c
index b049be4..9ba50b4 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -3096,6 +3096,8 @@ static void EsOutUpdateInfo( es_out_t *out, es_out_id_t *es, const es_format_t *
                                   fmt->video.f_pose_pitch_degrees );
            info_category_AddInfo( p_cat, _("Roll"), "%.2f",
                                   fmt->video.f_pose_roll_degrees );
+           info_category_AddInfo( p_cat, _("Field of view"), "%.2f",
+                                  fmt->video.f_pose_fov_degrees );
        }
        break;
 
diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index d646e78..ded0646 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -454,6 +454,8 @@ void es_format_Init( es_format_t *fmt,
     memset( &fmt->video, 0, sizeof(video_format_t) );
     memset( &fmt->subs, 0, sizeof(subs_format_t) );
 
+    fmt->video.f_pose_fov_degrees = DEFAULT_FIELD_OF_VIEW_DEGREES;
+
     fmt->b_packetized           = true;
     fmt->i_bitrate              = 0;
     fmt->i_extra                = 0;
-- 
2.10.1



More information about the vlc-devel mailing list