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

Unified Diff: media/video/capture/video_capture_device_unittest.cc

Issue 48113011: Remove media::VideoFrame from media::VideoCaptureDevice::Client interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: ffdbaeb83 Trybot failures. Created 7 years, 1 month 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 | « media/video/capture/video_capture_device.h ('k') | media/video/capture/win/video_capture_device_mf_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/video_capture_device_unittest.cc
diff --git a/media/video/capture/video_capture_device_unittest.cc b/media/video/capture/video_capture_device_unittest.cc
index 87cc932d698eb5c7cb98ebb932e41a103cf7b02e..3b470d111a7287d18ea9d9afeb42d562d3e00565 100644
--- a/media/video/capture/video_capture_device_unittest.cc
+++ b/media/video/capture/video_capture_device_unittest.cc
@@ -64,34 +64,35 @@ namespace media {
class MockClient : public media::VideoCaptureDevice::Client {
public:
- MOCK_METHOD1(ReserveOutputBuffer,
- scoped_refptr<media::VideoFrame>(const gfx::Size&));
+ MOCK_METHOD2(ReserveOutputBuffer,
+ scoped_refptr<Buffer>(media::VideoFrame::Format format,
+ const gfx::Size& dimensions));
MOCK_METHOD0(OnErr, void());
explicit MockClient(
base::Callback<void(const VideoCaptureCapability&)> frame_cb)
- : main_thread_(base::MessageLoopProxy::current()),
- frame_cb_(frame_cb) {}
+ : main_thread_(base::MessageLoopProxy::current()), frame_cb_(frame_cb) {}
virtual void OnError() OVERRIDE {
OnErr();
}
- virtual void OnIncomingCapturedFrame(
- const uint8* data,
- int length,
- base::Time timestamp,
- int rotation,
- bool flip_vert,
- bool flip_horiz,
- const VideoCaptureCapability& frame_info) OVERRIDE {
+ virtual void OnIncomingCapturedFrame(const uint8* data,
+ int length,
+ base::Time timestamp,
+ int rotation,
+ bool flip_vert,
+ bool flip_horiz,
+ const VideoCaptureCapability& frame_info)
+ OVERRIDE {
main_thread_->PostTask(FROM_HERE, base::Bind(frame_cb_, frame_info));
}
- virtual void OnIncomingCapturedVideoFrame(
- const scoped_refptr<media::VideoFrame>& frame,
- base::Time timestamp,
- int frame_rate) OVERRIDE {
+ virtual void OnIncomingCapturedBuffer(const scoped_refptr<Buffer>& buffer,
+ media::VideoFrame::Format format,
+ const gfx::Size& dimensions,
+ base::Time timestamp,
+ int frame_rate) OVERRIDE {
NOTREACHED();
}
@@ -106,9 +107,9 @@ class VideoCaptureDeviceTest : public testing::Test {
VideoCaptureDeviceTest()
: loop_(new base::MessageLoop()),
- client_(new MockClient(base::Bind(
- &VideoCaptureDeviceTest::OnFrameCaptured,
- base::Unretained(this)))) {}
+ client_(
+ new MockClient(base::Bind(&VideoCaptureDeviceTest::OnFrameCaptured,
+ base::Unretained(this)))) {}
virtual void SetUp() {
#if defined(OS_ANDROID)
@@ -266,8 +267,7 @@ TEST_F(VideoCaptureDeviceTest, ReAllocateCamera) {
PIXEL_FORMAT_I420,
ConstantResolutionVideoCaptureDevice);
- device->AllocateAndStart(requested_format,
- client_.PassAs<Client>());
+ device->AllocateAndStart(requested_format, client_.PassAs<Client>());
device->StopAndDeAllocate();
}
@@ -284,8 +284,7 @@ TEST_F(VideoCaptureDeviceTest, ReAllocateCamera) {
scoped_ptr<VideoCaptureDevice> device(
VideoCaptureDevice::Create(names_.front()));
- device->AllocateAndStart(requested_format,
- client_.PassAs<Client>());
+ device->AllocateAndStart(requested_format, client_.PassAs<Client>());
WaitForCapturedFrame();
device->StopAndDeAllocate();
device.reset();
« no previous file with comments | « media/video/capture/video_capture_device.h ('k') | media/video/capture/win/video_capture_device_mf_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698