mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-17 23:37:49 +08:00
startSendRtp、startRecord接口支持缓存多个gop (#4180)
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
This commit is contained in:
parent
479a3fb9bb
commit
11d1b849ec
@ -332,8 +332,8 @@ h265_pt=99
|
|||||||
ps_pt=96
|
ps_pt=96
|
||||||
#rtp opus 负载的pt
|
#rtp opus 负载的pt
|
||||||
opus_pt=100
|
opus_pt=100
|
||||||
#RtpSender相关功能是否提前开启gop缓存优化级联秒开体验,默认开启
|
#startSendRtp、startRecord相关功能是否提前开启gop缓存优化级联秒开体验,默认开启, 并缓存1个GOP
|
||||||
#如果不调用startSendRtp相关接口,可以置0节省内存
|
#如果不调用startSendRtp、startRecord后相关接口,可以置0节省内存;如果缓存多个gop,可以加大该参数
|
||||||
gop_cache=1
|
gop_cache=1
|
||||||
|
|
||||||
#国标发送g711 rtp 打包时,每个包的语音时长是多少,默认是100 ms,范围为20~180ms (gb28181-2016,c.2.4规定),
|
#国标发送g711 rtp 打包时,每个包的语音时长是多少,默认是100 ms,范围为20~180ms (gb28181-2016,c.2.4规定),
|
||||||
|
|||||||
@ -400,7 +400,7 @@ bool MultiMediaSourceMuxer::isRecording(MediaSource &sender, Recorder::type type
|
|||||||
|
|
||||||
void MultiMediaSourceMuxer::startSendRtp(MediaSource &sender, const MediaSourceEvent::SendRtpArgs &args, const std::function<void(uint16_t, const toolkit::SockException &)> cb) {
|
void MultiMediaSourceMuxer::startSendRtp(MediaSource &sender, const MediaSourceEvent::SendRtpArgs &args, const std::function<void(uint16_t, const toolkit::SockException &)> cb) {
|
||||||
#if defined(ENABLE_RTPPROXY)
|
#if defined(ENABLE_RTPPROXY)
|
||||||
createGopCacheIfNeed();
|
createGopCacheIfNeed(1);
|
||||||
|
|
||||||
auto ring = _ring;
|
auto ring = _ring;
|
||||||
auto ssrc = args.ssrc;
|
auto ssrc = args.ssrc;
|
||||||
@ -576,9 +576,9 @@ void MultiMediaSourceMuxer::onAllTrackReady() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ENABLE_RTPPROXY)
|
#if defined(ENABLE_RTPPROXY)
|
||||||
GET_CONFIG(bool, gop_cache, RtpProxy::kGopCache);
|
GET_CONFIG(size_t, gop_cache, RtpProxy::kGopCache);
|
||||||
if (gop_cache) {
|
if (gop_cache > 0) {
|
||||||
createGopCacheIfNeed();
|
createGopCacheIfNeed(gop_cache);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -593,7 +593,7 @@ void MultiMediaSourceMuxer::onAllTrackReady() {
|
|||||||
InfoL << "stream: " << shortUrl() << " , codec info: " << getTrackInfoStr(this);
|
InfoL << "stream: " << shortUrl() << " , codec info: " << getTrackInfoStr(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiMediaSourceMuxer::createGopCacheIfNeed() {
|
void MultiMediaSourceMuxer::createGopCacheIfNeed(size_t gop_count) {
|
||||||
if (_ring) {
|
if (_ring) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -607,7 +607,7 @@ void MultiMediaSourceMuxer::createGopCacheIfNeed() {
|
|||||||
strong_self->onReaderChanged(*src, strong_self->totalReaderCount());
|
strong_self->onReaderChanged(*src, strong_self->totalReaderCount());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
}, gop_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MultiMediaSourceMuxer::resetTracks() {
|
void MultiMediaSourceMuxer::resetTracks() {
|
||||||
|
|||||||
@ -231,7 +231,7 @@ protected:
|
|||||||
bool onTrackFrame_l(const Frame::Ptr &frame);
|
bool onTrackFrame_l(const Frame::Ptr &frame);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void createGopCacheIfNeed();
|
void createGopCacheIfNeed(size_t gop_count);
|
||||||
std::shared_ptr<MediaSinkInterface> makeRecorder(MediaSource &sender, Recorder::type type);
|
std::shared_ptr<MediaSinkInterface> makeRecorder(MediaSource &sender, Recorder::type type);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -553,8 +553,8 @@ extern const std::string kPSPT;
|
|||||||
// rtp server opus 的pt [AUTO-TRANSLATED:9f91f85a]
|
// rtp server opus 的pt [AUTO-TRANSLATED:9f91f85a]
|
||||||
// Rtp server opus pt
|
// Rtp server opus pt
|
||||||
extern const std::string kOpusPT;
|
extern const std::string kOpusPT;
|
||||||
// RtpSender相关功能是否提前开启gop缓存优化级联秒开体验,默认开启 [AUTO-TRANSLATED:40c37c77]
|
// startSendRtp、startRecord相关功能是否提前开启gop缓存优化级联秒开体验,默认开启, 并缓存1个GOP [AUTO-TRANSLATED:40c37c77]
|
||||||
// Whether to enable gop cache optimization cascade second-open experience for RtpSender related functions, enabled by default
|
// Whether to enable gop cache optimization cascade second-open experience for startSendRtp/startRecord related functions, enabled by default, and cached 1 GOP
|
||||||
extern const std::string kGopCache;
|
extern const std::string kGopCache;
|
||||||
// 国标发送g711 rtp 打包时,每个包的语音时长是多少,默认是100 ms,范围为20~180ms (gb28181-2016,c.2.4规定), [AUTO-TRANSLATED:3b3916a3]
|
// 国标发送g711 rtp 打包时,每个包的语音时长是多少,默认是100 ms,范围为20~180ms (gb28181-2016,c.2.4规定), [AUTO-TRANSLATED:3b3916a3]
|
||||||
// When sending g711 rtp packets in national standard, what is the duration of each packet, the default is 100 ms, the range is 20~180ms (gb28181-2016, c.2.4),
|
// When sending g711 rtp packets in national standard, what is the duration of each packet, the default is 100 ms, the range is 20~180ms (gb28181-2016, c.2.4),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user