mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 11:41:44 +08:00
openRtpServer接口新增only_audio参数,优化语音对讲场景
This commit is contained in:
@@ -187,6 +187,10 @@ void RtpProcess::setStopCheckRtp(bool is_check){
|
||||
}
|
||||
}
|
||||
|
||||
void RtpProcess::setOnlyAudio(bool only_audio){
|
||||
_only_audio = only_audio;
|
||||
}
|
||||
|
||||
void RtpProcess::onDetach() {
|
||||
if (_on_detach) {
|
||||
_on_detach();
|
||||
@@ -247,6 +251,9 @@ void RtpProcess::emitOnPublish() {
|
||||
strong_self->_media_info._app,
|
||||
strong_self->_media_info._streamid,0.0f,
|
||||
option);
|
||||
if (strong_self->_only_audio) {
|
||||
strong_self->_muxer->setOnlyAudio();
|
||||
}
|
||||
strong_self->_muxer->setMediaListener(strong_self);
|
||||
strong_self->doCachedFunc();
|
||||
InfoP(strong_self) << "允许RTP推流";
|
||||
|
||||
Reference in New Issue
Block a user