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

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

Issue 2045813003: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Metadata over parameter Created 4 years, 6 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
Index: content/renderer/media/video_capture_impl_unittest.cc
diff --git a/content/renderer/media/video_capture_impl_unittest.cc b/content/renderer/media/video_capture_impl_unittest.cc
index 1fc43c024b8f7d75e7f715688e3ce1cd0baf00cc..af4734f251023ed5c8cd414085b456f96ec3c5ad 100644
--- a/content/renderer/media/video_capture_impl_unittest.cc
+++ b/content/renderer/media/video_capture_impl_unittest.cc
@@ -168,10 +168,21 @@ class VideoCaptureImplTest : public ::testing::Test {
}
void BufferReceived(int buffer_id, const gfx::Size& size) {
+ base::TimeTicks now = base::TimeTicks::Now();
+ base::TimeDelta timestamp = now - base::TimeTicks();
+
+ int64_t internal_value = now.ToInternalValue();
miu 2016/06/08 19:24:44 This might break in the future if VideoFrameMetada
qiangchen 2016/06/08 20:08:55 Done.
+ base::DictionaryValue metadata;
+ metadata.SetWithoutPathExpansion(
+ base::IntToString(
+ static_cast<int>(media::VideoFrameMetadata::REFERENCE_TIME)),
+ base::BinaryValue::CreateWithCopiedBuffer(
+ reinterpret_cast<const char*>(&internal_value),
+ sizeof(internal_value)));
+
video_capture_impl_->OnBufferReceived(
- buffer_id, base::TimeTicks::Now(), base::DictionaryValue(),
- media::PIXEL_FORMAT_I420, media::VideoFrame::STORAGE_SHMEM, size,
- gfx::Rect(size));
+ buffer_id, timestamp, metadata, media::PIXEL_FORMAT_I420,
+ media::VideoFrame::STORAGE_SHMEM, size, gfx::Rect(size));
}
void BufferDestroyed(int buffer_id) {

Powered by Google App Engine
This is Rietveld 408576698