mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 19:51:49 +08:00
add RtspMediaSource::Clone
This commit is contained in:
@@ -10,13 +10,14 @@
|
||||
|
||||
#include "WebRtcPusher.h"
|
||||
#include "Common/config.h"
|
||||
#include "Rtsp/RtspMediaSourceImp.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
WebRtcPusher::Ptr WebRtcPusher::create(const EventPoller::Ptr &poller,
|
||||
const RtspMediaSourceImp::Ptr &src,
|
||||
const RtspMediaSource::Ptr &src,
|
||||
const std::shared_ptr<void> &ownership,
|
||||
const MediaInfo &info,
|
||||
const ProtocolOption &option,
|
||||
@@ -30,7 +31,7 @@ WebRtcPusher::Ptr WebRtcPusher::create(const EventPoller::Ptr &poller,
|
||||
}
|
||||
|
||||
WebRtcPusher::WebRtcPusher(const EventPoller::Ptr &poller,
|
||||
const RtspMediaSourceImp::Ptr &src,
|
||||
const RtspMediaSource::Ptr &src,
|
||||
const std::shared_ptr<void> &ownership,
|
||||
const MediaInfo &info,
|
||||
const ProtocolOption &option,
|
||||
@@ -98,10 +99,8 @@ void WebRtcPusher::onRecvRtp(MediaTrack &track, const string &rid, RtpPacket::Pt
|
||||
auto &src = _push_src_sim[rid];
|
||||
if (!src) {
|
||||
auto stream_id = rid.empty() ? _push_src->getId() : _push_src->getId() + "_" + rid;
|
||||
auto src_imp = std::make_shared<RtspMediaSourceImp>(_push_src->getVhost(), _push_src->getApp(), stream_id);
|
||||
auto src_imp = _push_src->Clone(stream_id);
|
||||
_push_src_sim_ownership[rid] = src_imp->getOwnership();
|
||||
src_imp->setSdp(_push_src->getSdp());
|
||||
src_imp->setProtocolOption(_push_src->getProtocolOption());
|
||||
src_imp->setListener(static_pointer_cast<WebRtcPusher>(shared_from_this()));
|
||||
src = src_imp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user