addTrack/inputFrame接口支持返回值;新增全局添加静音音频接口

This commit is contained in:
ziyue
2021-09-27 13:12:53 +08:00
parent 1f99708548
commit e9008afca0
63 changed files with 447 additions and 357 deletions

View File

@@ -42,9 +42,9 @@ CommonRtmpEncoder::CommonRtmpEncoder(const Track::Ptr &track) : CommonRtmpDecode
_audio_flv_flags = getAudioRtmpFlags(track);
}
void CommonRtmpEncoder::inputFrame(const Frame::Ptr &frame) {
bool CommonRtmpEncoder::inputFrame(const Frame::Ptr &frame) {
if (!_audio_flv_flags) {
return;
return false;
}
auto rtmp = RtmpPacket::create();
//header
@@ -57,6 +57,7 @@ void CommonRtmpEncoder::inputFrame(const Frame::Ptr &frame) {
rtmp->time_stamp = frame->dts();
rtmp->type_id = MSG_AUDIO;
RtmpCodec::inputRtmp(rtmp);
return true;
}
}//namespace mediakit