[vlc-commits] core: move viewpoint to vlc_viewpoint.h

Thomas Guillem git at videolan.org
Tue Jul 25 16:42:17 CEST 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jul 24 15:10:49 2017 +0200| [e61dee00915ab387a4778b3102ad53c6f6ff747b] | committer: Thomas Guillem

core: move viewpoint to vlc_viewpoint.h

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e61dee00915ab387a4778b3102ad53c6f6ff747b
---

 include/vlc_es.h                                   |  5 +-
 include/vlc_viewpoint.h                            | 57 ++++++++++++++++++++++
 include/vlc_vout.h                                 | 16 ------
 include/vlc_vout_display.h                         |  1 +
 lib/media_player_internal.h                        |  2 +-
 .../audio_filter/channel_mixer/spatialaudio.cpp    |  2 +-
 modules/control/hotkeys.c                          |  2 +-
 modules/video_output/opengl/vout_helper.c          |  1 +
 src/Makefile.am                                    |  1 +
 src/audio_output/aout_internal.h                   |  2 +-
 src/input/input_internal.h                         |  2 +-
 src/video_output/control.h                         |  1 +
 12 files changed, 67 insertions(+), 25 deletions(-)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index 19bea66ec2..0d1088fb5c 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -27,6 +27,7 @@
 #include <vlc_common.h>
 #include <vlc_fourcc.h>
 #include <vlc_text_style.h>
+#include <vlc_viewpoint.h>
 
 /**
  * \file
@@ -314,10 +315,6 @@ typedef enum video_chroma_location_t
     CHROMA_LOCATION_BOTTOM_CENTER,
 } video_chroma_location_t;
 
-#define FIELD_OF_VIEW_DEGREES_DEFAULT  80.f
-#define FIELD_OF_VIEW_DEGREES_MAX 150.f
-#define FIELD_OF_VIEW_DEGREES_MIN 20.f
-
 /**
  * video format description
  */
