Commit 0fe27309 authored by Adrien Maglo's avatar Adrien Maglo Committed by François Cartegnie

mp4: save the multiview_mode meta-data encoded with the spatial media specification v1

https://github.com/google/spatial-media/blob/master/docs/spherical-video-rfc.md#stereo-modeSigned-off-by: François Cartegnie's avatarFrancois Cartegnie <fcvlcdev@free.fr>
parent eb46716d
......@@ -356,7 +356,21 @@ int SetupVideoES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
if( p_uuid->i_type == ATOM_uuid
&& !CmpUUID( &p_uuid->i_uuid, &XML360BoxUUID )
&& p_uuid->data.p_360 )
{
p_track->fmt.video.projection_mode = p_uuid->data.p_360->i_projection_mode;
switch (p_uuid->data.p_360->e_stereo_mode)
{
case XML360_STEREOSCOPIC_TOP_BOTTOM:
p_track->fmt.video.multiview_mode = MULTIVIEW_STEREO_TB;
break;
case XML360_STEREOSCOPIC_LEFT_RIGHT:
p_track->fmt.video.multiview_mode = MULTIVIEW_STEREO_SBS;
break;
default:
p_track->fmt.video.multiview_mode = MULTIVIEW_2D;
break;
}
}
}
const MP4_Box_t *p_st3d = MP4_BoxGet( p_sample, "st3d" );
......
......@@ -742,10 +742,16 @@ static int MP4_ReadBox_XML360( stream_t *p_stream, MP4_Box_t *p_box )
/* Try to find the stero mode. */
if ( strcasestr( psz_rdf, "left-right" ) )
{
msg_Dbg( p_stream, "Left-right stereo mode" );
p_360_data->e_stereo_mode = XML360_STEREOSCOPIC_LEFT_RIGHT;
}
if ( strcasestr( psz_rdf, "top-bottom" ) )
{
msg_Dbg( p_stream, "Top-bottom stereo mode" );
p_360_data->e_stereo_mode = XML360_STEREOSCOPIC_TOP_BOTTOM;
}
free( psz_rdf );
......
......@@ -1579,6 +1579,11 @@ typedef struct
typedef struct
{
uint32_t i_projection_mode;
enum {
XML360_MONOSCOPIC = 0,
XML360_STEREOSCOPIC_TOP_BOTTOM = 1,
XML360_STEREOSCOPIC_LEFT_RIGHT = 2,
} e_stereo_mode;
} MP4_Box_data_360_t;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment