Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
0e47dc94
Commit
0e47dc94
authored
4 years ago
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aac config不再限制两个字节:#336
parent
6b7e4f5f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
15 行增加
和
15 行删除
+15
-15
src/Extension/AAC.h
+7
-3
src/Extension/Factory.cpp
+6
-11
src/Record/MP4Muxer.cpp
+2
-1
没有找到文件。
src/Extension/AAC.h
查看文件 @
0e47dc94
...
...
@@ -77,7 +77,7 @@ public:
if
(
aac_cfg
.
size
()
<
2
){
throw
std
::
invalid_argument
(
"adts配置必须最少2个字节"
);
}
_cfg
=
aac_cfg
.
substr
(
0
,
2
)
;
_cfg
=
aac_cfg
;
onReady
();
}
...
...
@@ -185,8 +185,12 @@ public:
_printer
<<
"b=AS:"
<<
bitrate
<<
"
\r\n
"
;
_printer
<<
"a=rtpmap:"
<<
payload_type
<<
" MPEG4-GENERIC/"
<<
sample_rate
<<
"/"
<<
channels
<<
"
\r\n
"
;
char
configStr
[
32
]
=
{
0
};
snprintf
(
configStr
,
sizeof
(
configStr
),
"%02X%02X"
,
(
uint8_t
)
aac_cfg
[
0
],
(
uint8_t
)
aac_cfg
[
1
]);
string
configStr
;
char
buf
[
4
]
=
{
0
};
for
(
auto
&
ch
:
aac_cfg
){
snprintf
(
buf
,
sizeof
(
buf
),
"%02X"
,
(
uint8_t
)
ch
);
configStr
.
append
(
buf
);
}
_printer
<<
"a=fmtp:"
<<
payload_type
<<
" streamtype=5;profile-level-id=1;mode=AAC-hbr;"
<<
"sizelength=13;indexlength=3;indexdeltalength=3;config="
<<
configStr
<<
"
\r\n
"
;
_printer
<<
"a=control:trackID="
<<
(
int
)
TrackAudio
<<
"
\r\n
"
;
...
...
This diff is collapsed.
Click to expand it.
src/Extension/Factory.cpp
查看文件 @
0e47dc94
...
...
@@ -33,17 +33,12 @@ Track::Ptr Factory::getTrackBySdp(const SdpTrack::Ptr &track) {
return
nullptr
;
}
string
aac_cfg
;
unsigned
int
cfg1
;
sscanf
(
aac_cfg_str
.
substr
(
0
,
2
).
data
(),
"%02X"
,
&
cfg1
);
cfg1
&=
0x00FF
;
aac_cfg
.
push_back
(
cfg1
);
unsigned
int
cfg2
;
sscanf
(
aac_cfg_str
.
substr
(
2
,
2
).
data
(),
"%02X"
,
&
cfg2
);
cfg2
&=
0x00FF
;
aac_cfg
.
push_back
(
cfg2
);
for
(
int
i
=
0
;
i
<
aac_cfg_str
.
size
()
/
2
;
++
i
){
unsigned
int
cfg
;
sscanf
(
aac_cfg_str
.
substr
(
i
*
2
,
2
).
data
(),
"%02X"
,
&
cfg
);
cfg
&=
0x00FF
;
aac_cfg
.
push_back
((
char
)
cfg
);
}
return
std
::
make_shared
<
AACTrack
>
(
aac_cfg
);
}
...
...
This diff is collapsed.
Click to expand it.
src/Record/MP4Muxer.cpp
查看文件 @
0e47dc94
...
...
@@ -202,7 +202,8 @@ void MP4Muxer::addTrack(const Track::Ptr &track) {
audio_track
->
getAudioChannel
(),
audio_track
->
getAudioSampleBit
()
*
audio_track
->
getAudioChannel
(),
audio_track
->
getAudioSampleRate
(),
audio_track
->
getAacCfg
().
data
(),
2
);
audio_track
->
getAacCfg
().
data
(),
audio_track
->
getAacCfg
().
size
());
if
(
track_id
<
0
){
WarnL
<<
"添加AAC Track失败:"
<<
track_id
;
return
;
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论