Revert of Move RtcEventLog object from inside VoiceEngine to Call. (patchset #16 id:420001 of https://codereview.webrtc.org/1748403002/ )
Reason for revert:
Reverting all CLs related to moving the eventlog, as they break Chromium tests.
Original issue's description:
> Move RtcEventLog object from inside VoiceEngine to Call.
>
> In addition to moving the logging object itself, this also moves the interface from PeerConnectionFactory to PeerConnection, which makes more sense for this functionality. An API parameter to set an upper limit to the size of the logfile is introduced.
> The old interface on PeerConnectionFactory is not removed in this CL, because it is called from Chrome, it will be removed after Chrome is updated to use the PeerConnection interface.
>
> BUG=webrtc:4741,webrtc:5603,chromium:609749
> R=solenberg@webrtc.org, stefan@webrtc.org, terelius@webrtc.org, tommi@webrtc.org
>
> Committed: https://crrev.com/1895526c6130e3d0e9b154f95079b8eda7567016
> Cr-Commit-Position: refs/heads/master@{#13321}
TBR=solenberg@webrtc.org,tommi@webrtc.org,stefan@webrtc.org,terelius@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4741,webrtc:5603,chromium:609749
Review-Url: https://codereview.webrtc.org/2111813002
Cr-Commit-Position: refs/heads/master@{#13340}
diff --git a/webrtc/api/java/src/org/webrtc/PeerConnection.java b/webrtc/api/java/src/org/webrtc/PeerConnection.java
index 3808eb4..ad8362d 100644
--- a/webrtc/api/java/src/org/webrtc/PeerConnection.java
+++ b/webrtc/api/java/src/org/webrtc/PeerConnection.java
@@ -253,23 +253,6 @@
return nativeGetStats(observer, (track == null) ? 0 : track.nativeTrack);
}
- // Starts recording an RTC event log. Ownership of the file is transfered to
- // the native code. If an RTC event log is already being recorded, it will be
- // stopped and a new one will start using the provided file. Logging will
- // continue until the stopRtcEventLog function is called. The max_size_bytes
- // argument is ignored, it is added for future use.
- public boolean startRtcEventLog(
- int file_descriptor, long max_size_bytes) {
- return nativeStartRtcEventLog(
- nativePeerConnection, file_descriptor, max_size_bytes);
- }
-
- // Stops recording an RTC event log. If no RTC event log is currently being
- // recorded, this call will have no effect.
- public void stopRtcEventLog() {
- nativeStopRtcEventLog(nativePeerConnection);
- }
-
// TODO(fischman): add support for DTMF-related methods once that API
// stabilizes.
public native SignalingState signalingState();
@@ -320,10 +303,4 @@
private native List<RtpSender> nativeGetSenders();
private native List<RtpReceiver> nativeGetReceivers();
-
- private static native boolean nativeStartRtcEventLog(
- long nativePeerConnection, int file_descriptor, long max_size_bytes);
-
- private static native void nativeStopRtcEventLog(long nativePeerConnection);
-
}
diff --git a/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java b/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java
index 2edd56e..0c1ef3c 100644
--- a/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java
+++ b/webrtc/api/java/src/org/webrtc/PeerConnectionFactory.java
@@ -148,6 +148,28 @@
nativeStopAecDump(nativeFactory);
}
+ // Starts recording an RTC event log. Ownership of the file is transfered to
+ // the native code. If an RTC event log is already being recorded, it will be
+ // stopped and a new one will start using the provided file.
+ public boolean startRtcEventLog(int file_descriptor) {
+ return startRtcEventLog(file_descriptor, -1);
+ }
+
+ // Same as above, but allows setting an upper limit to the size of the
+ // generated logfile.
+ public boolean startRtcEventLog(int file_descriptor,
+ int filesize_limit_bytes) {
+ return nativeStartRtcEventLog(nativeFactory,
+ file_descriptor,
+ filesize_limit_bytes);
+ }
+
+ // Stops recording an RTC event log. If no RTC event log is currently being
+ // recorded, this call will have no effect.
+ public void stopRtcEventLog() {
+ nativeStopRtcEventLog(nativeFactory);
+ }
+
@Deprecated
public void setOptions(Options options) {
nativeSetOptions(nativeFactory, options);
@@ -253,6 +275,12 @@
private static native void nativeStopAecDump(long nativeFactory);
+ private static native boolean nativeStartRtcEventLog(long nativeFactory,
+ int file_descriptor,
+ int filesize_limit_bytes);
+
+ private static native void nativeStopRtcEventLog(long nativeFactory);
+
@Deprecated
public native void nativeSetOptions(long nativeFactory, Options options);
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index be61472..cc33aa8 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -31,12 +31,10 @@
#include "webrtc/api/videocapturertracksource.h"
#include "webrtc/api/videotrack.h"
#include "webrtc/base/arraysize.h"
-#include "webrtc/base/bind.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/stringencode.h"
#include "webrtc/base/stringutils.h"
#include "webrtc/base/trace_event.h"
-#include "webrtc/call.h"
#include "webrtc/media/sctp/sctpdataengine.h"
#include "webrtc/pc/channelmanager.h"
#include "webrtc/system_wrappers/include/field_trial.h"
@@ -1265,18 +1263,6 @@
}
}
-bool PeerConnection::StartRtcEventLog(rtc::PlatformFile file,
- int64_t max_size_bytes) {
- return factory_->worker_thread()->Invoke<bool>(
- RTC_FROM_HERE, rtc::Bind(&PeerConnection::StartRtcEventLog_w, this, file,
- max_size_bytes));
-}
-
-void PeerConnection::StopRtcEventLog() {
- factory_->worker_thread()->Invoke<void>(
- RTC_FROM_HERE, rtc::Bind(&PeerConnection::StopRtcEventLog_w, this));
-}
-
const SessionDescriptionInterface* PeerConnection::local_description() const {
return session_->local_description();
}
@@ -2248,12 +2234,4 @@
return true;
}
-bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file,
- int64_t max_size_bytes) {
- return media_controller_->call_w()->StartEventLog(file, max_size_bytes);
-}
-
-void PeerConnection::StopRtcEventLog_w() {
- media_controller_->call_w()->StopEventLog();
-}
} // namespace webrtc
diff --git a/webrtc/api/peerconnection.h b/webrtc/api/peerconnection.h
index c4a9a60..fc754b9 100644
--- a/webrtc/api/peerconnection.h
+++ b/webrtc/api/peerconnection.h
@@ -136,10 +136,6 @@
void RegisterUMAObserver(UMAObserver* observer) override;
- bool StartRtcEventLog(rtc::PlatformFile file,
- int64_t max_size_bytes) override;
- void StopRtcEventLog() override;
-
void Close() override;
// Virtual for unit tests.
@@ -364,13 +360,6 @@
// is applied.
bool ReconfigurePortAllocator_n(const RTCConfiguration& configuration);
- // Starts recording an Rtc EventLog using the supplied platform file.
- // This function should only be called from the worker thread.
- bool StartRtcEventLog_w(rtc::PlatformFile file, int64_t max_size_bytes);
- // Starts recording an Rtc EventLog using the supplied platform file.
- // This function should only be called from the worker thread.
- void StopRtcEventLog_w();
-
// Storing the factory as a scoped reference pointer ensures that the memory
// in the PeerConnectionFactoryImpl remains available as long as the
// PeerConnection is running. It is passed to PeerConnection as a raw pointer.
diff --git a/webrtc/api/peerconnectionfactory.cc b/webrtc/api/peerconnectionfactory.cc
index b79e7a2..745de3f 100644
--- a/webrtc/api/peerconnectionfactory.cc
+++ b/webrtc/api/peerconnectionfactory.cc
@@ -220,6 +220,17 @@
channel_manager_->StopAecDump();
}
+bool PeerConnectionFactory::StartRtcEventLog(rtc::PlatformFile file,
+ int64_t max_size_bytes) {
+ RTC_DCHECK(signaling_thread_->IsCurrent());
+ return channel_manager_->StartRtcEventLog(file, max_size_bytes);
+}
+
+void PeerConnectionFactory::StopRtcEventLog() {
+ RTC_DCHECK(signaling_thread_->IsCurrent());
+ channel_manager_->StopRtcEventLog();
+}
+
rtc::scoped_refptr<PeerConnectionInterface>
PeerConnectionFactory::CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& configuration_in,
diff --git a/webrtc/api/peerconnectionfactory.h b/webrtc/api/peerconnectionfactory.h
index 39a6402..d4bc0da 100644
--- a/webrtc/api/peerconnectionfactory.h
+++ b/webrtc/api/peerconnectionfactory.h
@@ -80,15 +80,12 @@
bool StartAecDump(rtc::PlatformFile file, int64_t max_size_bytes) override;
void StopAecDump() override;
- // TODO(ivoc) Remove after Chrome is updated.
- bool StartRtcEventLog(rtc::PlatformFile file) override { return false; }
- // TODO(ivoc) Remove after Chrome is updated.
- bool StartRtcEventLog(rtc::PlatformFile file,
- int64_t max_size_bytes) override {
- return false;
+ bool StartRtcEventLog(rtc::PlatformFile file) override {
+ return StartRtcEventLog(file, -1);
}
- // TODO(ivoc) Remove after Chrome is updated.
- void StopRtcEventLog() override {}
+ bool StartRtcEventLog(rtc::PlatformFile file,
+ int64_t max_size_bytes) override;
+ void StopRtcEventLog() override;
virtual webrtc::MediaControllerInterface* CreateMediaController(
const cricket::MediaConfig& config) const;
diff --git a/webrtc/api/peerconnectionfactoryproxy.h b/webrtc/api/peerconnectionfactoryproxy.h
index 227a685..aad97e8 100644
--- a/webrtc/api/peerconnectionfactoryproxy.h
+++ b/webrtc/api/peerconnectionfactoryproxy.h
@@ -70,8 +70,6 @@
CreateAudioTrack, const std::string&, AudioSourceInterface*)
PROXY_METHOD2(bool, StartAecDump, rtc::PlatformFile, int64_t)
PROXY_METHOD0(void, StopAecDump)
- // TODO(ivoc): Remove the StartRtcEventLog and StopRtcEventLog functions as
- // soon as they are removed from PeerConnectionFactoryInterface.
PROXY_METHOD1(bool, StartRtcEventLog, rtc::PlatformFile)
PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
PROXY_METHOD0(void, StopRtcEventLog)
diff --git a/webrtc/api/peerconnectioninterface.h b/webrtc/api/peerconnectioninterface.h
index 93cfafd..3757dad 100644
--- a/webrtc/api/peerconnectioninterface.h
+++ b/webrtc/api/peerconnectioninterface.h
@@ -490,17 +490,6 @@
virtual IceConnectionState ice_connection_state() = 0;
virtual IceGatheringState ice_gathering_state() = 0;
- // Starts RtcEventLog using existing file. Takes ownership of |file| and
- // passes it on to Call, which will take the ownership. If the
- // operation fails the file will be closed. The logging will stop
- // automatically after 10 minutes have passed, or when the StopRtcEventLog
- // function is called.
- virtual bool StartRtcEventLog(rtc::PlatformFile file,
- int64_t max_size_bytes) = 0;
-
- // Stops logging the RtcEventLog.
- virtual void StopRtcEventLog() = 0;
-
// Terminates all media and closes the transport.
virtual void Close() = 0;
@@ -667,19 +656,25 @@
// Stops logging the AEC dump.
virtual void StopAecDump() = 0;
- // This function is deprecated and will be removed when Chrome is updated to
- // use the equivalent function on PeerConnectionInterface.
- // TODO(ivoc) Remove after Chrome is updated.
+ // Starts RtcEventLog using existing file. Takes ownership of |file| and
+ // passes it on to VoiceEngine, which will take the ownership. If the
+ // operation fails the file will be closed. The logging will stop
+ // automatically after 10 minutes have passed, or when the StopRtcEventLog
+ // function is called. A maximum filesize in bytes can be set, the logging
+ // will be stopped before exceeding this limit. If max_size_bytes is set to a
+ // value <= 0, no limit will be used.
+ // This function as well as the StopRtcEventLog don't really belong on this
+ // interface, this is a temporary solution until we move the logging object
+ // from inside voice engine to webrtc::Call, which will happen when the VoE
+ // restructuring effort is further along.
+ // TODO(ivoc): Move this into being:
+ // PeerConnection => MediaController => webrtc::Call.
virtual bool StartRtcEventLog(rtc::PlatformFile file,
int64_t max_size_bytes) = 0;
- // This function is deprecated and will be removed when Chrome is updated to
- // use the equivalent function on PeerConnectionInterface.
- // TODO(ivoc) Remove after Chrome is updated.
+ // Deprecated, use the version above.
virtual bool StartRtcEventLog(rtc::PlatformFile file) = 0;
- // This function is deprecated and will be removed when Chrome is updated to
- // use the equivalent function on PeerConnectionInterface.
- // TODO(ivoc) Remove after Chrome is updated.
+ // Stops logging the RtcEventLog.
virtual void StopRtcEventLog() = 0;
protected:
diff --git a/webrtc/api/peerconnectionproxy.h b/webrtc/api/peerconnectionproxy.h
index 37f2e89..d35d5ba 100644
--- a/webrtc/api/peerconnectionproxy.h
+++ b/webrtc/api/peerconnectionproxy.h
@@ -74,8 +74,6 @@
PROXY_METHOD0(IceState, ice_state)
PROXY_METHOD0(IceConnectionState, ice_connection_state)
PROXY_METHOD0(IceGatheringState, ice_gathering_state)
- PROXY_METHOD2(bool, StartRtcEventLog, rtc::PlatformFile, int64_t)
- PROXY_METHOD0(void, StopRtcEventLog)
PROXY_METHOD0(void, Close)
END_SIGNALING_PROXY()