mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 04:08:57 +08:00
startSendRtp接口支持指定接收流的app和vhost参数 (#3841)
This commit is contained in:
parent
cb1821cf88
commit
bd40c24745
@ -1404,6 +1404,9 @@ void installWebApi() {
|
|||||||
args.udp_rtcp_timeout = allArgs["udp_rtcp_timeout"];
|
args.udp_rtcp_timeout = allArgs["udp_rtcp_timeout"];
|
||||||
args.recv_stream_id = allArgs["recv_stream_id"];
|
args.recv_stream_id = allArgs["recv_stream_id"];
|
||||||
args.close_delay_ms = allArgs["close_delay_ms"];
|
args.close_delay_ms = allArgs["close_delay_ms"];
|
||||||
|
// 记录发送流的app和vhost
|
||||||
|
args.recv_stream_app = allArgs["app"];
|
||||||
|
args.recv_stream_app = allArgs["vhost"];
|
||||||
src->getOwnerPoller()->async([=]() mutable {
|
src->getOwnerPoller()->async([=]() mutable {
|
||||||
try {
|
try {
|
||||||
src->startSendRtp(args, [val, headerOut, invoker](uint16_t local_port, const SockException &ex) mutable {
|
src->startSendRtp(args, [val, headerOut, invoker](uint16_t local_port, const SockException &ex) mutable {
|
||||||
|
@ -140,6 +140,9 @@ public:
|
|||||||
|
|
||||||
// 发送rtp同时接收,一般用于双向语言对讲, 如果不为空,说明开启接收
|
// 发送rtp同时接收,一般用于双向语言对讲, 如果不为空,说明开启接收
|
||||||
std::string recv_stream_id;
|
std::string recv_stream_id;
|
||||||
|
|
||||||
|
std::string recv_stream_app;
|
||||||
|
std::string recv_stream_vhost;
|
||||||
};
|
};
|
||||||
|
|
||||||
// 开始发送ps-rtp
|
// 开始发送ps-rtp
|
||||||
|
@ -239,6 +239,9 @@ void RtpSender::onConnect() {
|
|||||||
if (!_args.recv_stream_id.empty()) {
|
if (!_args.recv_stream_id.empty()) {
|
||||||
mINI ini;
|
mINI ini;
|
||||||
ini[RtpSession::kStreamID] = _args.recv_stream_id;
|
ini[RtpSession::kStreamID] = _args.recv_stream_id;
|
||||||
|
// 强制同步接收流和发送流的app和vhost
|
||||||
|
ini[RtpSession::kApp] = _args.recv_stream_app;
|
||||||
|
ini[RtpSession::kVhost] = _args.recv_stream_vhost;
|
||||||
_rtp_session = std::make_shared<RtpSession>(_socket_rtp);
|
_rtp_session = std::make_shared<RtpSession>(_socket_rtp);
|
||||||
_rtp_session->setParams(ini);
|
_rtp_session->setParams(ini);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user