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
afd07036
Commit
afd07036
authored
Oct 22, 2013
by
Denis Charmet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add HEVC support in MP4
parent
cdb1a7b6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
0 deletions
+55
-0
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+24
-0
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+9
-0
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+22
-0
No files found.
modules/demux/mp4/libmp4.c
View file @
afd07036
...
...
@@ -1303,6 +1303,29 @@ static int MP4_ReadBox_esds( stream_t *p_stream, MP4_Box_t *p_box )
#undef es_descriptor
}
static
void
MP4_FreeBox_hvcC
(
MP4_Box_t
*
p_box
)
{
MP4_Box_data_hvcC_t
*
p_hvcC
=
p_box
->
data
.
p_hvcC
;
if
(
p_hvcC
->
i_hvcC
>
0
)
FREENULL
(
p_hvcC
->
p_hvcC
)
;
}
static
int
MP4_ReadBox_hvcC
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
MP4_Box_data_hvcC_t
*
p_hvcC
;
MP4_READBOX_ENTER
(
MP4_Box_data_hvcC_t
);
p_hvcC
=
p_box
->
data
.
p_hvcC
;
p_hvcC
->
i_hvcC
=
i_read
;
if
(
p_hvcC
->
i_hvcC
>
0
)
{
uint8_t
*
p
=
p_hvcC
->
p_hvcC
=
malloc
(
p_hvcC
->
i_hvcC
);
if
(
p
)
memcpy
(
p
,
p_peek
,
i_read
);
}
MP4_READBOX_EXIT
(
1
);
}
static
void
MP4_FreeBox_avcC
(
MP4_Box_t
*
p_box
)
{
MP4_Box_data_avcC_t
*
p_avcC
=
p_box
->
data
.
p_avcC
;
...
...
@@ -3180,6 +3203,7 @@ static const struct
{
ATOM_dcom
,
MP4_ReadBox_dcom
,
MP4_FreeBox_Common
},
{
ATOM_cmvd
,
MP4_ReadBox_cmvd
,
MP4_FreeBox_cmvd
},
{
ATOM_avcC
,
MP4_ReadBox_avcC
,
MP4_FreeBox_avcC
},
{
ATOM_hvcC
,
MP4_ReadBox_hvcC
,
MP4_FreeBox_hvcC
},
{
ATOM_dac3
,
MP4_ReadBox_dac3
,
MP4_FreeBox_Common
},
{
ATOM_dvc1
,
MP4_ReadBox_dvc1
,
MP4_FreeBox_Common
},
{
ATOM_enda
,
MP4_ReadBox_enda
,
MP4_FreeBox_Common
},
...
...
modules/demux/mp4/libmp4.h
View file @
afd07036
...
...
@@ -167,6 +167,8 @@
#define ATOM_avcC VLC_FOURCC( 'a', 'v', 'c', 'C' )
#define ATOM_m4ds VLC_FOURCC( 'm', '4', 'd', 's' )
#define ATOM_hvcC VLC_FOURCC( 'h', 'v', 'c', 'C' )
#define ATOM_dvc VLC_FOURCC( 'd', 'v', 'c', ' ' )
#define ATOM_dvp VLC_FOURCC( 'd', 'v', 'p', ' ' )
#define ATOM_dv5n VLC_FOURCC( 'd', 'v', '5', 'n' )
...
...
@@ -1149,6 +1151,12 @@ typedef struct
uint8_t
*
CodecPrivateData
;
}
MP4_Box_data_stra_t
;
typedef
struct
{
uint32_t
i_hvcC
;
uint8_t
*
p_hvcC
;
}
MP4_Box_data_hvcC_t
;
/*
typedef struct MP4_Box_data__s
{
...
...
@@ -1233,6 +1241,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_tfrf_t
*
p_tfrf
;
MP4_Box_data_tfxd_t
*
p_tfxd
;
MP4_Box_data_hvcC_t
*
p_hvcC
;
void
*
p_data
;
/* for unknow type */
}
MP4_Box_data_t
;
...
...
modules/demux/mp4/mp4.c
View file @
afd07036
...
...
@@ -2217,6 +2217,28 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
}
break
;
}
case
VLC_FOURCC
(
'h'
,
'v'
,
'c'
,
'1'
):
{
MP4_Box_t
*
p_hvcC
=
MP4_BoxGet
(
p_sample
,
"hvcC"
);
if
(
p_hvcC
)
{
p_track
->
fmt
.
i_extra
=
p_hvcC
->
data
.
p_hvcC
->
i_hvcC
;
if
(
p_track
->
fmt
.
i_extra
>
0
)
{
p_track
->
fmt
.
p_extra
=
malloc
(
p_hvcC
->
data
.
p_hvcC
->
i_hvcC
);
memcpy
(
p_track
->
fmt
.
p_extra
,
p_hvcC
->
data
.
p_hvcC
->
p_hvcC
,
p_track
->
fmt
.
i_extra
);
}
p_track
->
fmt
.
i_codec
=
VLC_CODEC_HEVC
;
}
else
{
msg_Err
(
p_demux
,
"missing hvcC"
);
}
break
;
}
case
VLC_CODEC_ADPCM_MS
:
case
VLC_CODEC_ADPCM_IMA_WAV
:
...
...
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