diff --git a/api/peer_connection_interface.cc b/api/peer_connection_interface.cc index 244ee739d9..3a96ccf3c7 100644 --- a/api/peer_connection_interface.cc +++ b/api/peer_connection_interface.cc @@ -182,6 +182,11 @@ bool PeerConnectionInterface::StartRtcEventLog( return false; } +bool PeerConnectionInterface::StartRtcEventLog( + std::unique_ptr output) { + return false; +} + rtc::scoped_refptr PeerConnectionInterface::LookupDtlsTransportByMid(const std::string& mid) { RTC_NOTREACHED(); diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h index 623b869f17..41a1c0f0b1 100644 --- a/api/peer_connection_interface.h +++ b/api/peer_connection_interface.h @@ -1074,8 +1074,14 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // |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 output, int64_t output_period_ms); + virtual bool StartRtcEventLog(std::unique_ptr 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 b3247c6456..b4c5fe2d9a 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -3791,6 +3791,12 @@ bool PeerConnection::StartRtcEventLog(std::unique_ptr output, RTC_FROM_HERE, Functor{this, std::move(output), output_period_ms}); } +bool PeerConnection::StartRtcEventLog( + std::unique_ptr output) { + return StartRtcEventLog(std::move(output), + webrtc::RtcEventLog::kImmediateOutput); +} + void PeerConnection::StopRtcEventLog() { worker_thread()->Invoke( RTC_FROM_HERE, rtc::Bind(&PeerConnection::StopRtcEventLog_w, this)); diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 39cb867406..be46980ac4 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -211,6 +211,7 @@ class PeerConnection : public PeerConnectionInternal, int64_t max_size_bytes) override; bool StartRtcEventLog(std::unique_ptr output, int64_t output_period_ms) override; + bool StartRtcEventLog(std::unique_ptr output) override; void StopRtcEventLog() override; void Close() override;