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

Unified Diff: content/renderer/media/rtc_video_renderer.cc

Issue 13554003: Use NTP time for video frame timestamp. Add tracing for timestamps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix RenderFrame using timestamp as nanoseconds. Created 7 years, 8 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 | « content/renderer/media/rtc_video_capturer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_video_renderer.cc
diff --git a/content/renderer/media/rtc_video_renderer.cc b/content/renderer/media/rtc_video_renderer.cc
index 6af00f9f8fb0e9e9bd411f2a130cdf7d431b4e55..5087711a82071bd0dc99d5a45777b2e60334fc84 100644
--- a/content/renderer/media/rtc_video_renderer.cc
+++ b/content/renderer/media/rtc_video_renderer.cc
@@ -11,7 +11,6 @@
#include "base/message_loop_proxy.h"
#include "media/base/video_frame.h"
#include "media/base/video_util.h"
-#include "third_party/libjingle/source/talk/base/timeutils.h"
#include "third_party/libjingle/source/talk/media/base/videoframe.h"
using media::CopyYPlane;
@@ -74,15 +73,22 @@ void RTCVideoRenderer::SetSize(int width, int height) {
}
void RTCVideoRenderer::RenderFrame(const cricket::VideoFrame* frame) {
- base::TimeDelta timestamp = base::TimeDelta::FromMilliseconds(
- frame->GetTimeStamp() / talk_base::kNumNanosecsPerMillisec);
+ TRACE_EVENT_INSTANT2("rtc_video_renderer",
+ "RenderFrame",
+ TRACE_EVENT_SCOPE_THREAD,
+ "elapsed time",
+ frame->GetElapsedTime(),
+ "timestamp",
+ frame->GetTimeStamp());
+
gfx::Size size(frame->GetWidth(), frame->GetHeight());
scoped_refptr<media::VideoFrame> video_frame =
media::VideoFrame::CreateFrame(media::VideoFrame::YV12,
size,
gfx::Rect(size),
size,
- timestamp);
+ base::TimeDelta::FromMilliseconds(
+ frame->GetTimeStamp()));
// Aspect ratio unsupported; DCHECK when there are non-square pixels.
DCHECK_EQ(frame->GetPixelWidth(), 1u);
« no previous file with comments | « content/renderer/media/rtc_video_capturer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698