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

Producer/Consumer: ignore RequestFullFrame() if paused.

上级 21eb34d3
......@@ -42,11 +42,11 @@ namespace RTC
void Resume();
void SourcePause();
void SourceResume();
void SourceRtpParametersUpdated();
void Disable();
bool IsEnabled() const;
const RTC::RtpParameters& GetParameters() const;
bool IsPaused() const;
void SourceRtpParametersUpdated();
void SendRtpPacket(RTC::RtpPacket* packet);
void GetRtcp(RTC::RTCP::CompoundPacket* packet, uint64_t now);
void ReceiveNack(RTC::RTCP::FeedbackRtpNackPacket* nackPacket);
......@@ -112,11 +112,6 @@ namespace RTC
return this->paused || this->sourcePaused;
}
inline void Consumer::SourceRtpParametersUpdated()
{
// TODO: Set special flag to be ready for random seq numbers.
}
inline uint32_t Consumer::GetTransmissionRate(uint64_t now)
{
return this->transmittedCounter.GetRate(now) + this->retransmittedCounter.GetRate(now);
......
......@@ -191,6 +191,11 @@ namespace RTC
}
}
void Consumer::SourceRtpParametersUpdated()
{
// TODO: Set special flag to be ready for random seq numbers.
}
/**
* Called when the Transport assigned to this Consumer has been closed, so this
* Consumer becomes unhandled.
......@@ -331,7 +336,7 @@ namespace RTC
if (!IsEnabled())
return;
if (this->kind == RTC::Media::Kind::AUDIO)
if (this->kind == RTC::Media::Kind::AUDIO || IsPaused())
return;
for (auto& listener : this->listeners)
......
......@@ -184,12 +184,16 @@ namespace RTC
this->ssrcMapping[newEncoding.ssrc] = outputEncoding.ssrc;
}
if (outputEncoding.hasRtx && newEncoding.hasRtx && outputEncoding.rtx.ssrc != newEncoding.rtx.ssrc)
if (
outputEncoding.hasRtx && newEncoding.hasRtx &&
outputEncoding.rtx.ssrc != newEncoding.rtx.ssrc)
{
this->ssrcMapping[newEncoding.rtx.ssrc] = outputEncoding.rtx.ssrc;
}
if (outputEncoding.hasFec && newEncoding.hasFec && outputEncoding.fec.ssrc != newEncoding.fec.ssrc)
if (
outputEncoding.hasFec && newEncoding.hasFec &&
outputEncoding.fec.ssrc != newEncoding.fec.ssrc)
{
this->ssrcMapping[newEncoding.fec.ssrc] = outputEncoding.fec.ssrc;
}
......@@ -402,7 +406,7 @@ namespace RTC
{
MS_TRACE();
if (this->kind == RTC::Media::Kind::AUDIO)
if (this->kind == RTC::Media::Kind::AUDIO || this->paused)
return;
if (force)
......@@ -564,8 +568,8 @@ namespace RTC
{
MS_TRACE();
auto& codecPayloadTypeMap = this->rtpMapping.codecPayloadTypes;
auto payloadType = packet->GetPayloadType();
auto& codecPayloadTypeMap = this->rtpMapping.codecPayloadTypes;
auto payloadType = packet->GetPayloadType();
if (codecPayloadTypeMap.find(payloadType) != codecPayloadTypeMap.end())
{
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论