[vlc-devel] [PATCH 1/5] mp4: prhd, equi, cbmp and st3d boxes have a flag parameter

Vittorio Giovara vittorio.giovara at gmail.com
Tue Dec 6 05:08:21 CET 2016


On Mon, Dec 5, 2016 at 4:58 AM, Adrien Maglo <magsoft at videolan.org> wrote:
> According to the Google spatial video specification v2
> https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md
> these boxes inherit from "FullBox" which has a flag parameter of 4 bytes.
>
> This commit fixes the reading of parameters contained in these boxes.
> ---
>  modules/demux/mp4/libmp4.c | 5 +++++
>  modules/demux/mp4/libmp4.h | 4 ++++
>  2 files changed, 9 insertions(+)
>
> diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
> index 9ab5bf8..4007aaa 100644
> --- a/modules/demux/mp4/libmp4.c
> +++ b/modules/demux/mp4/libmp4.c
> @@ -772,6 +772,7 @@ static int MP4_ReadBox_st3d( stream_t *p_stream, MP4_Box_t *p_box )
>      MP4_READBOX_ENTER( MP4_Box_data_st3d_t, NULL );
>
>      MP4_Box_data_st3d_t *p_data = p_box->data.p_st3d;
> +    MP4_GET4BYTES( p_data->i_flags );
>      MP4_GET1BYTE( p_data->i_stereo_mode );
>
>      MP4_READBOX_EXIT( 1 );
> @@ -782,6 +783,8 @@ static int MP4_ReadBox_prhd( stream_t *p_stream, MP4_Box_t *p_box )
>      MP4_READBOX_ENTER( MP4_Box_data_prhd_t, NULL );
>
>      MP4_Box_data_prhd_t *p_data = p_box->data.p_prhd;
> +    MP4_GET4BYTES( p_data->i_flags );
> +
>      int32_t fixed16_16;
>      MP4_GET4BYTES( fixed16_16 );
>      p_data->f_pose_yaw_degrees   = (float) fixed16_16 / 65536.0f;
> @@ -800,6 +803,7 @@ static int MP4_ReadBox_equi( stream_t *p_stream, MP4_Box_t *p_box )
>      MP4_READBOX_ENTER( MP4_Box_data_equi_t, NULL );
>
>      MP4_Box_data_equi_t *p_data = p_box->data.p_equi;
> +    MP4_GET4BYTES( p_data->i_flags );
>      MP4_GET4BYTES( p_data->i_projection_bounds_top );
>      MP4_GET4BYTES( p_data->i_projection_bounds_bottom );
>      MP4_GET4BYTES( p_data->i_projection_bounds_left );
> @@ -813,6 +817,7 @@ static int MP4_ReadBox_cbmp( stream_t *p_stream, MP4_Box_t *p_box )
>      MP4_READBOX_ENTER( MP4_Box_data_cbmp_t, NULL );
>
>      MP4_Box_data_cbmp_t *p_data = p_box->data.p_cbmp;
> +    MP4_GET4BYTES( p_data->i_flags );
>      MP4_GET4BYTES( p_data->i_layout );
>      MP4_GET4BYTES( p_data->i_padding );
>
> diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
> index 42e3e02..176c5b5 100644
> --- a/modules/demux/mp4/libmp4.h
> +++ b/modules/demux/mp4/libmp4.h
> @@ -1554,6 +1554,7 @@ typedef struct
>
>  typedef struct
>  {
> +    int32_t i_flags;
>      enum {
>          ST3D_MONOSCOPIC = 0,
>          ST3D_STEREOSCOPIC_TOP_BOTTOM = 1,
> @@ -1564,6 +1565,7 @@ typedef struct
>
>  typedef struct
>  {
> +    int32_t i_flags;
>      float f_pose_yaw_degrees;
>      float f_pose_pitch_degrees;
>      float f_pose_roll_degrees;
> @@ -1571,6 +1573,7 @@ typedef struct
>
>  typedef struct
>  {
> +    int32_t i_flags;
>      uint32_t i_projection_bounds_top;
>      uint32_t i_projection_bounds_bottom;
>      uint32_t i_projection_bounds_left;
> @@ -1579,6 +1582,7 @@ typedef struct
>
>  typedef struct
>  {
> +    int32_t i_flags;
>      uint32_t i_layout;
>      uint32_t i_padding;
>  } MP4_Box_data_cbmp_t;
> --

Why are you adding flags to the public members?
As far as I know the box flags have no relationship with the data they
contain, plus right now they are all 0, so there is nothing worth
exporting.
-- 
Vittorio


More information about the vlc-devel mailing list