[vlc-commits] [Git][videolan/libvlcpp][master] 2 commits: Add orientation and projection enums

Martin Finkel gitlab at videolan.org
Mon Jul 17 13:51:00 CEST 2017


Martin Finkel pushed to branch master at videolan / libvlcpp


Commits:
8d6e2848 by Martin Finkel at 2017-07-17T12:55:50+02:00
Add orientation and projection enums

- - - - -
78f59fdb by Martin Finkel at 2017-07-17T13:43:14+02:00
Add video viewpoint

- - - - -


2 changed files:

- vlcpp/MediaPlayer.hpp
- vlcpp/structures.hpp


Changes:

=====================================
vlcpp/MediaPlayer.hpp
=====================================
--- a/vlcpp/MediaPlayer.hpp
+++ b/vlcpp/MediaPlayer.hpp
@@ -1688,6 +1688,12 @@ public:
                         static_cast<libvlc_media_slave_type_t>( type ), uri.c_str(), select ) == 0;
     }
 
+    bool updateViewpoint( const VideoViewpoint& viewpoint, bool b_absolute )
+    {
+        return libvlc_video_update_viewpoint( *this, 
+            static_cast<const libvlc_video_viewpoint_t*>( &viewpoint ), b_absolute ) == 0;
+    }
+
 #endif
 
 private:


=====================================
vlcpp/structures.hpp
=====================================
--- a/vlcpp/structures.hpp
+++ b/vlcpp/structures.hpp
@@ -111,6 +111,33 @@ public:
         /// Subtitle track (also called SPU sometimes)
         Subtitle
     };
+
+    ///
+    /// \brief The Orientation enum indicates the orientation of a video
+    ///
+    enum class Orientation
+    {
+        TopLeft,
+        TopRight,
+        BottomLeft,
+        BottomRight,
+        LeftTop,
+        LeftBottom,
+        RightTop,
+        RightBottom
+    };
+
+    ///
+    /// \brief The Projection enum indicates the projection of a video
+    ///
+    enum class Projection
+    {
+        Rectangular,
+        /// 360 spherical
+        Equirectangular,
+        CubemapLayoutStandard = 0x100
+    };
+
 #if !defined(_MSC_VER) || _MSC_VER >= 1900
     constexpr static Type Unknown = Type::Unknown;
     constexpr static Type Audio = Type::Audio;
@@ -292,6 +319,26 @@ public:
         return m_fpsDen;
     }
 
+    ///
+    /// \brief Orientation
+    ///
+    /// \see orientation
+    ///
+    Orientation orientation() const
+    {
+        return m_orientation;
+    }
+
+    ///
+    /// \brief Projection
+    ///
+    /// \see projection
+    ///
+    Projection projection() const
+    {
+        return m_projection;
+    }
+
     ////////////////////////////////////////////////////////////////////////////
     // Subtitles specific
     ////////////////////////////////////////////////////////////////////////////
@@ -331,6 +378,8 @@ public:
                 m_sarDen = c->video->i_sar_den;
                 m_fpsNum = c->video->i_frame_rate_num;
                 m_fpsDen = c->video->i_frame_rate_den;
+                m_orientation = static_cast<Orientation>( c->video->i_orientation );
+                m_projection = static_cast<Projection>( c->video->i_projection );
                 break;
             case libvlc_track_text:
                 m_type = Subtitle;
@@ -364,6 +413,8 @@ private:
     uint32_t m_sarDen;
     uint32_t m_fpsNum;
     uint32_t m_fpsDen;
+    Orientation m_orientation;
+    Projection m_projection;
     // Subtitles
     std::string m_encoding;
 };
@@ -598,6 +649,45 @@ public:
         return psz_uri;
     }
 };
+
+
+///
+/// \brief C++ Type wrapper for libvlc_video_viewpoint_t 
+///
+class VideoViewpoint : public libvlc_video_viewpoint_t
+{
+public:
+    VideoViewpoint( float yaw, float pitch, float roll, float fieldOfView )
+    {
+        f_yaw = yaw;
+        f_pitch = pitch;
+        f_roll = roll;
+        f_field_of_view = fieldOfView;
+    }
+
+public:
+    float yaw() const
+    {
+        return f_yaw;
+    }
+
+    float pitch() const
+    {
+        return f_pitch;
+    }
+
+    float roll() const
+    {
+        return f_roll;
+    }
+
+    float field_of_view() const
+    {
+        return f_field_of_view;
+    }
+};
+
+
 #endif
 
 } // namespace VLC



View it on GitLab: https://code.videolan.org/videolan/libvlcpp/compare/f60d407cc68cdd3ad7ea9b250780a3620e1652e9...78f59fdbcdbb76b228703f473b7939b034bde7c8

---
View it on GitLab: https://code.videolan.org/videolan/libvlcpp/compare/f60d407cc68cdd3ad7ea9b250780a3620e1652e9...78f59fdbcdbb76b228703f473b7939b034bde7c8
You're receiving this email because of your account on code.videolan.org.


More information about the vlc-commits mailing list