<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<p>Hi Adrien,</p>
<p>On 2016-12-05 10:58, Adrien Maglo wrote:</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> 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(+)</code></pre>
</blockquote>
<p>Is there any reason for declaring the <em>data-members</em> as <code>int32_t</code>, instead of <code>uint32_t</code>?</p>
<p>Given that I expect, judging from the <em>data-member name</em>, that it is to contain (bitwise) flags, I would recommend using an <em>unsigned</em> type (as this is easier to work with).</p>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;color:#500050">
<pre><code> 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;
--
2.9.3
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
https://mailman.videolan.org/listinfo/vlc-devel</code></pre>
</blockquote>
</body>
</html>