Skip to content

Commit

Permalink
Concatenate string literals at compile time.
Browse files Browse the repository at this point in the history
This CL was generated by running:
git ls-files | grep ".cc" | xargs perl -i -ne 'BEGIN {undef $/}; s/("[\s\n]*<<[\s\n]*")/" "/g; print;'; git cl format

After that I manually edited modules/audio_processing/gain_controller2.cc to preserve its original
formatting.

This primary benefit of this change is a small reduction in binary size.

Bug: None
Change-Id: I689fa7ba9c717c314bb167e5d592c3c4e0871e29
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165961
Reviewed-by: Alessio Bazzica <[email protected]>
Reviewed-by: Karl Wiberg <[email protected]>
Commit-Queue: Jonas Olsson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#30251}
  • Loading branch information
Jonas Olsson authored and Commit Bot committed Jan 14, 2020
1 parent 6153e15 commit b2b2031
Show file tree
Hide file tree
Showing 98 changed files with 544 additions and 353 deletions.
17 changes: 11 additions & 6 deletions api/video_codecs/video_encoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,21 @@ std::string VideoEncoder::EncoderInfo::ToString() const {
rtc::SimpleStringBuilder oss(string_buf);

oss << "EncoderInfo { "
<< "ScalingSettings { ";
"ScalingSettings { ";
if (scaling_settings.thresholds) {
oss << "Thresholds { "
<< "low = " << scaling_settings.thresholds->low
"low = "
<< scaling_settings.thresholds->low
<< ", high = " << scaling_settings.thresholds->high << "}, ";
}
oss << "min_pixels_per_frame = " << scaling_settings.min_pixels_per_frame
<< " }";
oss << ", requested_resolution_alignment = " << requested_resolution_alignment
<< ", supports_native_handle = " << supports_native_handle
<< ", implementation_name = '" << implementation_name << "'"
<< ", has_trusted_rate_controller = " << has_trusted_rate_controller
<< ", implementation_name = '" << implementation_name
<< "'"
", has_trusted_rate_controller = "
<< has_trusted_rate_controller
<< ", is_hardware_accelerated = " << is_hardware_accelerated
<< ", has_internal_source = " << has_internal_source
<< ", fps_allocation = [";
Expand Down Expand Up @@ -154,13 +157,15 @@ std::string VideoEncoder::EncoderInfo::ToString() const {
}
ResolutionBitrateLimits l = resolution_bitrate_limits[i];
oss << "Limits { "
<< "frame_size_pixels = " << l.frame_size_pixels
"frame_size_pixels = "
<< l.frame_size_pixels
<< ", min_start_bitrate_bps = " << l.min_start_bitrate_bps
<< ", min_bitrate_bps = " << l.min_bitrate_bps
<< ", max_bitrate_bps = " << l.max_bitrate_bps << "} ";
}
oss << "] "
<< ", supports_simulcast = " << supports_simulcast << "}";
", supports_simulcast = "
<< supports_simulcast << "}";
return oss.str();
}

Expand Down
2 changes: 1 addition & 1 deletion audio/channel_receive.cc
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ void ChannelReceive::UpdatePlayoutTimestamp(bool rtcp, int64_t now_ms) {
if (_audioDeviceModulePtr->PlayoutDelay(&delay_ms) == -1) {
RTC_DLOG(LS_WARNING)
<< "ChannelReceive::UpdatePlayoutTimestamp() failed to read"
<< " playout delay from the ADM";
" playout delay from the ADM";
return;
}

Expand Down
2 changes: 1 addition & 1 deletion audio/channel_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ int32_t ChannelSend::SendRtpAudio(AudioFrameType frameType,
payload = encrypted_audio_payload;
} else if (crypto_options_.sframe.require_frame_encryption) {
RTC_DLOG(LS_ERROR) << "Channel::SendData() failed sending audio payload: "
<< "A frame encryptor is required but one is not set.";
"A frame encryptor is required but one is not set.";
return -1;
}
}
Expand Down
6 changes: 3 additions & 3 deletions call/flexfec_receive_stream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,21 @@ std::unique_ptr<FlexfecReceiver> MaybeCreateFlexfecReceiver(
if (config.payload_type < 0) {
RTC_LOG(LS_WARNING)
<< "Invalid FlexFEC payload type given. "
<< "This FlexfecReceiveStream will therefore be useless.";
"This FlexfecReceiveStream will therefore be useless.";
return nullptr;
}
RTC_DCHECK_GE(config.payload_type, 0);
RTC_DCHECK_LE(config.payload_type, 127);
if (config.remote_ssrc == 0) {
RTC_LOG(LS_WARNING)
<< "Invalid FlexFEC SSRC given. "
<< "This FlexfecReceiveStream will therefore be useless.";
"This FlexfecReceiveStream will therefore be useless.";
return nullptr;
}
if (config.protected_media_ssrcs.empty()) {
RTC_LOG(LS_WARNING)
<< "No protected media SSRC supplied. "
<< "This FlexfecReceiveStream will therefore be useless.";
"This FlexfecReceiveStream will therefore be useless.";
return nullptr;
}

Expand Down
3 changes: 2 additions & 1 deletion call/rtp_stream_receiver_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ RtpStreamReceiverController::Receiver::Receiver(
if (!sink_added) {
RTC_LOG(LS_ERROR)
<< "RtpStreamReceiverController::Receiver::Receiver: Sink "
<< "could not be added for SSRC=" << ssrc << ".";
"could not be added for SSRC="
<< ssrc << ".";
}
}

Expand Down
4 changes: 2 additions & 2 deletions call/rtp_transport_controller_send.cc
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ void RtpTransportControllerSend::SetSdpBitrateParameters(
} else {
RTC_LOG(LS_VERBOSE)
<< "WebRTC.RtpTransportControllerSend.SetSdpBitrateParameters: "
<< "nothing to update";
"nothing to update";
}
}

