Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
d7c9404f
Commit
d7c9404f
authored
May 29, 2017
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: mp4: parse 3GPP ID3
Untested
parent
a270a72f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+1
-0
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+2
-0
modules/demux/mp4/meta.c
modules/demux/mp4/meta.c
+28
-0
No files found.
modules/demux/mp4/libmp4.c
View file @
d7c9404f
...
...
@@ -4504,6 +4504,7 @@ static const struct
/* iTunes/Quicktime meta info */
{
ATOM_meta
,
MP4_ReadBox_meta
,
0
},
{
ATOM_ID32
,
MP4_ReadBox_Binary
,
ATOM_meta
},
/* ID3v2 in 3GPP / ETSI TS 126 244 8.3 */
{
ATOM_data
,
MP4_ReadBox_data
,
0
},
/* ilst/@too and others, ITUN/data */
{
ATOM_mean
,
MP4_ReadBox_Binary
,
ATOM_ITUN
},
{
ATOM_name
,
MP4_ReadBox_Binary
,
ATOM_ITUN
},
...
...
modules/demux/mp4/libmp4.h
View file @
d7c9404f
...
...
@@ -354,6 +354,7 @@ typedef int64_t stime_t;
#define ATOM_chpl VLC_FOURCC( 'c', 'h', 'p', 'l' )
#define ATOM_HMMT VLC_FOURCC( 'H', 'M', 'M', 'T' )
#define ATOM_disk VLC_FOURCC( 'd', 'i', 's', 'k' )
#define ATOM_ID32 VLC_FOURCC( 'I', 'D', '3', '2' )
#define ATOM_WLOC VLC_FOURCC( 'W', 'L', 'O', 'C' )
#define ATOM_ITUN VLC_FOURCC( '-', '-', '-', '-' )
...
...
@@ -383,6 +384,7 @@ typedef int64_t stime_t;
#define HANDLER_mdta VLC_FOURCC('m', 'd', 't', 'a')
#define HANDLER_mdir VLC_FOURCC('m', 'd', 'i', 'r')
#define HANDLER_ID32 ATOM_ID32
#define SAMPLEGROUP_rap VLC_FOURCC('r', 'a', 'p', ' ')
...
...
modules/demux/mp4/meta.c
View file @
d7c9404f
...
...
@@ -28,6 +28,9 @@
#include <vlc_meta.h>
#include <vlc_charset.h>
#include "../meta_engine/ID3Tag.h"
#include "../meta_engine/ID3Meta.h"
#include <assert.h>
static
const
struct
...
...
@@ -487,6 +490,27 @@ static void SetupmdtaMeta( vlc_meta_t *p_meta, MP4_Box_t *p_box, MP4_Box_t *p_ke
}
}
static
int
ID3TAG_Parse_Handler
(
uint32_t
i_tag
,
const
uint8_t
*
p_payload
,
size_t
i_payload
,
void
*
p_priv
)
{
vlc_meta_t
*
p_meta
=
(
vlc_meta_t
*
)
p_priv
;
(
void
)
ID3HandleTag
(
p_payload
,
i_payload
,
i_tag
,
p_meta
,
NULL
);
return
VLC_SUCCESS
;
}
static
void
SetupID3v2Meta
(
vlc_meta_t
*
p_meta
,
MP4_Box_t
*
p_box
)
{
const
MP4_Box_t
*
p_binary
=
MP4_BoxGet
(
p_box
,
"ID32"
);
if
(
p_binary
==
NULL
||
!
BOXDATA
(
p_binary
)
||
BOXDATA
(
p_binary
)
->
i_blob
<
6
+
20
+
1
)
return
;
/* ID3v2 in 3GPP / ETSI TS 126 244 8.3, Header size 4 + 2 */
ID3TAG_Parse
(
&
((
uint8_t
*
)
BOXDATA
(
p_binary
)
->
p_blob
)[
6
],
BOXDATA
(
p_binary
)
->
i_blob
-
6
,
ID3TAG_Parse_Handler
,
p_meta
);
}
void
SetupMeta
(
vlc_meta_t
*
p_meta
,
MP4_Box_t
*
p_udta
)
{
uint32_t
i_handler
=
0
;
...
...
@@ -504,6 +528,10 @@ void SetupMeta( vlc_meta_t *p_meta, MP4_Box_t *p_udta )
break
;
}
case
HANDLER_ID32
:
SetupID3v2Meta
(
p_meta
,
p_box
);
break
;
case
HANDLER_mdir
:
default:
SetupmdirMeta
(
p_meta
,
p_box
);
...
...
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