Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1500)

Unified Diff: webrtc/system_wrappers/source/clock.cc

Issue 2997883002: Video/Screenshare loopback tool.
Patch Set: Rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/system_wrappers/include/clock.h ('k') | webrtc/test/call_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/system_wrappers/source/clock.cc
diff --git a/webrtc/system_wrappers/source/clock.cc b/webrtc/system_wrappers/source/clock.cc
index f4533fb168f74adda8fa975a3e6f41a5a2a4de18..431a66fc14d5a18eb3b47ae17192726e0e35d170 100644
--- a/webrtc/system_wrappers/source/clock.cc
+++ b/webrtc/system_wrappers/source/clock.cc
@@ -19,10 +19,32 @@
#include <time.h>
#endif
+#include <sstream>
+
#include "webrtc/rtc_base/criticalsection.h"
#include "webrtc/rtc_base/timeutils.h"
#include "webrtc/system_wrappers/include/rw_lock_wrapper.h"
+extern int64_t start_time;
+
+void Print(const char* fmt, ...) {
+ const static int kBufferSize = 5000;
+ char buffer[kBufferSize];
+ int64_t now_ms = webrtc::Clock::GetRealTimeClock()->TimeInMilliseconds();
+ if (start_time == -1)
+ start_time = now_ms;
+
+ int bytes_written;
+ bytes_written = snprintf(buffer, kBufferSize, "%8ld - ", now_ms - start_time);
+ va_list args;
+ va_start(args, fmt);
+ bytes_written +=
+ vsnprintf(buffer + bytes_written, kBufferSize - bytes_written, fmt, args);
+ assert(bytes_written < kBufferSize);
+ va_end(args);
+ printf("%s\n", buffer);
+}
+
namespace webrtc {
class RealTimeClock : public Clock {
« no previous file with comments | « webrtc/system_wrappers/include/clock.h ('k') | webrtc/test/call_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698