Using << on an int8_t or uint8_t will output a character rather than a number.

Places that do this need to cast to int to get the desired behavior.

BUG=none
TEST=none
R=henrik.lundin@webrtc.org, pthatcher@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/40579004

Cr-Commit-Position: refs/heads/master@{#8223}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8223 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pkasting@chromium.org 2015-01-30 19:53:42 +00:00
parent 005b6fffe6
commit 026b892e72
10 changed files with 36 additions and 26 deletions

View File

@ -3907,7 +3907,8 @@ bool WebRtcVideoMediaChannel::SetReceiveCodecs(
}
if (engine()->vie()->rtp()->SetRtxReceivePayloadType(
channel_id, it->plType) != 0) {
LOG_RTCERR2(SetRtxReceivePayloadType, channel_id, it->plType);
LOG_RTCERR2(SetRtxReceivePayloadType, channel_id,
static_cast<int>(it->plType));
return false;
}
rtx_registered = true;

View File

@ -274,8 +274,9 @@ int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header,
int codec_id = RtpHeaderToCodecIndex(*header, incoming_payload);
if (codec_id < 0) {
LOG_F(LS_ERROR) << "Payload-type " << header->payloadType
<< " is not registered.";
LOG_F(LS_ERROR) << "Payload-type "
<< static_cast<int>(header->payloadType)
<< " is not registered.";
return -1;
}
assert(codec_id < ACMCodecDB::kMaxNumCodecs);
@ -340,8 +341,9 @@ int AcmReceiver::InsertPacket(const WebRtcRTPHeader& rtp_header,
if (neteq_->InsertPacket(rtp_header, incoming_payload, length_payload,
receive_timestamp) < 0) {
LOG_FERR1(LS_ERROR, "AcmReceiver::InsertPacket", header->payloadType) <<
" Failed to insert packet";
LOG_FERR1(LS_ERROR, "AcmReceiver::InsertPacket",
static_cast<int>(header->payloadType))
<< " Failed to insert packet";
return -1;
}
return 0;
@ -506,7 +508,7 @@ int32_t AcmReceiver::AddCodec(int acm_codec_id,
if (neteq_->RemovePayloadType(decoders_[acm_codec_id].payload_type) !=
NetEq::kOK) {
LOG_F(LS_ERROR) << "Cannot remover payload "
<< decoders_[acm_codec_id].payload_type;
<< static_cast<int>(decoders_[acm_codec_id].payload_type);
return -1;
}
}
@ -519,8 +521,8 @@ int32_t AcmReceiver::AddCodec(int acm_codec_id,
audio_decoder, neteq_decoder, payload_type);
}
if (ret_val != NetEq::kOK) {
LOG_FERR3(LS_ERROR, "AcmReceiver::AddCodec", acm_codec_id, payload_type,
channels);
LOG_FERR3(LS_ERROR, "AcmReceiver::AddCodec", acm_codec_id,
static_cast<int>(payload_type), channels);
// Registration failed, delete the allocated space and set the pointer to
// NULL, for the record.
decoders_[acm_codec_id].registered = false;
@ -560,7 +562,7 @@ int AcmReceiver::RemoveAllCodecs() {
decoders_[n].registered = false;
} else {
LOG_F(LS_ERROR) << "Cannot remove payload "
<< decoders_[n].payload_type;
<< static_cast<int>(decoders_[n].payload_type);
ret_val = -1;
}
}
@ -576,7 +578,8 @@ int AcmReceiver::RemoveCodec(uint8_t payload_type) {
return 0;
}
if (neteq_->RemovePayloadType(payload_type) != NetEq::kOK) {
LOG_FERR1(LS_ERROR, "AcmReceiver::RemoveCodec", payload_type);
LOG_FERR1(LS_ERROR, "AcmReceiver::RemoveCodec",
static_cast<int>(payload_type));
return -1;
}
CriticalSectionScoped lock(crit_sect_.get());
@ -683,7 +686,8 @@ int AcmReceiver::DecoderByPayloadType(uint8_t payload_type,
CriticalSectionScoped lock(crit_sect_.get());
int codec_index = PayloadType2CodecIndex(payload_type);
if (codec_index < 0) {
LOG_FERR1(LS_ERROR, "AcmReceiver::DecoderByPayloadType", payload_type);
LOG_FERR1(LS_ERROR, "AcmReceiver::DecoderByPayloadType",
static_cast<int>(payload_type));
return -1;
}
memcpy(codec, &ACMCodecDB::database_[codec_index], sizeof(CodecInst));

View File

@ -182,7 +182,8 @@ int NetEqImpl::RegisterPayloadType(enum NetEqDecoder codec,
LOG_API2(static_cast<int>(rtp_payload_type), codec);
int ret = decoder_database_->RegisterPayload(rtp_payload_type, codec);
if (ret != DecoderDatabase::kOK) {
LOG_FERR2(LS_WARNING, RegisterPayload, rtp_payload_type, codec);
LOG_FERR2(LS_WARNING, RegisterPayload, static_cast<int>(rtp_payload_type),
codec);
switch (ret) {
case DecoderDatabase::kInvalidRtpPayloadType:
error_code_ = kInvalidRtpPayloadType;
@ -215,7 +216,8 @@ int NetEqImpl::RegisterExternalDecoder(AudioDecoder* decoder,
int ret = decoder_database_->InsertExternal(rtp_payload_type, codec,
sample_rate_hz, decoder);
if (ret != DecoderDatabase::kOK) {
LOG_FERR2(LS_WARNING, InsertExternal, rtp_payload_type, codec);
LOG_FERR2(LS_WARNING, InsertExternal, static_cast<int>(rtp_payload_type),
codec);
switch (ret) {
case DecoderDatabase::kInvalidRtpPayloadType:
error_code_ = kInvalidRtpPayloadType;
@ -251,7 +253,7 @@ int NetEqImpl::RemovePayloadType(uint8_t rtp_payload_type) {
} else {
error_code_ = kOtherError;
}
LOG_FERR1(LS_WARNING, Remove, rtp_payload_type);
LOG_FERR1(LS_WARNING, Remove, static_cast<int>(rtp_payload_type));
return kFail;
}
@ -412,7 +414,7 @@ int NetEqImpl::InsertPacketInternal(const WebRtcRTPHeader& rtp_header,
decoder_database_->IsRed(rtp_header.header.payloadType) ||
decoder_database_->IsComfortNoise(rtp_header.header.payloadType)) {
LOG_F(LS_ERROR) << "Sync-packet with an unacceptable payload type "
<< rtp_header.header.payloadType;
<< static_cast<int>(rtp_header.header.payloadType);
return kSyncPacketNotAccepted;
}
if (first_packet_ ||
@ -1801,8 +1803,9 @@ int NetEqImpl::ExtractPackets(int required_samples, PacketList* packet_list) {
packet->payload_length);
}
} else {
LOG_FERR1(LS_WARNING, GetDecoder, packet->header.payloadType) <<
"Could not find a decoder for a packet about to be extracted.";
LOG_FERR1(LS_WARNING, GetDecoder,
static_cast<int>(packet->header.payloadType))
<< "Could not find a decoder for a packet about to be extracted.";
assert(false);
}
if (packet_duration <= 0) {

View File

@ -91,7 +91,8 @@ int32_t RTPPayloadRegistry::RegisterReceivePayload(
return 0;
}
}
LOG(LS_ERROR) << "Payload type already registered: " << payload_type;
LOG(LS_ERROR) << "Payload type already registered: "
<< static_cast<int>(payload_type);
return -1;
}

View File

@ -278,7 +278,7 @@ int32_t RTPReceiverAudio::InvokeOnInitializeDecoder(
specific_payload.Audio.channels,
specific_payload.Audio.rate)) {
LOG(LS_ERROR) << "Failed to create decoder for payload type: "
<< payload_name << "/" << payload_type;
<< payload_name << "/" << static_cast<int>(payload_type);
return -1;
}
return 0;

View File

@ -114,7 +114,7 @@ int32_t RtpReceiverImpl::RegisterReceivePayload(
if (rtp_media_receiver_->OnNewPayloadTypeCreated(payload_name, payload_type,
frequency) != 0) {
LOG(LS_ERROR) << "Failed to register payload: " << payload_name << "/"
<< payload_type;
<< static_cast<int>(payload_type);
return -1;
}
}
@ -318,7 +318,7 @@ void RtpReceiverImpl::CheckSSRCChanged(const RTPHeader& rtp_header) {
rtp_header.payload_type_frequency, channels, rate)) {
// New stream, same codec.
LOG(LS_ERROR) << "Failed to create decoder for payload type: "
<< rtp_header.payloadType;
<< static_cast<int>(rtp_header.payloadType);
}
}
}

View File

@ -112,7 +112,7 @@ int32_t RTPReceiverVideo::InvokeOnInitializeDecoder(
callback->OnInitializeDecoder(
id, payload_type, payload_name, kVideoPayloadTypeFrequency, 1, 0)) {
LOG(LS_ERROR) << "Failed to created decoder for payload type: "
<< payload_type;
<< static_cast<int>(payload_type);
return -1;
}
return 0;

View File

@ -645,7 +645,7 @@ VCMGenericDecoder* VCMCodecDataBase::CreateAndInitDecoder(
const VCMDecoderMapItem* decoder_item = FindDecoderItem(payload_type);
if (!decoder_item) {
LOG(LS_ERROR) << "Can't find a decoder associated with payload type: "
<< payload_type;
<< static_cast<int>(payload_type);
return NULL;
}
VCMGenericDecoder* ptr_decoder = NULL;

View File

@ -653,7 +653,8 @@ bool ViECodecImpl::CodecValid(const VideoCodec& video_codec) {
}
if (video_codec.plType == 0 || video_codec.plType > 127) {
LOG(LS_ERROR) << "Invalif payload type: " << video_codec.plType;
LOG(LS_ERROR) << "Invalif payload type: "
<< static_cast<int>(video_codec.plType);
return false;
}

View File

@ -104,7 +104,7 @@ int ViEExternalCodecImpl::RegisterExternalReceiveCodec(
bool decoder_render,
int render_delay) {
LOG(LS_INFO) << "Register external decoder for channel " << video_channel
<< ", pl_type " << pl_type
<< ", pl_type " << static_cast<int>(pl_type)
<< ", decoder_render " << decoder_render
<< ", render_delay " << render_delay;
assert(decoder != NULL);
@ -127,7 +127,7 @@ int ViEExternalCodecImpl::RegisterExternalReceiveCodec(
int ViEExternalCodecImpl::DeRegisterExternalReceiveCodec(
const int video_channel, const unsigned char pl_type) {
LOG(LS_INFO) << "DeRegisterExternalReceiveCodec for channel " << video_channel
<< ", pl_type " << pl_type;
<< ", pl_type " << static_cast<int>(pl_type);
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
ViEChannel* vie_channel = cs.Channel(video_channel);