Remove the remaining non-test stringstreams from api/

Bug: webrtc:8982
Change-Id: Ie54ed24a609398228a69bdd92728ebf679cf3fe3
Reviewed-on: https://webrtc-review.googlesource.com/76561
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23239}
diff --git a/api/rtp_headers.h b/api/rtp_headers.h
index c5496b6..e82d121 100644
--- a/api/rtp_headers.h
+++ b/api/rtp_headers.h
@@ -13,7 +13,6 @@
 
 #include <stddef.h>
 #include <string.h>
-#include <ostream>
 #include <string>
 #include <vector>
 
diff --git a/api/rtpparameters.cc b/api/rtpparameters.cc
index cb9c1cf..ed48091 100644
--- a/api/rtpparameters.cc
+++ b/api/rtpparameters.cc
@@ -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 {
 
@@ -69,14 +69,15 @@
 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[] =
diff --git a/api/video/video_timing.cc b/api/video/video_timing.cc
index 3ccbe4e..3ed9501 100644
--- a/api/video/video_timing.cc
+++ b/api/video/video_timing.cc
@@ -10,7 +10,7 @@
 
 #include "api/video/video_timing.h"
 
-#include <sstream>
+#include "rtc_base/strings/string_builder.h"
 
 namespace webrtc {
 
@@ -60,19 +60,22 @@
 }
 
 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