diff --git a/include/vlc_viewpoint.h b/include/vlc_viewpoint.h
new file mode 100644
index 0000000000..8c1b739e1f
--- /dev/null
+++ b/include/vlc_viewpoint.h
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * vlc_viewpoint.h: viewpoint struct and helpers
+ *****************************************************************************
+ * Copyright (C) 2017 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef VLC_VIEWPOINT_H_
+#define VLC_VIEWPOINT_H_ 1
+
+#include <vlc_common.h>
+
+/**
+ * \defgroup output Output
+ * \ingroup output
+ *
+ * @{
+ * \file
+ * Video and audio viewpoint struct and helpers
+ */
+
+#define FIELD_OF_VIEW_DEGREES_DEFAULT  80.f
+#define FIELD_OF_VIEW_DEGREES_MAX 150.f
+#define FIELD_OF_VIEW_DEGREES_MIN 20.f
+
+/**
+ * Viewpoints
+ */
+struct vlc_viewpoint_t {
+    float yaw;   /* yaw in degrees */
+    float pitch; /* pitch in degrees */
+    float roll;  /* roll in degrees */
+    float fov;   /* field of view in degrees */
+};
+
+static inline void vlc_viewpoint_init( vlc_viewpoint_t *p_vp )
+{
+    p_vp->yaw = p_vp->pitch = p_vp->roll = 0.0f;
+    p_vp->fov = FIELD_OF_VIEW_DEGREES_DEFAULT;
+}
+
+/**@}*/
+
+#endif /* VLC_VIEWPOINT_H_ */
diff --git a/include/vlc_vout.h b/include/vlc_vout.h
index 3dd50b1676..fd43f79572 100644
--- a/include/vlc_vout.h
+++ b/include/vlc_vout.h
@@ -82,22 +82,6 @@ struct vout_thread_t {
 #define VOUT_ALIGN_BOTTOM       0x0008
 #define VOUT_ALIGN_VMASK        0x000C
 
-/**
- * Viewpoints
- */
-struct vlc_viewpoint_t {
-    float yaw;   /* yaw in degrees */
-    float pitch; /* pitch in degrees */
-    float roll;  /* roll in degrees */
-    float fov;   /* field of view in degrees */
-};
-
-static inline void vlc_viewpoint_init( vlc_viewpoint_t *p_vp )
-{
-    p_vp->yaw = p_vp->pitch = p_vp->roll = 0.0f;
-    p_vp->fov = FIELD_OF_VIEW_DEGREES_DEFAULT;
-}
-
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 39dbfb95fb..4e243e48d6 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -32,6 +32,7 @@
 #include <vlc_mouse.h>
 #include <vlc_vout.h>
 #include <vlc_vout_window.h>
+#include <vlc_viewpoint.h>
 
 /**
  * \defgroup video_display Video output display
diff --git a/lib/media_player_internal.h b/lib/media_player_internal.h
index c67ddbaa7d..a8475c673f 100644
--- a/lib/media_player_internal.h
+++ b/lib/media_player_internal.h
@@ -32,7 +32,7 @@
 #include <vlc/vlc.h>
 #include <vlc/libvlc_media.h>
 #include <vlc_input.h>
-#include <vlc_vout.h>
+#include <vlc_viewpoint.h>
 
 #include "../modules/audio_filter/equalizer_presets.h"
 
diff --git a/modules/audio_filter/channel_mixer/spatialaudio.cpp b/modules/audio_filter/channel_mixer/spatialaudio.cpp
index a04ab9d8b8..d38625991e 100644
--- a/modules/audio_filter/channel_mixer/spatialaudio.cpp
+++ b/modules/audio_filter/channel_mixer/spatialaudio.cpp
@@ -34,7 +34,7 @@
 #include <vlc_plugin.h>
 #include <vlc_aout.h>
 #include <vlc_filter.h>
-#include <vlc_vout.h>
+#include <vlc_viewpoint.h>
 #include <vlc_keys.h>
 
 #include <new>
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index fc26268795..a3ddfd9f5e 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -36,7 +36,7 @@
 #include <vlc_interface.h>
 #include <vlc_input.h>
 #include <vlc_aout.h>
-#include <vlc_vout.h>
+#include <vlc_viewpoint.h>
 #include <vlc_vout_osd.h>
 #include <vlc_playlist.h>
 #include <vlc_keys.h>
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 075b1c2ee8..5c35ade2c1 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -38,6 +38,7 @@
 #include <vlc_opengl.h>
 #include <vlc_memory.h>
 #include <vlc_vout.h>
+#include <vlc_viewpoint.h>
 
 #include "vout_helper.h"
 #include "internal.h"
diff --git a/src/Makefile.am b/src/Makefile.am
index fac26a3d72..1ddb5283f5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -95,6 +95,7 @@ pluginsinclude_HEADERS = \
 	../include/vlc_tls.h \
 	../include/vlc_url.h \
 	../include/vlc_variables.h \
+	../include/vlc_viewpoint.h \
 	../include/vlc_vlm.h \
 	../include/vlc_video_splitter.h \
 	../include/vlc_vout.h \
diff --git a/src/audio_output/aout_internal.h b/src/audio_output/aout_internal.h
index c90eb6a44d..2852b6f3d8 100644
--- a/src/audio_output/aout_internal.h
+++ b/src/audio_output/aout_internal.h
@@ -25,7 +25,7 @@
 # define LIBVLC_AOUT_INTERNAL_H 1
 
 # include <vlc_atomic.h>
-# include <vlc_vout.h> /* for vlc_viewpoint_t */
+# include <vlc_viewpoint.h>
 
 /* Max input rate factor (1/4 -> 4) */
 # define AOUT_MAX_INPUT_RATE (4)
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index 87da2a634f..2d5384093b 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -29,7 +29,7 @@
 #include <vlc_access.h>
 #include <vlc_demux.h>
 #include <vlc_input.h>
-#include <vlc_vout.h>
+#include <vlc_viewpoint.h>
 #include <libvlc.h>
 #include "input_interface.h"
 #include "misc/interrupt.h"
diff --git a/src/video_output/control.h b/src/video_output/control.h
index f49208ab6a..04a66e9fb4 100644
--- a/src/video_output/control.h
+++ b/src/video_output/control.h
@@ -25,6 +25,7 @@
 #define LIBVLC_VOUT_INTERNAL_CONTROL_H
 
 #include <vlc_vout_window.h>
+#include <vlc_viewpoint.h>
 
 /* */
 enum {



More information about the vlc-commits mailing list