Commit b9a9971d authored by François Cartegnie's avatar François Cartegnie 🤞

demux: mp4: read vp8/9/10 content light level

(cherry picked from commit a238a388)
parent 393ab4ff
......@@ -727,6 +727,13 @@ int SetupVideoES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
p_track->fmt.video.mastering.max_luminance = BOXDATA(p_SmDm)->i_luminanceMax;
p_track->fmt.video.mastering.min_luminance = BOXDATA(p_SmDm)->i_luminanceMin;
}
const MP4_Box_t *p_CoLL = MP4_BoxGet( p_sample, "CoLL" );
if( p_CoLL && BOXDATA(p_CoLL) )
{
p_track->fmt.video.lighting.MaxCLL = BOXDATA(p_CoLL)->i_maxCLL;
p_track->fmt.video.lighting.MaxFALL = BOXDATA(p_CoLL)->i_maxFALL;
}
}
}
break;
......
......@@ -2008,6 +2008,15 @@ static int MP4_ReadBox_SmDm( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT( 1 );
}
static int MP4_ReadBox_CoLL( stream_t *p_stream, MP4_Box_t *p_box )
{
MP4_READBOX_ENTER( MP4_Box_data_CoLL_t, NULL );
MP4_Box_data_CoLL_t *p_CoLL = p_box->data.p_CoLL;
MP4_GET2BYTES( p_CoLL->i_maxCLL );
MP4_GET2BYTES( p_CoLL->i_maxFALL );
MP4_READBOX_EXIT( 1 );
}
static void MP4_FreeBox_WMA2( MP4_Box_t *p_box )
{
FREENULL( p_box->data.p_WMA2->p_extra );
......@@ -4441,6 +4450,7 @@ static const struct
{ ATOM_vpcC, MP4_ReadBox_vpcC, ATOM_vp09 },
{ ATOM_vpcC, MP4_ReadBox_vpcC, ATOM_vp10 },
{ ATOM_SmDm, MP4_ReadBox_SmDm, ATOM_vpcC }, /* vpx mastering display */
{ ATOM_CoLL, MP4_ReadBox_CoLL, ATOM_vpcC }, /* vpx light level */
{ ATOM_dac3, MP4_ReadBox_dac3, 0 },
{ ATOM_dec3, MP4_ReadBox_dec3, 0 },
{ ATOM_dvc1, MP4_ReadBox_dvc1, ATOM_vc1 },
......
......@@ -385,6 +385,7 @@ typedef int64_t stime_t;
#define ATOM_gstd VLC_FOURCC( 'g', 's', 't', 'd' )
#define ATOM_colr VLC_FOURCC( 'c', 'o', 'l', 'r' )
#define ATOM_SmDm VLC_FOURCC( 'S', 'm', 'D', 'm' )
#define ATOM_CoLL VLC_FOURCC( 'C', 'o', 'L', 'L' )
#define ATOM_0x40PRM VLC_FOURCC( '@', 'P', 'R', 'M' )
#define ATOM_0x40PRQ VLC_FOURCC( '@', 'P', 'R', 'Q' )
......@@ -1292,6 +1293,12 @@ typedef struct
uint32_t i_luminanceMin;
} MP4_Box_data_SmDm_t;
typedef struct
{
uint16_t i_maxCLL;
uint16_t i_maxFALL;
} MP4_Box_data_CoLL_t;
typedef struct
{
WAVEFORMATEX Format;
......@@ -1692,6 +1699,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_load_t *p_load;
MP4_Box_data_vpcC_t *p_vpcC;
MP4_Box_data_SmDm_t *p_SmDm;
MP4_Box_data_CoLL_t *p_CoLL;
MP4_Box_data_tfra_t *p_tfra;
MP4_Box_data_mfro_t *p_mfro;
......
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