[rtp_rtcp] fixed lint errors in rtp_rtcp module that are not fixed in other CLs

BUG=webrtc:5277
R=mflodman

Review URL: https://codereview.webrtc.org/1513303003

Cr-Commit-Position: refs/heads/master@{#11025}
This commit is contained in:
danilchap 2015-12-15 02:54:47 -08:00 committed by Commit bot
parent 9638143033
commit 6db6cdc604
22 changed files with 67 additions and 56 deletions

View File

@ -112,7 +112,10 @@ class MockRtpRtcp : public RtpRtcp {
MOCK_CONST_METHOD0(SendingMedia,
bool());
MOCK_CONST_METHOD4(BitrateSent,
void(uint32_t* totalRate, uint32_t* videoRate, uint32_t* fecRate, uint32_t* nackRate));
void(uint32_t* totalRate,
uint32_t* videoRate,
uint32_t* fecRate,
uint32_t* nackRate));
MOCK_METHOD1(RegisterVideoBitrateObserver, void(BitrateStatisticsObserver*));
MOCK_CONST_METHOD0(GetVideoBitrateObserver, BitrateStatisticsObserver*(void));
MOCK_CONST_METHOD1(EstimatedReceiveBandwidth,
@ -176,7 +179,10 @@ class MockRtpRtcp : public RtpRtcp {
MOCK_CONST_METHOD1(RemoteRTCPStat,
int32_t(std::vector<RTCPReportBlock>* receiveBlocks));
MOCK_METHOD4(SetRTCPApplicationSpecificData,
int32_t(const uint8_t subType, const uint32_t name, const uint8_t* data, const uint16_t length));
int32_t(const uint8_t subType,
const uint32_t name,
const uint8_t* data,
const uint16_t length));
MOCK_METHOD1(SetRTCPVoIPMetrics,
int32_t(const RTCPVoIPMetric* VoIPMetric));
MOCK_METHOD1(SetRtcpXrRrtrStatus,
@ -221,8 +227,6 @@ class MockRtpRtcp : public RtpRtcp {
MOCK_CONST_METHOD1(SendREDPayloadType, int32_t(int8_t* payloadType));
MOCK_METHOD2(SetRTPAudioLevelIndicationStatus,
int32_t(const bool enable, const uint8_t ID));
MOCK_CONST_METHOD2(GetRTPAudioLevelIndicationStatus,
int32_t(bool& enable, uint8_t& ID));
MOCK_METHOD1(SetAudioLevel,
int32_t(const uint8_t level_dBov));
MOCK_METHOD1(SetTargetSendBitrate,
@ -242,8 +246,6 @@ class MockRtpRtcp : public RtpRtcp {
int32_t(const KeyFrameRequestMethod method));
MOCK_METHOD0(RequestKeyFrame,
int32_t());
MOCK_CONST_METHOD3(Version,
int32_t(char* version, uint32_t& remaining_buffer_in_bytes, uint32_t& position));
MOCK_METHOD0(TimeUntilNextProcess,
int64_t());
MOCK_METHOD0(Process,

View File

@ -0,0 +1,8 @@
#tmmbr_help is refactored in CL#1474693002
exclude_files=tmmbr_help.*
#rtp_utility is refactored in CL#1481773004
exclude_files=rtp_utility.*
#rtcp_utility planned to be removed when webrtc:5260 will be finished.
exclude_files=rtcp_utility.*
#rtcp_receiver/rtcp_receiver_help will be refactored more deeply as part of webrtc:5260
exclude_files=rtcp_receiver.*

View File

@ -25,7 +25,7 @@ class CriticalSectionWrapper;
class FecReceiverImpl : public FecReceiver {
public:
FecReceiverImpl(RtpData* callback);
explicit FecReceiverImpl(RtpData* callback);
virtual ~FecReceiverImpl();
int32_t AddReceivedRedPacket(const RTPHeader& rtp_header,

View File

@ -53,7 +53,7 @@ class VerifyingRtxReceiver : public NullRtpData {
class TestRtpFeedback : public NullRtpFeedback {
public:
TestRtpFeedback(RtpRtcp* rtp_rtcp) : rtp_rtcp_(rtp_rtcp) {}
explicit TestRtpFeedback(RtpRtcp* rtp_rtcp) : rtp_rtcp_(rtp_rtcp) {}
virtual ~TestRtpFeedback() {}
void OnIncomingSSRCChanged(const uint32_t ssrc) override {

View File

@ -26,7 +26,8 @@ namespace {
class TestTransport : public Transport {
public:
TestTransport(RTCPReceiver* rtcp_receiver) : rtcp_receiver_(rtcp_receiver) {}
explicit TestTransport(RTCPReceiver* rtcp_receiver)
: rtcp_receiver_(rtcp_receiver) {}
bool SendRtp(const uint8_t* /*data*/,
size_t /*len*/,

View File

@ -746,7 +746,7 @@ bool RTCPReceiver::UpdateRTCPReceiveInformationTimers() {
return updateBoundingSet;
}
int32_t RTCPReceiver::BoundingSet(bool &tmmbrOwner, TMMBRSet* boundingSetRec) {
int32_t RTCPReceiver::BoundingSet(bool* tmmbrOwner, TMMBRSet* boundingSetRec) {
CriticalSectionScoped lock(_criticalSectionRTCPReceiver);
std::map<uint32_t, RTCPReceiveInformation*>::iterator receiveInfoIt =
@ -766,7 +766,7 @@ int32_t RTCPReceiver::BoundingSet(bool &tmmbrOwner, TMMBRSet* boundingSetRec) {
i++) {
if(receiveInfo->TmmbnBoundingSet.Ssrc(i) == main_ssrc_) {
// owner of bounding set
tmmbrOwner = true;
*tmmbrOwner = true;
}
boundingSetRec->SetEntry(i,
receiveInfo->TmmbnBoundingSet.Tmmbr(i),

View File

@ -103,7 +103,7 @@ public:
bool UpdateRTCPReceiveInformationTimers();
int32_t BoundingSet(bool &tmmbrOwner, TMMBRSet* boundingSetRec);
int32_t BoundingSet(bool* tmmbrOwner, TMMBRSet* boundingSetRec);
int32_t UpdateTMMBR();

View File

@ -645,7 +645,7 @@ rtc::scoped_ptr<rtcp::RtcpPacket> RTCPSender::BuildTMMBR(
// will accuire criticalSectionRTCPReceiver_ is a potental deadlock but
// since RTCPreceiver is not doing the reverse we should be fine
int32_t lengthOfBoundingSet =
ctx.feedback_state_.module->BoundingSet(tmmbrOwner, candidateSet);
ctx.feedback_state_.module->BoundingSet(&tmmbrOwner, candidateSet);
if (lengthOfBoundingSet > 0) {
for (int32_t i = 0; i < lengthOfBoundingSet; i++) {
@ -1077,7 +1077,7 @@ bool RTCPSender::AllVolatileFlagsConsumed() const {
bool RTCPSender::SendFeedbackPacket(const rtcp::TransportFeedback& packet) {
class Sender : public rtcp::RtcpPacket::PacketReadyCallback {
public:
Sender(Transport* transport)
explicit Sender(Transport* transport)
: transport_(transport), send_failure_(false) {}
void OnPacketReady(uint8_t* data, size_t length) override {

View File

@ -28,7 +28,7 @@ const size_t kVideoRotationLength = 2;
const size_t kTransportSequenceNumberLength = 3;
struct HeaderExtension {
HeaderExtension(RTPExtensionType extension_type)
explicit HeaderExtension(RTPExtensionType extension_type)
: type(extension_type), length(0), active(true) {
Init();
}

View File

@ -29,7 +29,7 @@ static const size_t kMaxHistoryCapacity = 9600;
class RTPPacketHistory {
public:
RTPPacketHistory(Clock* clock);
explicit RTPPacketHistory(Clock* clock);
~RTPPacketHistory();
void SetStorePacketsStatus(bool enable, uint16_t number_to_store);

View File

@ -170,7 +170,7 @@ bool RtpReceiverImpl::IncomingRtpPacket(
int8_t first_payload_byte = payload_length > 0 ? payload[0] : 0;
bool is_red = false;
if (CheckPayloadChanged(rtp_header, first_payload_byte, is_red,
if (CheckPayloadChanged(rtp_header, first_payload_byte, &is_red,
&payload_specific) == -1) {
if (payload_length == 0) {
// OK, keep-alive packet.
@ -320,7 +320,7 @@ void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) {
// last known payload).
int32_t RtpReceiverImpl::CheckPayloadChanged(const RTPHeader& rtp_header,
const int8_t first_payload_byte,
bool& is_red,
bool* is_red,
PayloadUnion* specific_payload) {
bool re_initialize_decoder = false;
@ -338,7 +338,7 @@ int32_t RtpReceiverImpl::CheckPayloadChanged(const RTPHeader& rtp_header,
if (rtp_payload_registry_->red_payload_type() == payload_type) {
// Get the real codec payload type.
payload_type = first_payload_byte & 0x7f;
is_red = true;
*is_red = true;
if (rtp_payload_registry_->red_payload_type() == payload_type) {
// Invalid payload type, traced by caller. If we proceeded here,
@ -360,7 +360,7 @@ int32_t RtpReceiverImpl::CheckPayloadChanged(const RTPHeader& rtp_header,
&should_discard_changes);
if (should_discard_changes) {
is_red = false;
*is_red = false;
return 0;
}
@ -390,7 +390,7 @@ int32_t RtpReceiverImpl::CheckPayloadChanged(const RTPHeader& rtp_header,
}
} else {
rtp_media_receiver_->GetLastMediaSpecificPayload(specific_payload);
is_red = false;
*is_red = false;
}
} // End critsect.

View File

@ -71,7 +71,7 @@ class RtpReceiverImpl : public RtpReceiver {
void CheckCSRC(const WebRtcRTPHeader& rtp_header);
int32_t CheckPayloadChanged(const RTPHeader& rtp_header,
const int8_t first_payload_byte,
bool& is_red,
bool* is_red,
PayloadUnion* payload);
Clock* clock_;

View File

@ -95,7 +95,7 @@ class RTPReceiverStrategy {
// Note: Implementations may call the callback for other reasons than calls
// to ParseRtpPacket, for instance if the implementation somehow recovers a
// packet.
RTPReceiverStrategy(RtpData* data_callback);
explicit RTPReceiverStrategy(RtpData* data_callback);
rtc::scoped_ptr<CriticalSectionWrapper> crit_sect_;
PayloadUnion last_payload_;

View File

@ -956,8 +956,8 @@ bool ModuleRtpRtcpImpl::UpdateRTCPReceiveInformationTimers() {
}
// Called from RTCPsender.
int32_t ModuleRtpRtcpImpl::BoundingSet(bool& tmmbr_owner,
TMMBRSet*& bounding_set) {
int32_t ModuleRtpRtcpImpl::BoundingSet(bool* tmmbr_owner,
TMMBRSet* bounding_set) {
return rtcp_receiver_.BoundingSet(tmmbr_owner, bounding_set);
}

View File

@ -295,7 +295,7 @@ class ModuleRtpRtcpImpl : public RtpRtcp {
bool LastReceivedXrReferenceTimeInfo(RtcpReceiveTimeInfo* info) const;
virtual int32_t BoundingSet(bool& tmmbr_owner, TMMBRSet*& bounding_set_rec);
int32_t BoundingSet(bool* tmmbr_owner, TMMBRSet* bounding_set_rec);
void BitrateSent(uint32_t* total_rate,
uint32_t* video_rate,

View File

@ -97,7 +97,7 @@ class SendTransport : public Transport,
class RtpRtcpModule : public RtcpPacketTypeCounterObserver {
public:
RtpRtcpModule(SimulatedClock* clock)
explicit RtpRtcpModule(SimulatedClock* clock)
: receive_statistics_(ReceiveStatistics::Create(clock)) {
RtpRtcp::Configuration config;
config.audio = false;

View File

@ -326,11 +326,11 @@ int32_t RTPSender::RegisterPayload(
return -1;
}
int32_t ret_val = 0;
RtpUtility::Payload* payload = NULL;
RtpUtility::Payload* payload = nullptr;
if (audio_configured_) {
// TODO(mflodman): Change to CreateAudioPayload and make static.
ret_val = audio_->RegisterAudioPayload(payload_name, payload_number,
frequency, channels, rate, payload);
frequency, channels, rate, &payload);
} else {
payload = video_->CreateVideoPayload(payload_name, payload_number, rate);
}
@ -455,7 +455,7 @@ int32_t RTPSender::CheckPayloadType(int8_t payload_type,
}
if (audio_configured_) {
int8_t red_pl_type = -1;
if (audio_->RED(red_pl_type) == 0) {
if (audio_->RED(&red_pl_type) == 0) {
// We have configured RED.
if (red_pl_type == payload_type) {
// And it's a match...
@ -1001,7 +1001,7 @@ bool RTPSender::IsFecPacket(const uint8_t* buffer,
bool fec_enabled;
uint8_t pt_red;
uint8_t pt_fec;
video_->GenericFECStatus(fec_enabled, pt_red, pt_fec);
video_->GenericFECStatus(&fec_enabled, &pt_red, &pt_fec);
return fec_enabled &&
header.payloadType == pt_red &&
buffer[header.headerLength] == pt_fec;
@ -1778,7 +1778,7 @@ int32_t RTPSender::RED(int8_t *payload_type) const {
if (!audio_configured_) {
return -1;
}
return audio_->RED(*payload_type);
return audio_->RED(payload_type);
}
RtpVideoCodecTypes RTPSender::VideoCodecType() const {
@ -1804,7 +1804,7 @@ void RTPSender::GenericFECStatus(bool* enable,
uint8_t* payload_type_red,
uint8_t* payload_type_fec) const {
RTC_DCHECK(!audio_configured_);
video_->GenericFECStatus(*enable, *payload_type_red, *payload_type_fec);
video_->GenericFECStatus(enable, payload_type_red, payload_type_fec);
}
int32_t RTPSender::SetFecParameters(

View File

@ -68,7 +68,7 @@ int32_t RTPSenderAudio::RegisterAudioPayload(
const uint32_t frequency,
const uint8_t channels,
const uint32_t rate,
RtpUtility::Payload*& payload) {
RtpUtility::Payload** payload) {
if (RtpUtility::StringCompare(payloadName, "cn", 2)) {
CriticalSectionScoped cs(_sendAudioCritsect.get());
// we can have multiple CNG payload types
@ -96,13 +96,13 @@ int32_t RTPSenderAudio::RegisterAudioPayload(
return 0;
// The default timestamp rate is 8000 Hz, but other rates may be defined.
}
payload = new RtpUtility::Payload;
payload->typeSpecific.Audio.frequency = frequency;
payload->typeSpecific.Audio.channels = channels;
payload->typeSpecific.Audio.rate = rate;
payload->audio = true;
payload->name[RTP_PAYLOAD_NAME_SIZE - 1] = '\0';
strncpy(payload->name, payloadName, RTP_PAYLOAD_NAME_SIZE - 1);
*payload = new RtpUtility::Payload;
(*payload)->typeSpecific.Audio.frequency = frequency;
(*payload)->typeSpecific.Audio.channels = channels;
(*payload)->typeSpecific.Audio.rate = rate;
(*payload)->audio = true;
(*payload)->name[RTP_PAYLOAD_NAME_SIZE - 1] = '\0';
strncpy((*payload)->name, payloadName, RTP_PAYLOAD_NAME_SIZE - 1);
return 0;
}
@ -384,13 +384,13 @@ int32_t RTPSenderAudio::SetRED(int8_t payloadType) {
}
// Get payload type for Redundant Audio Data RFC 2198
int32_t RTPSenderAudio::RED(int8_t& payloadType) const {
int32_t RTPSenderAudio::RED(int8_t* payloadType) const {
CriticalSectionScoped cs(_sendAudioCritsect.get());
if (_REDPayloadType == -1) {
// not configured
return -1;
}
payloadType = _REDPayloadType;
*payloadType = _REDPayloadType;
return 0;
}

View File

@ -31,7 +31,7 @@ class RTPSenderAudio : public DTMFqueue {
uint32_t frequency,
uint8_t channels,
uint32_t rate,
RtpUtility::Payload*& payload);
RtpUtility::Payload** payload);
int32_t SendAudio(FrameType frameType,
int8_t payloadType,
@ -58,7 +58,7 @@ class RTPSenderAudio : public DTMFqueue {
int32_t SetRED(int8_t payloadType);
// Get payload type for Redundant Audio Data RFC 2198
int32_t RED(int8_t& payloadType) const;
int32_t RED(int8_t* payloadType) const;
protected:
int32_t SendTelephoneEventPacket(

View File

@ -1281,9 +1281,9 @@ TEST_F(RtpSenderAudioTest, CheckMarkerBitForTelephoneEvents) {
// For Telephone events, payload is not added to the registered payload list,
// it will register only the payload used for audio stream.
// Registering the payload again for audio stream with different payload name.
strcpy(payload_name, "payload_name");
const char kPayloadName[] = "payload_name";
ASSERT_EQ(
0, rtp_sender_->RegisterPayload(payload_name, payload_type, 8000, 1, 0));
0, rtp_sender_->RegisterPayload(kPayloadName, payload_type, 8000, 1, 0));
int64_t capture_time_ms = fake_clock_.TimeInMilliseconds();
// DTMF event key=9, duration=500 and attenuationdB=10
rtp_sender_->SendTelephoneEvent(9, 500, 10);

View File

@ -190,13 +190,13 @@ void RTPSenderVideo::SetGenericFECStatus(const bool enable,
kFecMaskRandom;
}
void RTPSenderVideo::GenericFECStatus(bool& enable,
uint8_t& payloadTypeRED,
uint8_t& payloadTypeFEC) const {
void RTPSenderVideo::GenericFECStatus(bool* enable,
uint8_t* payloadTypeRED,
uint8_t* payloadTypeFEC) const {
CriticalSectionScoped cs(crit_.get());
enable = fec_enabled_;
payloadTypeRED = red_payload_type_;
payloadTypeFEC = fec_payload_type_;
*enable = fec_enabled_;
*payloadTypeRED = red_payload_type_;
*payloadTypeFEC = fec_payload_type_;
}
size_t RTPSenderVideo::FECPacketOverhead() const {

View File

@ -67,9 +67,9 @@ class RTPSenderVideo {
const uint8_t payloadTypeRED,
const uint8_t payloadTypeFEC);
void GenericFECStatus(bool& enable,
uint8_t& payloadTypeRED,
uint8_t& payloadTypeFEC) const;
void GenericFECStatus(bool* enable,
uint8_t* payloadTypeRED,
uint8_t* payloadTypeFEC) const;
void SetFecParameters(const FecProtectionParams* delta_params,
const FecProtectionParams* key_params);