[vlc-devel] [PATCH 06/17] vout: the filed of view cannot be 0
Steve Lhomme
robux4 at videolabs.io
Mon Nov 14 15:16:15 CET 2016
add some macros to translate millidegrees
---
include/vlc_vout.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index baf9b15..88f401e 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -82,6 +82,10 @@ struct vout_thread_t {
#define VOUT_ALIGN_BOTTOM 0x0008
#define VOUT_ALIGN_VMASK 0x000C
+#define VLC_VIEWPOINT_DEGREES_UNIT 1000.f
+#define TO_MILLI_INT(d) ((int32_t) (d * VLC_VIEWPOINT_DEGREES_UNIT))
+#define FROM_MILLI_INT(d) ((float) d / VLC_VIEWPOINT_DEGREES_UNIT)
+
struct vlc_viewpoint_t {
int32_t yaw; /* yaw in 0.001 degrees */
int32_t pitch; /* pitch in 0.001 degrees */
@@ -93,6 +97,7 @@ struct vlc_viewpoint_t {
static inline void vlc_viewpoint_init( vlc_viewpoint_t *p_vp )
{
memset( p_vp, 0, sizeof(*p_vp) );
+ p_vp->fov = TO_MILLI_INT( DEFAULT_FIELD_OF_VIEW_DEGREES );
}
/*****************************************************************************
--
2.10.1
More information about the vlc-devel
mailing list