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

Make clang-tidy happy.

上级 1556740d
...@@ -34,7 +34,7 @@ namespace RTC ...@@ -34,7 +34,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
if (this->rtpStream) if (this->rtpStream != nullptr)
delete this->rtpStream; delete this->rtpStream;
} }
...@@ -73,10 +73,10 @@ namespace RTC ...@@ -73,10 +73,10 @@ namespace RTC
json[JsonStringSourceProducerId] = Json::UInt{ this->sourceProducerId }; json[JsonStringSourceProducerId] = Json::UInt{ this->sourceProducerId };
if (this->transport) if (this->transport != nullptr)
json[JsonStringRtpParameters] = this->rtpParameters.ToJson(); json[JsonStringRtpParameters] = this->rtpParameters.ToJson();
if (this->rtpStream) if (this->rtpStream != nullptr)
json[JsonStringRtpStream] = this->rtpStream->ToJson(); json[JsonStringRtpStream] = this->rtpStream->ToJson();
json[JsonStringPaused] = this->paused; json[JsonStringPaused] = this->paused;
...@@ -175,7 +175,7 @@ namespace RTC ...@@ -175,7 +175,7 @@ namespace RTC
this->supportedCodecPayloadTypes.clear(); this->supportedCodecPayloadTypes.clear();
if (this->rtpStream) if (this->rtpStream != nullptr)
{ {
delete this->rtpStream; delete this->rtpStream;
this->rtpStream = nullptr; this->rtpStream = nullptr;
...@@ -380,9 +380,9 @@ namespace RTC ...@@ -380,9 +380,9 @@ namespace RTC
if (this->rtpStream->HasRtx()) if (this->rtpStream->HasRtx())
{ {
static uint8_t RtxBuffer[MtuSize]; static uint8_t rtxBuffer[MtuSize];
rtxPacket = packet->Clone(RtxBuffer); rtxPacket = packet->Clone(rtxBuffer);
this->rtpStream->RtxEncode(rtxPacket); this->rtpStream->RtxEncode(rtxPacket);
MS_DEBUG_TAG( MS_DEBUG_TAG(
......
...@@ -111,10 +111,10 @@ namespace RTC ...@@ -111,10 +111,10 @@ namespace RTC
} }
json[JsonStringRtpStreams] = jsonRtpStreams; json[JsonStringRtpStreams] = jsonRtpStreams;
if (this->knownHeaderExtensions.ssrcAudioLevelId) if (this->knownHeaderExtensions.ssrcAudioLevelId != 0u)
json[JsonStringSsrcAudioLevelId] = this->knownHeaderExtensions.ssrcAudioLevelId; json[JsonStringSsrcAudioLevelId] = this->knownHeaderExtensions.ssrcAudioLevelId;
if (this->knownHeaderExtensions.absSendTimeId) if (this->knownHeaderExtensions.absSendTimeId != 0u)
json[JsonStringAbsSendTimeId] = this->knownHeaderExtensions.absSendTimeId; json[JsonStringAbsSendTimeId] = this->knownHeaderExtensions.absSendTimeId;
json[JsonStringPaused] = this->paused; json[JsonStringPaused] = this->paused;
...@@ -526,13 +526,13 @@ namespace RTC ...@@ -526,13 +526,13 @@ namespace RTC
packet->MangleExtensionHeaderIds(headerExtensionIdMap); packet->MangleExtensionHeaderIds(headerExtensionIdMap);
if (this->knownHeaderExtensions.ssrcAudioLevelId) if (this->knownHeaderExtensions.ssrcAudioLevelId != 0u)
{ {
packet->AddExtensionMapping( packet->AddExtensionMapping(
RtpHeaderExtensionUri::Type::SSRC_AUDIO_LEVEL, this->knownHeaderExtensions.ssrcAudioLevelId); RtpHeaderExtensionUri::Type::SSRC_AUDIO_LEVEL, this->knownHeaderExtensions.ssrcAudioLevelId);
} }
if (this->knownHeaderExtensions.absSendTimeId) if (this->knownHeaderExtensions.absSendTimeId != 0u)
{ {
packet->AddExtensionMapping( packet->AddExtensionMapping(
RtpHeaderExtensionUri::Type::ABS_SEND_TIME, this->knownHeaderExtensions.absSendTimeId); RtpHeaderExtensionUri::Type::ABS_SEND_TIME, this->knownHeaderExtensions.absSendTimeId);
......
...@@ -271,13 +271,13 @@ namespace RTC ...@@ -271,13 +271,13 @@ namespace RTC
return; return;
} }
else if (!request->data[JsonStringRtpParameters].isObject()) if (!request->data[JsonStringRtpParameters].isObject())
{ {
request->Reject("missing data.rtpParameters"); request->Reject("missing data.rtpParameters");
return; return;
} }
else if (!request->data[JsonStringRtpMapping].isObject()) if (!request->data[JsonStringRtpMapping].isObject())
{ {
request->Reject("missing data.rtpMapping"); request->Reject("missing data.rtpMapping");
...@@ -844,9 +844,6 @@ namespace RTC ...@@ -844,9 +844,6 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
// TODO: How to tell all the Producers/Consumers using this Transport.
// Probably using multiple listeners (or not).
this->transports.erase(transport->transportId); this->transports.erase(transport->transportId);
} }
...@@ -854,8 +851,6 @@ namespace RTC ...@@ -854,8 +851,6 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
// TODO: How to tell the Transport using this Producer.
this->producers.erase(producer->producerId); this->producers.erase(producer->producerId);
// Remove the Producer from the map. // Remove the Producer from the map.
......
...@@ -35,7 +35,7 @@ namespace RTC ...@@ -35,7 +35,7 @@ namespace RTC
auto& jsonCodecs = data[JsonStringCodecs]; auto& jsonCodecs = data[JsonStringCodecs];
if (jsonCodecs.size() == 0) if (jsonCodecs.empty())
MS_THROW_ERROR("empty rtpParameters.codecs"); MS_THROW_ERROR("empty rtpParameters.codecs");
for (auto& jsonCodec : jsonCodecs) for (auto& jsonCodec : jsonCodecs)
...@@ -52,7 +52,7 @@ namespace RTC ...@@ -52,7 +52,7 @@ namespace RTC
auto& jsonEncodings = data[JsonStringEncodings]; auto& jsonEncodings = data[JsonStringEncodings];
if (jsonEncodings.size() == 0) if (jsonEncodings.empty())
MS_THROW_ERROR("empty rtpParameters.encodings"); MS_THROW_ERROR("empty rtpParameters.encodings");
for (auto& i : jsonEncodings) for (auto& i : jsonEncodings)
...@@ -174,7 +174,7 @@ namespace RTC ...@@ -174,7 +174,7 @@ namespace RTC
{ {
MS_TRACE(); MS_TRACE();
static const std::string associatedPayloadType = "apt"; static const std::string AssociatedPayloadType = "apt";
static RTC::RtpCodecParameters fakeCodec; static RTC::RtpCodecParameters fakeCodec;
uint8_t payloadType = encoding.codecPayloadType; uint8_t payloadType = encoding.codecPayloadType;
...@@ -184,7 +184,7 @@ namespace RTC ...@@ -184,7 +184,7 @@ namespace RTC
{ {
auto& codec = *it; auto& codec = *it;
if (codec.mime.IsFeatureCodec() && codec.parameters.GetInteger(associatedPayloadType) == payloadType) if (codec.mime.IsFeatureCodec() && codec.parameters.GetInteger(AssociatedPayloadType) == payloadType)
{ {
return codec; return codec;
} }
......
...@@ -199,7 +199,7 @@ namespace RTC ...@@ -199,7 +199,7 @@ namespace RTC
MS_DUMP(" timestamp : %" PRIu32, GetTimestamp()); MS_DUMP(" timestamp : %" PRIu32, GetTimestamp());
MS_DUMP(" ssrc : %" PRIu32, GetSsrc()); MS_DUMP(" ssrc : %" PRIu32, GetSsrc());
MS_DUMP(" payload size : %zu bytes", GetPayloadLength()); MS_DUMP(" payload size : %zu bytes", GetPayloadLength());
if (this->header->padding) if (this->header->padding != 0u)
{ {
MS_DUMP(" padding size : %" PRIu8 " bytes", this->payloadPadding); MS_DUMP(" padding size : %" PRIu8 " bytes", this->payloadPadding);
} }
......
...@@ -318,7 +318,7 @@ namespace RTC ...@@ -318,7 +318,7 @@ namespace RTC
// By setting started to 0, on next packet the RtpStream will call // By setting started to 0, on next packet the RtpStream will call
// InitSeq(seq). // InitSeq(seq).
this->started = 0; this->started = false;
// Also reset RtpStreamSend own members. // Also reset RtpStreamSend own members.
this->receivedBytes = 0; this->receivedBytes = 0;
......
...@@ -462,7 +462,7 @@ namespace RTC ...@@ -462,7 +462,7 @@ namespace RTC
return; return;
} }
else if ( if (
!jsonFingerprint[JsonStringAlgorithm].isString() || !jsonFingerprint[JsonStringAlgorithm].isString() ||
!jsonFingerprint[JsonStringValue].isString()) !jsonFingerprint[JsonStringValue].isString())
{ {
...@@ -775,7 +775,7 @@ namespace RTC ...@@ -775,7 +775,7 @@ namespace RTC
auto& report = (*it); auto& report = (*it);
auto* consumer = GetConsumer(report->GetSsrc()); auto* consumer = GetConsumer(report->GetSsrc());
if (consumer) if (consumer != nullptr)
{ {
consumer->ReceiveRtcpReceiverReport(report); consumer->ReceiveRtcpReceiverReport(report);
} }
...@@ -1409,17 +1409,17 @@ namespace RTC ...@@ -1409,17 +1409,17 @@ namespace RTC
this->rtpListener.RemoveProducer(producer); this->rtpListener.RemoveProducer(producer);
} }
void Transport::OnProducerPaused(RTC::Producer* producer) void Transport::OnProducerPaused(RTC::Producer* /*producer*/)
{ {
// Do nothing. // Do nothing.
} }
void Transport::OnProducerResumed(RTC::Producer* producer) void Transport::OnProducerResumed(RTC::Producer* /*producer*/)
{ {
// Do nothing. // Do nothing.
} }
void Transport::OnProducerRtpPacket(RTC::Producer* producer, RTC::RtpPacket* packet) void Transport::OnProducerRtpPacket(RTC::Producer* /*producer*/, RTC::RtpPacket* /*packet*/)
{ {
// Do nothing. // Do nothing.
} }
...@@ -1432,7 +1432,7 @@ namespace RTC ...@@ -1432,7 +1432,7 @@ namespace RTC
this->consumers.erase(consumer); this->consumers.erase(consumer);
} }
void Transport::OnConsumerFullFrameRequired(RTC::Consumer* consumer) void Transport::OnConsumerFullFrameRequired(RTC::Consumer* /*consumer*/)
{ {
// Do nothing. // Do nothing.
} }
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论