Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
13
Issues
13
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
GSoC
GSoC2018
macOS
vlc
Commits
a741ddff
Commit
a741ddff
authored
Dec 21, 2018
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mux: mp4: mov AC3SpecificBox to extradata builder
parent
c6e7ad96
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
51 deletions
+41
-51
modules/mux/extradata.c
modules/mux/extradata.c
+39
-0
modules/mux/mp4/libmp4mux.c
modules/mux/mp4/libmp4mux.c
+2
-50
modules/mux/mp4/mp4.c
modules/mux/mp4/mp4.c
+0
-1
No files found.
modules/mux/extradata.c
View file @
a741ddff
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "extradata.h"
#include "extradata.h"
#include "../packetizer/av1_obu.h"
#include "../packetizer/av1_obu.h"
#include "../packetizer/a52.h"
struct
mux_extradata_builder_cb
struct
mux_extradata_builder_cb
{
{
...
@@ -43,6 +44,41 @@ struct mux_extradata_builder_t
...
@@ -43,6 +44,41 @@ struct mux_extradata_builder_t
vlc_fourcc_t
fcc
;
vlc_fourcc_t
fcc
;
};
};
static
void
ac3_extradata_builder_Feed
(
mux_extradata_builder_t
*
m
,
const
uint8_t
*
p_data
,
size_t
i_data
)
{
if
(
m
->
i_extra
||
i_data
<
VLC_A52_MIN_HEADER_SIZE
||
p_data
[
0
]
!=
0x0B
||
p_data
[
1
]
!=
0x77
)
return
;
struct
vlc_a52_bitstream_info
bsi
;
if
(
vlc_a52_ParseAc3BitstreamInfo
(
&
bsi
,
&
p_data
[
4
],
/* start code + CRC */
VLC_A52_MIN_HEADER_SIZE
-
4
)
!=
VLC_SUCCESS
)
return
;
m
->
p_extra
=
malloc
(
3
);
if
(
!
m
->
p_extra
)
return
;
m
->
i_extra
=
3
;
bs_t
s
;
bs_write_init
(
&
s
,
m
->
p_extra
,
m
->
i_extra
);
bs_write
(
&
s
,
2
,
bsi
.
i_fscod
);
bs_write
(
&
s
,
5
,
bsi
.
i_bsid
);
bs_write
(
&
s
,
3
,
bsi
.
i_bsmod
);
bs_write
(
&
s
,
3
,
bsi
.
i_acmod
);
bs_write
(
&
s
,
1
,
bsi
.
i_lfeon
);
bs_write
(
&
s
,
5
,
bsi
.
i_frmsizcod
>>
1
);
// bit_rate_code
bs_write
(
&
s
,
5
,
0
);
// reserved
}
const
struct
mux_extradata_builder_cb
ac3_cb
=
{
NULL
,
ac3_extradata_builder_Feed
,
NULL
,
};
static
void
av1_extradata_builder_Feed
(
mux_extradata_builder_t
*
m
,
static
void
av1_extradata_builder_Feed
(
mux_extradata_builder_t
*
m
,
const
uint8_t
*
p_data
,
size_t
i_data
)
const
uint8_t
*
p_data
,
size_t
i_data
)
{
{
...
@@ -91,6 +127,9 @@ mux_extradata_builder_t * mux_extradata_builder_New(vlc_fourcc_t fcc)
...
@@ -91,6 +127,9 @@ mux_extradata_builder_t * mux_extradata_builder_New(vlc_fourcc_t fcc)
case
VLC_CODEC_AV1
:
case
VLC_CODEC_AV1
:
cb
=
&
av1_cb
;
cb
=
&
av1_cb
;
break
;
break
;
case
VLC_CODEC_A52
:
cb
=
&
ac3_cb
;
break
;
default:
default:
return
NULL
;
return
NULL
;
}
}
...
...
modules/mux/mp4/libmp4mux.c
View file @
a741ddff
...
@@ -791,54 +791,6 @@ static bo_t *GetDec3Tag(es_format_t *p_fmt,
...
@@ -791,54 +791,6 @@ static bo_t *GetDec3Tag(es_format_t *p_fmt,
return
dec3
;
return
dec3
;
}
}
static
bo_t
*
GetDac3Tag
(
const
uint8_t
*
p_data
,
size_t
i_data
)
{
if
(
!
i_data
)
return
NULL
;
bo_t
*
dac3
=
box_new
(
"dac3"
);
if
(
!
dac3
)
return
NULL
;
bs_t
s
;
bs_init
(
&
s
,
p_data
,
i_data
);
uint8_t
fscod
,
bsid
,
bsmod
,
acmod
,
lfeon
,
frmsizecod
;
bs_skip
(
&
s
,
16
+
16
);
// syncword + crc
fscod
=
bs_read
(
&
s
,
2
);
frmsizecod
=
bs_read
(
&
s
,
6
);
bsid
=
bs_read
(
&
s
,
5
);
bsmod
=
bs_read
(
&
s
,
3
);
acmod
=
bs_read
(
&
s
,
3
);
if
(
acmod
==
2
)
bs_skip
(
&
s
,
2
);
// dsurmod
else
{
if
((
acmod
&
1
)
&&
acmod
!=
1
)
bs_skip
(
&
s
,
2
);
// cmixlev
if
(
acmod
&
4
)
bs_skip
(
&
s
,
2
);
// surmixlev
}
lfeon
=
bs_read1
(
&
s
);
uint8_t
mp4_a52_header
[
3
];
bs_write_init
(
&
s
,
mp4_a52_header
,
sizeof
(
mp4_a52_header
));
bs_write
(
&
s
,
2
,
fscod
);
bs_write
(
&
s
,
5
,
bsid
);
bs_write
(
&
s
,
3
,
bsmod
);
bs_write
(
&
s
,
3
,
acmod
);
bs_write
(
&
s
,
1
,
lfeon
);
bs_write
(
&
s
,
5
,
frmsizecod
>>
1
);
// bit_rate_code
bs_write
(
&
s
,
5
,
0
);
// reserved
bo_add_mem
(
dac3
,
sizeof
(
mp4_a52_header
),
mp4_a52_header
);
return
dac3
;
}
static
bo_t
*
GetDamrTag
(
es_format_t
*
p_fmt
)
static
bo_t
*
GetDamrTag
(
es_format_t
*
p_fmt
)
{
{
bo_t
*
damr
=
box_new
(
"damr"
);
bo_t
*
damr
=
box_new
(
"damr"
);
...
@@ -1270,8 +1222,8 @@ static bo_t *GetSounBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
...
@@ -1270,8 +1222,8 @@ static bo_t *GetSounBox(vlc_object_t *p_obj, mp4mux_trackinfo_t *p_track, bool b
box
=
GetWaveTag
(
p_track
);
box
=
GetWaveTag
(
p_track
);
else
if
(
codec
==
VLC_CODEC_AMR_NB
)
else
if
(
codec
==
VLC_CODEC_AMR_NB
)
box
=
GetDamrTag
(
&
p_track
->
fmt
);
box
=
GetDamrTag
(
&
p_track
->
fmt
);
else
if
(
codec
==
VLC_CODEC_A52
)
else
if
(
codec
==
VLC_CODEC_A52
&&
i_extradata
>=
3
)
box
=
Get
Dac3Tag
(
p_extradata
,
i_extradata
);
box
=
Get
xxxxTag
(
p_extradata
,
i_extradata
,
"dac3"
);
else
if
(
codec
==
VLC_CODEC_EAC3
)
else
if
(
codec
==
VLC_CODEC_EAC3
)
box
=
GetDec3Tag
(
&
p_track
->
fmt
,
p_extradata
,
i_extradata
);
box
=
GetDec3Tag
(
&
p_track
->
fmt
,
p_extradata
,
i_extradata
);
else
if
(
codec
==
VLC_CODEC_WMAP
)
else
if
(
codec
==
VLC_CODEC_WMAP
)
...
...
modules/mux/mp4/mp4.c
View file @
a741ddff
...
@@ -632,7 +632,6 @@ static block_t * BlockDequeue(sout_input_t *p_input, mp4_stream_t *p_stream)
...
@@ -632,7 +632,6 @@ static block_t * BlockDequeue(sout_input_t *p_input, mp4_stream_t *p_stream)
case
VLC_CODEC_SUBT
:
case
VLC_CODEC_SUBT
:
p_block
=
ConvertSUBT
(
p_block
);
p_block
=
ConvertSUBT
(
p_block
);
break
;
break
;
case
VLC_CODEC_A52
:
case
VLC_CODEC_EAC3
:
case
VLC_CODEC_EAC3
:
if
(
!
mp4mux_track_HasSamplePriv
(
p_stream
->
tinfo
)
&&
if
(
!
mp4mux_track_HasSamplePriv
(
p_stream
->
tinfo
)
&&
p_block
->
i_buffer
>=
8
)
p_block
->
i_buffer
>=
8
)
...
...
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