Skip to content
GitLab
Explore
Sign in
Register
Commits on Source (2)
Add orientation and projection enums
· 8d6e2848
Martin Finkel
authored
Jul 11, 2017
8d6e2848
Add video viewpoint
· 78f59fdb
Martin Finkel
authored
Jul 12, 2017
78f59fdb
Hide whitespace changes
Inline
Side-by-side
vlcpp/MediaPlayer.hpp
View file @
78f59fdb
...
...
@@ -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
View file @
78f59fdb
...
...
@@ -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
...
...