mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 20:27:34 +08:00
Fixed issue that set use_ps in startSendRtp api does not take effect (#3353)
修复使用startSendRtp接口转发ps流,设置use_ps为1后,还发送es流的问题 --------- Co-authored-by: huangcaichun <cchuang@secusoft.cc>
This commit is contained in:
parent
fe61b572e0
commit
78a6f041a8
@ -1299,9 +1299,10 @@ void installWebApi() {
|
||||
if (!src) {
|
||||
throw ApiRetException("can not find the source stream", API::NotFound);
|
||||
}
|
||||
auto type = allArgs["type"].as<int>();
|
||||
if (!allArgs["use_ps"].empty()) {
|
||||
// 兼容之前的use_ps参数
|
||||
allArgs["type"] = allArgs["use_ps"].as<int>();
|
||||
type = allArgs["use_ps"].as<int>();
|
||||
}
|
||||
MediaSourceEvent::SendRtpArgs args;
|
||||
args.passive = false;
|
||||
@ -1312,11 +1313,11 @@ void installWebApi() {
|
||||
args.is_udp = allArgs["is_udp"];
|
||||
args.src_port = allArgs["src_port"];
|
||||
args.pt = allArgs["pt"].empty() ? 96 : allArgs["pt"].as<int>();
|
||||
args.type = (MediaSourceEvent::SendRtpArgs::Type)(allArgs["type"].as<int>());
|
||||
args.type = (MediaSourceEvent::SendRtpArgs::Type)type;
|
||||
args.only_audio = allArgs["only_audio"].as<bool>();
|
||||
args.udp_rtcp_timeout = allArgs["udp_rtcp_timeout"];
|
||||
args.recv_stream_id = allArgs["recv_stream_id"];
|
||||
TraceL << "startSendRtp, pt " << int(args.pt) << " rtp type " << args.type << " audio " << args.only_audio;
|
||||
TraceL << "startSendRtp, pt " << int(args.pt) << " rtp type " << type << " audio " << args.only_audio;
|
||||
|
||||
src->getOwnerPoller()->async([=]() mutable {
|
||||
src->startSendRtp(args, [val, headerOut, invoker](uint16_t local_port, const SockException &ex) mutable {
|
||||
@ -1338,10 +1339,10 @@ void installWebApi() {
|
||||
if (!src) {
|
||||
throw ApiRetException("can not find the source stream", API::NotFound);
|
||||
}
|
||||
|
||||
auto type = allArgs["type"].as<int>();
|
||||
if (!allArgs["use_ps"].empty()) {
|
||||
// 兼容之前的use_ps参数
|
||||
allArgs["type"] = allArgs["use_ps"].as<int>();
|
||||
type = allArgs["use_ps"].as<int>();
|
||||
}
|
||||
|
||||
MediaSourceEvent::SendRtpArgs args;
|
||||
@ -1350,12 +1351,12 @@ void installWebApi() {
|
||||
args.is_udp = false;
|
||||
args.src_port = allArgs["src_port"];
|
||||
args.pt = allArgs["pt"].empty() ? 96 : allArgs["pt"].as<int>();
|
||||
args.type = (MediaSourceEvent::SendRtpArgs::Type)(allArgs["type"].as<int>());
|
||||
args.type = (MediaSourceEvent::SendRtpArgs::Type)type;
|
||||
args.only_audio = allArgs["only_audio"].as<bool>();
|
||||
args.recv_stream_id = allArgs["recv_stream_id"];
|
||||
//tcp被动服务器等待链接超时时间
|
||||
args.tcp_passive_close_delay_ms = allArgs["close_delay_ms"];
|
||||
TraceL << "startSendRtpPassive, pt " << int(args.pt) << " rtp type " << args.type << " audio " << args.only_audio;
|
||||
TraceL << "startSendRtpPassive, pt " << int(args.pt) << " rtp type " << type << " audio " << args.only_audio;
|
||||
|
||||
src->getOwnerPoller()->async([=]() mutable {
|
||||
src->startSendRtp(args, [val, headerOut, invoker](uint16_t local_port, const SockException &ex) mutable {
|
||||
|
Loading…
Reference in New Issue
Block a user