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

Unified Diff: talk/media/webrtc/webrtcvideoengine2.cc

Issue 1225153002: Let WebRtcVideoChannel2::WebRtcVideoSendStream::InputFrame carry the input frame's timestamp to out… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 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 | « talk/media/webrtc/webrtcvideoengine2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/media/webrtc/webrtcvideoengine2.cc
diff --git a/talk/media/webrtc/webrtcvideoengine2.cc b/talk/media/webrtc/webrtcvideoengine2.cc
index 0a2152e5e4c891494f34df4a271acb13aa3ec90f..1344123a66931ba591cca6ea7f3ce135c0143c50 100644
--- a/talk/media/webrtc/webrtcvideoengine2.cc
+++ b/talk/media/webrtc/webrtcvideoengine2.cc
@@ -46,6 +46,7 @@
#include "webrtc/modules/video_coding/codecs/h264/include/h264.h"
#include "webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.h"
#include "webrtc/system_wrappers/interface/field_trial.h"
+#include "webrtc/system_wrappers/interface/tick_util.h"
#include "webrtc/system_wrappers/interface/trace_event.h"
#include "webrtc/video_decoder.h"
#include "webrtc/video_encoder.h"
@@ -1727,6 +1728,15 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::InputFrame(
static_cast<int>(frame->GetWidth()),
static_cast<int>(frame->GetHeight()));
}
+
+ // frame->GetTimeStamp is essentially a delta, align to system time
pbos 2015/07/09 15:13:07 GetTimeStamp(), align to webrtc time.
qiangchen 2015/07/09 16:48:07 Done.
+ if (base_timestamp_ns_ == 0) {
+ base_timestamp_ns_ =
+ webrtc::TickTime::MicrosecondTimestamp() * 1000 - frame->GetTimeStamp();
pbos 2015/07/09 15:13:07 Pref using MillisecondTimestamp(), even though the
qiangchen 2015/07/09 16:48:07 Done.
+ }
+
+ video_frame.set_render_time_ms((base_timestamp_ns_ + frame->GetTimeStamp()) /
+ 1000000);
// Reconfigure codec if necessary.
SetDimensions(
video_frame.width(), video_frame.height(), capturer->IsScreencast());
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698