mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-16 13:05:59 +08:00
openRtpServer接口新增only_audio参数,优化语音对讲场景
This commit is contained in:
@@ -22,6 +22,7 @@ namespace mediakit{
|
||||
|
||||
const string RtpSession::kStreamID = "stream_id";
|
||||
const string RtpSession::kSSRC = "ssrc";
|
||||
const string RtpSession::kOnlyAudio = "only_audio";
|
||||
|
||||
void RtpSession::attachServer(const Server &server) {
|
||||
setParams(const_cast<Server &>(server));
|
||||
@@ -30,6 +31,7 @@ void RtpSession::attachServer(const Server &server) {
|
||||
void RtpSession::setParams(mINI &ini) {
|
||||
_stream_id = ini[kStreamID];
|
||||
_ssrc = ini[kSSRC];
|
||||
_only_audio = ini[kOnlyAudio];
|
||||
}
|
||||
|
||||
RtpSession::RtpSession(const Socket::Ptr &sock) : Session(sock) {
|
||||
@@ -101,6 +103,7 @@ void RtpSession::onRtpPacket(const char *data, size_t len) {
|
||||
}
|
||||
//tcp情况下,一个tcp链接只可能是一路流,不需要通过多个ssrc来区分,所以不需要频繁getProcess
|
||||
_process = RtpSelector::Instance().getProcess(_stream_id, true);
|
||||
_process->setOnlyAudio(_only_audio);
|
||||
_process->setDelegate(dynamic_pointer_cast<RtpSession>(shared_from_this()));
|
||||
}
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user