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

Unified Diff: content/browser/media/capture/web_contents_video_capture_device_unittest.cc

Issue 955253002: Add metadata to media::VideoFrame and plumb it through IPC/MediaStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tommi's nits addressed Created 5 years, 10 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/browser/media/capture/web_contents_video_capture_device_unittest.cc
diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
index 59dffc48b3ff6207d805c5408ce19a14eddff211..84813dad3f3681e6e05021d9577861f68871215a 100644
--- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
@@ -343,15 +343,18 @@ class StubClient : public media::VideoCaptureDevice::Client {
void OnIncomingCapturedVideoFrame(
const scoped_refptr<Buffer>& buffer,
- const media::VideoCaptureFormat& buffer_format,
const scoped_refptr<media::VideoFrame>& frame,
const base::TimeTicks& timestamp) override {
- EXPECT_EQ(gfx::Size(kTestWidth, kTestHeight), buffer_format.frame_size);
- EXPECT_EQ(media::PIXEL_FORMAT_I420, buffer_format.pixel_format);
+ EXPECT_EQ(gfx::Size(kTestWidth, kTestHeight), frame->visible_rect().size());
EXPECT_EQ(media::VideoFrame::I420, frame->format());
+ double frame_rate = 0;
+ EXPECT_TRUE(
+ frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE,
+ &frame_rate));
+ EXPECT_EQ(kTestFramesPerSecond, frame_rate);
uint8 yuv[3];
for (int plane = 0; plane < 3; ++plane)
- yuv[plane] = frame->data(plane)[0];
+ yuv[plane] = frame->visible_data(plane)[0];
// TODO(nick): We just look at the first pixel presently, because if
// the analysis is too slow, the backlog of frames will grow without bound
// and trouble erupts. http://crbug.com/174519

Powered by Google App Engine
This is Rietveld 408576698