Skip to content

Commit

Permalink
Remove the remaining non-test stringstreams from api/
Browse files Browse the repository at this point in the history
Bug: webrtc:8982
Change-Id: Ie54ed24a609398228a69bdd92728ebf679cf3fe3
Reviewed-on: https://webrtc-review.googlesource.com/76561
Reviewed-by: Karl Wiberg <[email protected]>
Commit-Queue: Jonas Olsson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#23239}
  • Loading branch information
Jonas Olsson authored and Commit Bot committed May 15, 2018
1 parent 8d95e3b commit 866d6dc
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
1 change: 0 additions & 1 deletion api/rtp_headers.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#include <stddef.h>
#include <string.h>
#include <ostream>
#include <string>
#include <vector>

Expand Down
15 changes: 8 additions & 7 deletions api/rtpparameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include "api/rtpparameters.h"

#include <algorithm>
#include <sstream>
#include <string>

#include "rtc_base/checks.h"
#include "rtc_base/strings/string_builder.h"

namespace webrtc {

Expand Down Expand Up @@ -69,14 +69,15 @@ RtpParameters::RtpParameters() {}
RtpParameters::~RtpParameters() {}

std::string RtpExtension::ToString() const {
std::stringstream ss;
ss << "{uri: " << uri;
ss << ", id: " << id;
char buf[256];
rtc::SimpleStringBuilder sb(buf);
sb << "{uri: " << uri;
sb << ", id: " << id;
if (encrypt) {
ss << ", encrypt";
sb << ", encrypt";
}
ss << '}';
return ss.str();
sb << '}';
return sb.str();
}

const char RtpExtension::kAudioLevelUri[] =
Expand Down
27 changes: 15 additions & 12 deletions api/video/video_timing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "api/video/video_timing.h"

#include <sstream>
#include "rtc_base/strings/string_builder.h"

namespace webrtc {

Expand Down Expand Up @@ -60,19 +60,22 @@ bool TimingFrameInfo::IsInvalid() const {
}

std::string TimingFrameInfo::ToString() const {
std::stringstream out;
if (IsInvalid()) {
out << "";
} else {
out << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms
<< ',' << encode_finish_ms << ',' << packetization_finish_ms << ','
<< pacer_exit_ms << ',' << network_timestamp_ms << ','
<< network2_timestamp_ms << ',' << receive_start_ms << ','
<< receive_finish_ms << ',' << decode_start_ms << ','
<< decode_finish_ms << ',' << render_time_ms << ','
<< IsOutlier() << ',' << IsTimerTriggered();
return "";
}
return out.str();

char buf[1024];
rtc::SimpleStringBuilder sb(buf);

sb << rtp_timestamp << ',' << capture_time_ms << ',' << encode_start_ms << ','
<< encode_finish_ms << ',' << packetization_finish_ms << ','
<< pacer_exit_ms << ',' << network_timestamp_ms << ','
<< network2_timestamp_ms << ',' << receive_start_ms << ','
<< receive_finish_ms << ',' << decode_start_ms << ',' << decode_finish_ms
<< ',' << render_time_ms << ',' << IsOutlier() << ','
<< IsTimerTriggered();

return sb.str();
}

} // namespace webrtc

0 comments on commit 866d6dc

Please sign in to comment.