Make the output_period_ms argument to StartRtcEventLog optional
Intended to ease transition to new log format.
Bug: webrtc:6463, webrtc:8111
Change-Id: Icadaedb6a6a7d31038a45ff5eb0b054528f00f2f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135944
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Reviewed-by: Steve Anton <steveanton@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27920}
diff --git a/api/peer_connection_interface.cc b/api/peer_connection_interface.cc
index 244ee73..3a96ccf 100644
--- a/api/peer_connection_interface.cc
+++ b/api/peer_connection_interface.cc
@@ -182,6 +182,11 @@
return false;
}
+bool PeerConnectionInterface::StartRtcEventLog(
+ std::unique_ptr<RtcEventLogOutput> output) {
+ return false;
+}
+
rtc::scoped_refptr<DtlsTransportInterface>
PeerConnectionInterface::LookupDtlsTransportByMid(const std::string& mid) {
RTC_NOTREACHED();
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index 623b869..41a1c0f 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -1074,8 +1074,14 @@
// |output| and passes it on to Call, which will take the ownership. If the
// operation fails the output will be closed and deallocated. The event log
// will send serialized events to the output object every |output_period_ms|.
+ // Applications using the event log should generally make their own trade-off
+ // regarding the output period. A long period is generally more efficient,
+ // with potential drawbacks being more bursty thread usage, and more events
+ // lost in case the application crashes. If the |output_period_ms| argument is
+ // omitted, webrtc selects a default deemed to be workable in most cases.
virtual bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms);
+ virtual bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output);
// Stops logging the RtcEventLog.
// TODO(ivoc): Make this pure virtual when Chrome is updated.
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc
index b3247c6..b4c5fe2 100644
--- a/pc/peer_connection.cc
+++ b/pc/peer_connection.cc
@@ -3791,6 +3791,12 @@
RTC_FROM_HERE, Functor{this, std::move(output), output_period_ms});
}
+bool PeerConnection::StartRtcEventLog(
+ std::unique_ptr<RtcEventLogOutput> output) {
+ return StartRtcEventLog(std::move(output),
+ webrtc::RtcEventLog::kImmediateOutput);
+}
+
void PeerConnection::StopRtcEventLog() {
worker_thread()->Invoke<void>(
RTC_FROM_HERE, rtc::Bind(&PeerConnection::StopRtcEventLog_w, this));
diff --git a/pc/peer_connection.h b/pc/peer_connection.h
index 39cb867..be46980 100644
--- a/pc/peer_connection.h
+++ b/pc/peer_connection.h
@@ -211,6 +211,7 @@
int64_t max_size_bytes) override;
bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) override;
+ bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output) override;
void StopRtcEventLog() override;
void Close() override;