Expand All @@ -411,7 +411,7 @@ void RtpTransportControllerSend::SetClientBitratePreferences(
} else {
RTC_LOG(LS_VERBOSE)
<< "WebRTC.RtpTransportControllerSend.SetClientBitratePreferences: "
<< "nothing to update";
"nothing to update";
}
}

Expand Down
7 changes: 4 additions & 3 deletions call/simulated_network.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ void SimulatedNetwork::SetConfig(const Config& config) {
int min_avg_burst_loss_length = std::ceil(prob_loss / (1 - prob_loss));

RTC_CHECK_GT(avg_burst_loss_length, min_avg_burst_loss_length)
<< "For a total packet loss of " << config.loss_percent << "%% then"
<< " avg_burst_loss_length must be " << min_avg_burst_loss_length + 1
<< " or higher.";
<< "For a total packet loss of " << config.loss_percent
<< "%% then"
" avg_burst_loss_length must be "
<< min_avg_burst_loss_length + 1 << " or higher.";

config_state_.prob_loss_bursting = (1.0 - 1.0 / avg_burst_loss_length);
config_state_.prob_start_bursting =
Expand Down
2 changes: 1 addition & 1 deletion common_video/bitrate_adjuster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void BitrateAdjuster::UpdateBitrate(uint32_t current_time_ms) {
float last_adjusted_bitrate_bps = adjusted_bitrate_bps_;
if (adjusted_bitrate_bps != last_adjusted_bitrate_bps) {
RTC_LOG(LS_VERBOSE) << "Adjusting encoder bitrate:"
<< "\n target_bitrate:"
"\n target_bitrate:"
<< static_cast<uint32_t>(target_bitrate_bps)
<< "\n estimated_bitrate:"
<< static_cast<uint32_t>(estimated_bitrate_bps)
Expand Down
6 changes: 4 additions & 2 deletions examples/peerconnection/client/conductor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ void Conductor::OnMessageFromPeer(int peer_id, const std::string& message) {
webrtc::CreateSessionDescription(type, sdp, &error);
if (!session_description) {
RTC_LOG(WARNING) << "Can't parse received session description message. "
<< "SdpParseError was: " << error.description;
"SdpParseError was: "
<< error.description;
return;
}
RTC_LOG(INFO) << " Received session description :" << message;
Expand Down Expand Up @@ -373,7 +374,8 @@ void Conductor::OnMessageFromPeer(int peer_id, const std::string& message) {
webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, sdp, &error));
if (!candidate.get()) {
RTC_LOG(WARNING) << "Can't parse received candidate message. "
<< "SdpParseError was: " << error.description;
"SdpParseError was: "
<< error.description;
return;
}
if (!peer_connection_->AddIceCandidate(candidate.get())) {
Expand Down
6 changes: 4 additions & 2 deletions examples/unityplugin/simple_peer_connection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,8 @@ bool SimplePeerConnection::SetRemoteDescription(const char* type,
webrtc::CreateSessionDescription(sdp_type, remote_desc, &error));
if (!session_description) {
RTC_LOG(WARNING) << "Can't parse received session description message. "
<< "SdpParseError was: " << error.description;
"SdpParseError was: "
<< error.description;
return false;
}
RTC_LOG(INFO) << " Received session description :" << remote_desc;
Expand All @@ -363,7 +364,8 @@ bool SimplePeerConnection::AddIceCandidate(const char* candidate,
webrtc::CreateIceCandidate(sdp_mid, sdp_mlineindex, candidate, &error));
if (!ice_candidate.get()) {
RTC_LOG(WARNING) << "Can't parse received candidate message. "
<< "SdpParseError was: " << error.description;
"SdpParseError was: "
<< error.description;
return false;
}
if (!peer_connection_->AddIceCandidate(ice_candidate.get())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,8 @@ std::string RtcEventLogEncoderLegacy::EncodeVideoSendStreamConfig(
if (event.config().codecs.size() > 1) {
RTC_LOG(WARNING)
<< "LogVideoSendStreamConfig currently only supports one "
<< "codec. Logging codec :" << codec.payload_name;
"codec. Logging codec :"
<< codec.payload_name;
break;
}
}
Expand Down
6 changes: 4 additions & 2 deletions logging/rtc_event_log/rtc_event_log2rtp_dump.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,9 @@ int main(int argc, char* argv[]) {
event_processor.ProcessEventsInOrder();

std::cout << "Wrote " << rtp_counter << (header_only ? " header-only" : "")
<< " RTP packets and " << rtcp_counter << " RTCP packets to the "
<< "output file." << std::endl;
<< " RTP packets and " << rtcp_counter
<< " RTCP packets to the "
"output file."
<< std::endl;
return 0;
}
3 changes: 2 additions & 1 deletion logging/rtc_event_log/rtc_event_log_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ bool RtcEventLogImpl::StartLogging(std::unique_ptr<RtcEventLogOutput> output,
const int64_t timestamp_us = rtc::TimeMicros();
const int64_t utc_time_us = rtc::TimeUTCMicros();
RTC_LOG(LS_INFO) << "Starting WebRTC event log. (Timestamp, UTC) = "
<< "(" << timestamp_us << ", " << utc_time_us << ").";
"("
<< timestamp_us << ", " << utc_time_us << ").";

RTC_DCHECK_RUN_ON(&logging_state_checker_);
logging_state_started_ = true;
Expand Down
4 changes: 2 additions & 2 deletions media/base/rtp_data_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ bool RtpDataMediaChannel::SendData(const SendDataParams& params,
packet.AppendData(payload);

RTC_LOG(LS_VERBOSE) << "Sent RTP data packet: "
<< " stream=" << found_stream->id
<< " ssrc=" << header.ssrc
" stream="
<< found_stream->id << " ssrc=" << header.ssrc
<< ", seqnum=" << header.seq_num
<< ", timestamp=" << header.timestamp
<< ", len=" << payload.size();
Expand Down
16 changes: 10 additions & 6 deletions media/engine/webrtc_video_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ void WebRtcVideoChannel::RequestEncoderSwitch(

if (!allow_codec_switching_) {
RTC_LOG(LS_INFO) << "Encoder switch requested but codec switching has"
<< " not been enabled yet.";
" not been enabled yet.";
requested_encoder_switch_ = conf;
return;
}
Expand Down Expand Up @@ -857,7 +857,8 @@ webrtc::RtpParameters WebRtcVideoChannel::GetRtpSendParameters(
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
RTC_LOG(LS_WARNING) << "Attempting to get RTP send parameters for stream "
<< "with ssrc " << ssrc << " which doesn't exist.";
"with ssrc "
<< ssrc << " which doesn't exist.";
return webrtc::RtpParameters();
}

Expand All @@ -878,7 +879,8 @@ webrtc::RTCError WebRtcVideoChannel::SetRtpSendParameters(
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
RTC_LOG(LS_ERROR) << "Attempting to set RTP send parameters for stream "
<< "with ssrc " << ssrc << " which doesn't exist.";
"with ssrc "
<< ssrc << " which doesn't exist.";
return webrtc::RTCError(webrtc::RTCErrorType::INTERNAL_ERROR);
}

Expand All @@ -887,7 +889,7 @@ webrtc::RTCError WebRtcVideoChannel::SetRtpSendParameters(
webrtc::RtpParameters current_parameters = GetRtpSendParameters(ssrc);
if (current_parameters.codecs != parameters.codecs) {
RTC_DLOG(LS_ERROR) << "Using SetParameters to change the set of codecs "
<< "is not currently supported.";
"is not currently supported.";
return webrtc::RTCError(webrtc::RTCErrorType::INTERNAL_ERROR);
}

Expand Down Expand Up @@ -922,7 +924,8 @@ webrtc::RtpParameters WebRtcVideoChannel::GetRtpReceiveParameters(
if (it == receive_streams_.end()) {
RTC_LOG(LS_WARNING)
<< "Attempting to get RTP receive parameters for stream "
<< "with SSRC " << ssrc << " which doesn't exist.";
"with SSRC "
<< ssrc << " which doesn't exist.";
return webrtc::RtpParameters();
}
rtp_params = it->second->GetRtpParameters();
Expand Down Expand Up @@ -2736,7 +2739,8 @@ void WebRtcVideoChannel::WebRtcVideoReceiveStream::SetFrameDecryptor(
if (stream_) {
RTC_LOG(LS_INFO)
<< "Setting FrameDecryptor (recv) because of SetFrameDecryptor, "
<< "remote_ssrc=" << config_.rtp.remote_ssrc;
"remote_ssrc="
<< config_.rtp.remote_ssrc;
stream_->SetFrameDecryptor(frame_decryptor);
}
}
Expand Down
20 changes: 12 additions & 8 deletions media/engine/webrtc_voice_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ absl::optional<int> ComputeSendBitrate(int max_send_bitrate_bps,
// fail. If codec is not multi-rate and |bps| exceeds or equal the fixed
// bitrate then ignore.
RTC_LOG(LS_ERROR) << "Failed to set codec " << spec.format.name
<< " to bitrate " << bps << " bps"
<< ", requires at least " << spec.info.min_bitrate_bps
<< " bps.";
<< " to bitrate " << bps
<< " bps"
", requires at least "
<< spec.info.min_bitrate_bps << " bps.";
return absl::nullopt;
}

Expand Down Expand Up @@ -1181,7 +1182,7 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
return true;
} else {
RTC_LOG(LS_ERROR) << "Failed to SetBaseMinimumPlayoutDelayMs"
<< " on AudioReceiveStream on SSRC="
" on AudioReceiveStream on SSRC="
<< config_.rtp.remote_ssrc
<< " with delay_ms=" << delay_ms;
return false;
Expand Down Expand Up @@ -1351,7 +1352,8 @@ webrtc::RtpParameters WebRtcVoiceMediaChannel::GetRtpSendParameters(
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
RTC_LOG(LS_WARNING) << "Attempting to get RTP send parameters for stream "
<< "with ssrc " << ssrc << " which doesn't exist.";
"with ssrc "
<< ssrc << " which doesn't exist.";
return webrtc::RtpParameters();
}

Expand All @@ -1371,7 +1373,8 @@ webrtc::RTCError WebRtcVoiceMediaChannel::SetRtpSendParameters(
auto it = send_streams_.find(ssrc);
if (it == send_streams_.end()) {
RTC_LOG(LS_WARNING) << "Attempting to set RTP send parameters for stream "
<< "with ssrc " << ssrc << " which doesn't exist.";
"with ssrc "
<< ssrc << " which doesn't exist.";
return webrtc::RTCError(webrtc::RTCErrorType::INTERNAL_ERROR);
}

Expand All @@ -1380,7 +1383,7 @@ webrtc::RTCError WebRtcVoiceMediaChannel::SetRtpSendParameters(
webrtc::RtpParameters current_parameters = GetRtpSendParameters(ssrc);
if (current_parameters.codecs != parameters.codecs) {
RTC_DLOG(LS_ERROR) << "Using SetParameters to change the set of codecs "
<< "is not currently supported.";
"is not currently supported.";
return webrtc::RTCError(webrtc::RTCErrorType::UNSUPPORTED_PARAMETER);
}

Expand Down Expand Up @@ -1426,7 +1429,8 @@ webrtc::RtpParameters WebRtcVoiceMediaChannel::GetRtpReceiveParameters(
if (it == recv_streams_.end()) {
RTC_LOG(LS_WARNING)
<< "Attempting to get RTP receive parameters for stream "
<< "with ssrc " << ssrc << " which doesn't exist.";
"with ssrc "
<< ssrc << " which doesn't exist.";
return webrtc::RtpParameters();
}
rtp_params = it->second->GetRtpParameters();
Expand Down
Loading

0 comments on commit b2b2031

Please sign in to comment.