提交 a13a42f5 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

stuff

上级 c851985a
# BUGS
* When a Consumer is paused and then resumed, Router calls to Producer::RequestFullFrame(), the browser does receive receive a PLI, but the Consumer does not see the video.
# TODO in mediasoup v2 (server-side) # TODO in mediasoup v2 (server-side)
* When a video Consumer is paused and later resumed, it requests a Full Frame to the Producer. The sending browser does receive the PLI and (obviously) sends a full frame. The problem is that the `RtpStreamSend` of the Consumer ignores that full frame due to "bad sequence number":
```
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- paused !!! +2ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- paused !!! +1ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- paused !!! +0ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::HandleRequest() | ---- CONSUMER REQUESTING FULL FRAME ---- +0ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::HandleRequest() | ---- CONSUMER REQUESTING FULL FRAME ---- +0ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- ok go go RTP :) +18ms
mediasoup:WARN:mediasoup-worker [id:vdcuccoq#1] RTC::RtpStream::UpdateSeq() | bad sequence number, ignoring packet [ssrc:1945391646, seq:13041] +19s
mediasoup:WARN:mediasoup-worker [id:vdcuccoq#1] RTC::RtpStream::ReceivePacket() | invalid packet [ssrc:1945391646, seq:13041] +0ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- ok go go RTP :) +1ms
mediasoup:WARN:mediasoup-worker [id:vdcuccoq#1] RTC::RtpStream::UpdateSeq() | too bad sequence number, re-syncing RTP [ssrc:1945391646, seq:13042] +1ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- ok go go RTP :) +11ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- ok go go RTP :) +1ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- ok go go RTP :) +0ms
mediasoup:ERROR:mediasoup-worker [id:vdcuccoq#1] RTC::Consumer::SendRtpPacket() | ---- ok go go RTP :) +0ms
```
In fact, if the `RtpStreamSend` does not return false, the video automatically works, so we must refactor the `RtpStream::UpdateSeq()` method.
* Add a `fullFrrameRequestBlockTimer` and a `isFullFrameRequested` flag in `Producer`, so `Producer::RequestFullFrame()` check it and decides whether ask for a full frame to its streams or not. * Add a `fullFrrameRequestBlockTimer` and a `isFullFrameRequested` flag in `Producer`, so `Producer::RequestFullFrame()` check it and decides whether ask for a full frame to its streams or not.
* If a worker Consumer is paused (or sourcePaused), should the RTCP checks or report generations behave differently? * If a worker Consumer is paused (or sourcePaused), should the RTCP checks or report generations behave differently?
......
...@@ -41,6 +41,7 @@ namespace RTC ...@@ -41,6 +41,7 @@ namespace RTC
void AddListener(RTC::ConsumerListener* listener); void AddListener(RTC::ConsumerListener* listener);
void RemoveListener(RTC::ConsumerListener* listener); void RemoveListener(RTC::ConsumerListener* listener);
const RTC::RtpParameters& GetParameters() const; const RTC::RtpParameters& GetParameters() const;
bool IsPaused() const;
void SetSourcePaused(); void SetSourcePaused();
void SetSourceResumed(); void SetSourceResumed();
void SendRtpPacket(RTC::RtpPacket* packet); void SendRtpPacket(RTC::RtpPacket* packet);
...@@ -98,6 +99,11 @@ namespace RTC ...@@ -98,6 +99,11 @@ namespace RTC
return this->rtpParameters; return this->rtpParameters;
} }
inline bool Consumer::IsPaused() const
{
return this->paused || this->sourcePaused;
}
inline void Consumer::SetSourcePaused() inline void Consumer::SetSourcePaused()
{ {
if (this->sourcePaused) if (this->sourcePaused)
......
...@@ -130,13 +130,13 @@ namespace RTC ...@@ -130,13 +130,13 @@ namespace RTC
case Channel::Request::MethodId::CONSUMER_RESUME: case Channel::Request::MethodId::CONSUMER_RESUME:
{ {
bool wasPaused = this->paused; bool wasPaused = IsPaused();
this->paused = false; this->paused = false;
request->Accept(); request->Accept();
if (wasPaused) if (wasPaused && !IsPaused())
{ {
for (auto& listener : this->listeners) for (auto& listener : this->listeners)
{ {
...@@ -161,7 +161,7 @@ namespace RTC ...@@ -161,7 +161,7 @@ namespace RTC
MS_TRACE(); MS_TRACE();
// If paused don't forward RTP. // If paused don't forward RTP.
if (this->paused || this->sourcePaused) if (IsPaused())
return; return;
// Ignore the packet if the SSRC is not the single one in the sender // Ignore the packet if the SSRC is not the single one in the sender
......
...@@ -161,6 +161,8 @@ namespace RTC ...@@ -161,6 +161,8 @@ namespace RTC
this->badSeq = (seq + 1) & (RtpSeqMod - 1); this->badSeq = (seq + 1) & (RtpSeqMod - 1);
// TODO: This avois a full frame to pass when the Consumer was paused and later
// resumed. No. Period. We should allow the packet (return true here).
return false; return false;
} }
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论