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
b4dc61ce
Commit
b4dc61ce
authored
Apr 06, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support
VC-1
in mp4, as muxed by L-Smash
We will get more and more of those samples soon...
parent
f325462b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
1 deletion
+60
-1
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+28
-0
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+11
-0
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+21
-1
No files found.
modules/demux/mp4/libmp4.c
View file @
b4dc61ce
...
...
@@ -1361,6 +1361,33 @@ static int MP4_ReadBox_dac3( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT
(
1
);
}
static
int
MP4_ReadBox_dvc1
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
MP4_Box_data_dvc1_t
*
p_dvc1
;
MP4_READBOX_ENTER
(
MP4_Box_data_dvc1_t
);
p_dvc1
=
p_box
->
data
.
p_dvc1
;
MP4_GET1BYTE
(
p_dvc1
->
i_profile_level
);
/* profile is on 4bits, level 3bits */
p_dvc1
->
i_vc1
=
p_box
->
i_size
-
7
;
/* Header + profile_level */
if
(
p_dvc1
->
i_vc1
>
0
)
{
uint8_t
*
p
=
p_dvc1
->
p_vc1
=
malloc
(
p_dvc1
->
i_vc1
);
if
(
p
)
memcpy
(
p
,
p_peek
,
i_read
);
}
#ifdef MP4_VERBOSE
msg_Dbg
(
p_stream
,
"read box:
\"
dvc1
\"
profile=0x%x level=0x%x"
,
p_dvc1
->
i_profile_level
&
0xf0
>>
4
,
p_dvc1
->
i_profile_level
&
0xe
>
1
);
#endif
MP4_READBOX_EXIT
(
1
);
}
static
int
MP4_ReadBox_enda
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
MP4_Box_data_enda_t
*
p_enda
;
...
...
@@ -3063,6 +3090,7 @@ static const struct
{
ATOM_cmvd
,
MP4_ReadBox_cmvd
,
MP4_FreeBox_cmvd
},
{
ATOM_avcC
,
MP4_ReadBox_avcC
,
MP4_FreeBox_avcC
},
{
ATOM_dac3
,
MP4_ReadBox_dac3
,
MP4_FreeBox_Common
},
{
ATOM_dvc1
,
MP4_ReadBox_dvc1
,
MP4_FreeBox_Common
},
{
ATOM_enda
,
MP4_ReadBox_enda
,
MP4_FreeBox_Common
},
{
ATOM_gnre
,
MP4_ReadBox_gnre
,
MP4_FreeBox_Common
},
{
ATOM_trkn
,
MP4_ReadBox_trkn
,
MP4_FreeBox_Common
},
...
...
modules/demux/mp4/libmp4.h
View file @
b4dc61ce
...
...
@@ -130,6 +130,7 @@
#define ATOM_alac VLC_FOURCC( 'a', 'l', 'a', 'c' )
#define ATOM_dac3 VLC_FOURCC( 'd', 'a', 'c', '3' )
#define ATOM_dec3 VLC_FOURCC( 'd', 'e', 'c', '3' )
#define ATOM_dvc1 VLC_FOURCC( 'd', 'v', 'c', '1' )
#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' )
...
...
@@ -1007,6 +1008,15 @@ typedef struct
}
MP4_Box_data_dac3_t
;
typedef
struct
{
uint8_t
i_profile_level
;
int
i_vc1
;
uint8_t
*
p_vc1
;
}
MP4_Box_data_dvc1_t
;
typedef
struct
{
uint16_t
i_little_endian
;
...
...
@@ -1139,6 +1149,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_esds_t
*
p_esds
;
MP4_Box_data_avcC_t
*
p_avcC
;
MP4_Box_data_dac3_t
*
p_dac3
;
MP4_Box_data_dvc1_t
*
p_dvc1
;
MP4_Box_data_enda_t
*
p_enda
;
MP4_Box_data_gnre_t
*
p_gnre
;
MP4_Box_data_trkn_t
*
p_trkn
;
...
...
modules/demux/mp4/mp4.c
View file @
b4dc61ce
...
...
@@ -1898,7 +1898,7 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
p_track
->
fmt
.
i_codec
=
VLC_FOURCC
(
'M'
,
'J'
,
'2'
,
'C'
);
break
;
case
(
0xa3
):
/* vc1 */
p_track
->
fmt
.
i_codec
=
VLC_
FOURCC
(
'W'
,
'V'
,
'C'
,
'1'
)
;
p_track
->
fmt
.
i_codec
=
VLC_
CODEC_VC1
;
break
;
case
(
0xa4
):
p_track
->
fmt
.
i_codec
=
VLC_CODEC_DIRAC
;
...
...
@@ -2012,6 +2012,26 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
}
break
;
case
VLC_FOURCC
(
'v'
,
'c'
,
'-'
,
'1'
):
{
MP4_Box_t
*
p_dvc1
=
MP4_BoxGet
(
p_sample
,
"dvc1"
);
if
(
p_dvc1
)
{
p_track
->
fmt
.
i_extra
=
p_dvc1
->
data
.
p_dvc1
->
i_vc1
;
if
(
p_track
->
fmt
.
i_extra
>
0
)
{
p_track
->
fmt
.
p_extra
=
malloc
(
p_dvc1
->
data
.
p_dvc1
->
i_vc1
);
memcpy
(
p_track
->
fmt
.
p_extra
,
p_dvc1
->
data
.
p_dvc1
->
p_vc1
,
p_track
->
fmt
.
i_extra
);
}
}
else
{
msg_Err
(
p_demux
,
"missing dvc1"
);
}
break
;
}
/* avc1: send avcC (h264 without annexe B, ie without start code)*/
case
VLC_FOURCC
(
'a'
,
'v'
,
'c'
,
'1'
):
{
...
...
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