Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
8b2da746
Commit
8b2da746
authored
Aug 27, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: add chan atom
parent
430f67db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
0 deletions
+68
-0
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+48
-0
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+20
-0
No files found.
modules/demux/mp4/libmp4.c
View file @
8b2da746
...
...
@@ -1452,6 +1452,52 @@ error:
MP4_READBOX_EXIT
(
0
);
}
static
int
MP4_ReadBox_stsdext_chan
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
MP4_READBOX_ENTER
(
MP4_Box_data_chan_t
);
MP4_Box_data_chan_t
*
p_chan
=
p_box
->
data
.
p_chan
;
if
(
i_read
<
16
)
MP4_READBOX_EXIT
(
0
);
MP4_GET1BYTE
(
p_chan
->
i_version
);
MP4_GET3BYTES
(
p_chan
->
i_channels_flags
);
MP4_GET4BYTES
(
p_chan
->
layout
.
i_channels_layout_tag
);
MP4_GET4BYTES
(
p_chan
->
layout
.
i_channels_bitmap
);
MP4_GET4BYTES
(
p_chan
->
layout
.
i_channels_description_count
);
if
(
i_read
<
p_chan
->
layout
.
i_channels_description_count
*
24
)
MP4_READBOX_EXIT
(
0
);
p_chan
->
layout
.
p_descriptions
=
malloc
(
p_chan
->
layout
.
i_channels_description_count
*
24
);
if
(
!
p_chan
->
layout
.
p_descriptions
)
MP4_READBOX_EXIT
(
0
);
for
(
uint32_t
i
=
0
;
i
<
p_chan
->
layout
.
i_channels_description_count
;
i
++
)
{
MP4_GET4BYTES
(
p_chan
->
layout
.
p_descriptions
[
i
].
i_channel_label
);
MP4_GET4BYTES
(
p_chan
->
layout
.
p_descriptions
[
i
].
i_channel_flags
);
MP4_GET4BYTES
(
p_chan
->
layout
.
p_descriptions
[
i
].
f_coordinates
[
0
]
);
MP4_GET4BYTES
(
p_chan
->
layout
.
p_descriptions
[
i
].
f_coordinates
[
1
]
);
MP4_GET4BYTES
(
p_chan
->
layout
.
p_descriptions
[
i
].
f_coordinates
[
2
]
);
}
#ifdef MP4_VERBOSE
msg_Dbg
(
p_stream
,
"read box:
\"
chan
\"
flags=0x%x tag=0x%x bitmap=0x%x descriptions=%u"
,
p_chan
->
i_channels_flags
,
p_chan
->
layout
.
i_channels_layout_tag
,
p_chan
->
layout
.
i_channels_bitmap
,
p_chan
->
layout
.
i_channels_description_count
);
#endif
MP4_READBOX_EXIT
(
1
);
}
static
void
MP4_FreeBox_stsdext_chan
(
MP4_Box_t
*
p_box
)
{
MP4_Box_data_chan_t
*
p_chan
=
p_box
->
data
.
p_chan
;
free
(
p_chan
->
layout
.
p_descriptions
);
}
static
int
MP4_ReadBox_dac3
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
MP4_Box_data_dac3_t
*
p_dac3
;
...
...
@@ -3371,6 +3417,8 @@ static const struct
{
ATOM_sawb
,
MP4_ReadBox_sample_soun
,
MP4_FreeBox_sample_soun
,
ATOM_stsd
},
{
ATOM_OggS
,
MP4_ReadBox_sample_soun
,
MP4_FreeBox_sample_soun
,
ATOM_stsd
},
{
ATOM_alac
,
MP4_ReadBox_sample_soun
,
MP4_FreeBox_sample_soun
,
ATOM_stsd
},
/* Sound extensions */
{
ATOM_chan
,
MP4_ReadBox_stsdext_chan
,
MP4_FreeBox_stsdext_chan
,
0
},
{
ATOM_drmi
,
MP4_ReadBox_sample_vide
,
MP4_FreeBox_sample_vide
,
ATOM_stsd
},
{
ATOM_vide
,
MP4_ReadBox_sample_vide
,
MP4_FreeBox_sample_vide
,
ATOM_stsd
},
...
...
modules/demux/mp4/libmp4.h
View file @
8b2da746
...
...
@@ -140,6 +140,7 @@
#define ATOM_enda VLC_FOURCC( 'e', 'n', 'd', 'a' )
#define ATOM_gnre VLC_FOURCC( 'g', 'n', 'r', 'e' )
#define ATOM_trkn VLC_FOURCC( 't', 'r', 'k', 'n' )
#define ATOM_chan VLC_FOURCC( 'c', 'h', 'a', 'n' )
#define ATOM_zlib VLC_FOURCC( 'z', 'l', 'i', 'b' )
#define ATOM_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
...
...
@@ -1037,6 +1038,24 @@ typedef struct
}
MP4_Box_data_avcC_t
;
typedef
struct
{
uint8_t
i_version
;
uint32_t
i_channels_flags
;
/* 24 bits */
struct
{
uint32_t
i_channels_layout_tag
;
uint32_t
i_channels_bitmap
;
uint32_t
i_channels_description_count
;
struct
{
uint32_t
i_channel_label
;
uint32_t
i_channel_flags
;
float
f_coordinates
[
3
];
}
*
p_descriptions
;
}
layout
;
}
MP4_Box_data_chan_t
;
typedef
struct
{
uint8_t
i_fscod
;
...
...
@@ -1222,6 +1241,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_avcC_t
*
p_avcC
;
MP4_Box_data_dac3_t
*
p_dac3
;
MP4_Box_data_dvc1_t
*
p_dvc1
;
MP4_Box_data_chan_t
*
p_chan
;
MP4_Box_data_enda_t
*
p_enda
;
MP4_Box_data_gnre_t
*
p_gnre
;
MP4_Box_data_trkn_t
*
p_trkn
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment