mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-25 20:27:34 +08:00
rtc stop push unregister mediasource
This commit is contained in:
parent
6ca736f88a
commit
7f86299c80
@ -150,4 +150,15 @@ void WebRtcPusher::onRtcConfigure(RtcConfigure &configure) const {
|
||||
|
||||
float WebRtcPusher::getLossRate(MediaSource &sender,mediakit::TrackType type){
|
||||
return WebRtcTransportImp::getLossRate(type);
|
||||
}
|
||||
|
||||
void WebRtcPusher::OnDtlsTransportClosed(const RTC::DtlsTransport *dtlsTransport) {
|
||||
//主动关闭推流,那么不等待重推
|
||||
_push_src = nullptr;
|
||||
WebRtcTransportImp::OnDtlsTransportClosed(dtlsTransport);
|
||||
}
|
||||
|
||||
void WebRtcPusher::onRtcpBye(){
|
||||
_push_src = nullptr;
|
||||
WebRtcTransportImp::onRtcpBye();
|
||||
}
|
@ -26,6 +26,9 @@ protected:
|
||||
void onDestory() override;
|
||||
void onRtcConfigure(RtcConfigure &configure) const override;
|
||||
void onRecvRtp(MediaTrack &track, const std::string &rid, mediakit::RtpPacket::Ptr rtp) override;
|
||||
void onRtcpBye() override;
|
||||
//// dtls相关的回调 ////
|
||||
void OnDtlsTransportClosed(const RTC::DtlsTransport *dtlsTransport) override;
|
||||
|
||||
protected:
|
||||
///////MediaSourceEvent override///////
|
||||
|
@ -766,6 +766,7 @@ void WebRtcTransportImp::onRtcp(const char *buf, size_t len) {
|
||||
}
|
||||
_ssrc_to_track.erase(it);
|
||||
}
|
||||
onRtcpBye();
|
||||
onShutdown(SockException(Err_eof, "rtcp bye message received"));
|
||||
break;
|
||||
}
|
||||
@ -1051,6 +1052,8 @@ uint64_t WebRtcTransportImp::getDuration() const {
|
||||
return _alive_ticker.createdTime() / 1000;
|
||||
}
|
||||
|
||||
void WebRtcTransportImp::onRtcpBye(){}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void WebRtcTransportImp::registerSelf() {
|
||||
|
@ -154,6 +154,7 @@ protected:
|
||||
virtual void onShutdown(const SockException &ex) = 0;
|
||||
virtual void onBeforeEncryptRtp(const char *buf, int &len, void *ctx) = 0;
|
||||
virtual void onBeforeEncryptRtcp(const char *buf, int &len, void *ctx) = 0;
|
||||
virtual void onRtcpBye() = 0;
|
||||
|
||||
protected:
|
||||
RTC::TransportTuple* getSelectedTuple() const;
|
||||
@ -264,6 +265,7 @@ protected:
|
||||
virtual void onRecvRtp(MediaTrack &track, const std::string &rid, mediakit::RtpPacket::Ptr rtp) = 0;
|
||||
void updateTicker();
|
||||
float getLossRate(mediakit::TrackType type);
|
||||
void onRtcpBye() override;
|
||||
|
||||
private:
|
||||
void onSortedRtp(MediaTrack &track, const std::string &rid, mediakit::RtpPacket::Ptr rtp);
|
||||
|
Loading…
Reference in New Issue
Block a user