[vlc-devel] [PATCH 01/14] core: add 3D stereo information to video_format_t
Felix Abecassis
felix.abecassis at gmail.com
Tue Sep 9 19:03:20 CEST 2014
---
include/vlc_es.h | 38 ++++++++++++++++++++++++++++++++++++++
src/input/decoder.c | 3 ++-
src/misc/es_format.c | 3 +++
3 files changed, 43 insertions(+), 1 deletion(-)
diff --git a/include/vlc_es.h b/include/vlc_es.h
index 5790d23..ad33f3a 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -191,6 +191,42 @@ typedef enum video_transform_t
TRANSFORM_ANTI_TRANSPOSE = ORIENT_ANTI_TRANSPOSED
} video_transform_t;
+typedef enum vlc_stereo3d_mode
+{
+ /* No stereoscopy: 2D picture. */
+ VLC_STEREO3D_2D = 0,
+
+ /* Side-by-side with left eye first. */
+ VLC_STEREO3D_SBS,
+
+ /* Top-bottom with left eye first. */
+ VLC_STEREO3D_TB,
+
+ /* Row sequential with left eye first. */
+ VLC_STEREO3D_ROW,
+
+ /* Column sequential with left eye first. */
+ VLC_STEREO3D_COL,
+
+ /* Frame sequential with left eye first. */
+ VLC_STEREO3D_FRAME,
+
+ /* Checkerboard pattern with left eye first. */
+ VLC_STEREO3D_CHECKERBOARD,
+} vlc_stereo3d_mode;
+
+typedef enum vlc_stereo3d_flag
+{
+ /* Right eye is first instead of left eye. */
+ VLC_STEREO3D_SWAP_EYES = 1,
+} vlc_stereo3d_flag;
+
+typedef struct
+{
+ vlc_stereo3d_mode mode;
+ vlc_stereo3d_flag flags;
+} stereo3d_format_t;
+
/**
* video format description
*/
@@ -219,6 +255,8 @@ struct video_format_t
int i_rbshift, i_lbshift;
video_palette_t *p_palette; /**< video palette from demuxer */
video_orientation_t orientation; /**< picture orientation */
+
+ stereo3d_format_t stereo;
};
/**
diff --git a/src/input/decoder.c b/src/input/decoder.c
index c90d149..d112265 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -2040,7 +2040,8 @@ static picture_t *vout_new_buffer( decoder_t *p_dec )
|| p_dec->fmt_out.i_codec != p_owner->fmt.video.i_chroma
|| (int64_t)p_dec->fmt_out.video.i_sar_num * p_owner->fmt.video.i_sar_den !=
(int64_t)p_dec->fmt_out.video.i_sar_den * p_owner->fmt.video.i_sar_num ||
- p_dec->fmt_out.video.orientation != p_owner->fmt.video.orientation )
+ p_dec->fmt_out.video.orientation != p_owner->fmt.video.orientation ||
+ p_dec->fmt_out.video.stereo.mode != p_owner->fmt.video.stereo.mode )
{
vout_thread_t *p_vout;
diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index 27622bc..cf5f0d8 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -392,6 +392,9 @@ bool video_format_IsSimilar( const video_format_t *p_fmt1, const video_format_t
if( v1.orientation != v2.orientation)
return false;
+ if( v1.stereo.mode != v2.stereo.mode )
+ return false;
+
if( v1.i_chroma == VLC_CODEC_RGB15 ||
v1.i_chroma == VLC_CODEC_RGB16 ||
v1.i_chroma == VLC_CODEC_RGB24 ||
--
1.9.1
More information about the vlc-devel
mailing list