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

Unified Diff: chrome/renderer/media/cast_rtp_stream.cc

Issue 287313002: Pass a TimeTicks along video capture pipeline to represent capture time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | content/common/media/video_capture.h » ('j') | content/common/media/video_capture.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/media/cast_rtp_stream.cc
diff --git a/chrome/renderer/media/cast_rtp_stream.cc b/chrome/renderer/media/cast_rtp_stream.cc
index 42639abea781534e4c7b29a6c5134d4d57b8f324..1a2678b037b3fae03459691bfdf69b8f5b607e5d 100644
--- a/chrome/renderer/media/cast_rtp_stream.cc
+++ b/chrome/renderer/media/cast_rtp_stream.cc
@@ -232,21 +232,24 @@ class CastVideoSink : public base::SupportsWeakPtr<CastVideoSink>,
const scoped_refptr<media::cast::VideoFrameInput> frame_input,
// These parameters are passed for each frame.
const scoped_refptr<media::VideoFrame>& frame,
- const media::VideoCaptureFormat& format) {
+ const media::VideoCaptureFormat& format,
+ const base::TimeTicks& start_ticks) {
if (frame->coded_size() != expected_coded_size) {
error_callback.Run("Video frame resolution does not match config.");
return;
}
- const base::TimeTicks now = base::TimeTicks::Now();
+ base::TimeTicks timestamp = base::TimeTicks::Now();
+ if (!start_ticks.is_null())
+ timestamp = start_ticks + frame->timestamp();
// Used by chrome/browser/extension/api/cast_streaming/performance_test.cc
TRACE_EVENT_INSTANT2(
"cast_perf_test", "MediaStreamVideoSink::OnVideoFrame",
TRACE_EVENT_SCOPE_THREAD,
- "timestamp", now.ToInternalValue(),
+ "timestamp", timestamp.ToInternalValue(),
"time_delta", frame->timestamp().ToInternalValue());
- frame_input->InsertRawVideoFrame(frame, now);
+ frame_input->InsertRawVideoFrame(frame, timestamp);
}
// Attach this sink to a video track represented by |track_|.
« no previous file with comments | « no previous file | content/common/media/video_capture.h » ('j') | content/common/media/video_capture.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698