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

Unified Diff: content/browser/renderer_host/media/video_capture_host_unittest.cc

Issue 83793004: Implement IPCs and VideoCapture::Client interfaces for texture capture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: e296ac98 Win32 bits. Created 6 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/renderer_host/media/video_capture_host_unittest.cc
diff --git a/content/browser/renderer_host/media/video_capture_host_unittest.cc b/content/browser/renderer_host/media/video_capture_host_unittest.cc
index 23403a8c4c9e32999dff7564005bd2ed019cce86..58a07e6ebf178b610dd78483d1a0f1ab6167c0ab 100644
--- a/content/browser/renderer_host/media/video_capture_host_unittest.cc
+++ b/content/browser/renderer_host/media/video_capture_host_unittest.cc
@@ -114,15 +114,23 @@ class MockVideoCaptureHost : public VideoCaptureHost {
// A list of mock methods.
MOCK_METHOD4(OnNewBufferCreated,
- void(int device_id, base::SharedMemoryHandle handle,
- int length, int buffer_id));
+ void(int device_id,
+ base::SharedMemoryHandle handle,
+ int length,
+ int buffer_id));
MOCK_METHOD2(OnBufferFreed,
void(int device_id, int buffer_id));
MOCK_METHOD4(OnBufferFilled,
void(int device_id,
int buffer_id,
- base::TimeTicks timestamp,
- const media::VideoCaptureFormat& format));
+ const media::VideoCaptureFormat& format,
+ base::TimeTicks timestamp));
+ MOCK_METHOD5(OnMailboxBufferFilled,
+ void(int device_id,
+ int buffer_id,
+ const gpu::MailboxHolder& mailbox_holder,
+ const media::VideoCaptureFormat& format,
+ base::TimeTicks timestamp));
MOCK_METHOD2(OnStateChanged, void(int device_id, VideoCaptureState state));
// Use class DumpVideo to write I420 video to file.
@@ -138,7 +146,7 @@ class MockVideoCaptureHost : public VideoCaptureHost {
void ReturnReceivedDibs(int device_id) {
int handle = GetReceivedDib();
while (handle) {
- this->OnReceiveEmptyBuffer(device_id, handle);
+ this->OnReceiveEmptyBuffer(device_id, handle, 0);
handle = GetReceivedDib();
}
}
@@ -173,6 +181,8 @@ class MockVideoCaptureHost : public VideoCaptureHost {
IPC_MESSAGE_HANDLER(VideoCaptureMsg_NewBuffer, OnNewBufferCreatedDispatch)
IPC_MESSAGE_HANDLER(VideoCaptureMsg_FreeBuffer, OnBufferFreedDispatch)
IPC_MESSAGE_HANDLER(VideoCaptureMsg_BufferReady, OnBufferFilledDispatch)
+ IPC_MESSAGE_HANDLER(VideoCaptureMsg_MailboxBufferReady,
+ OnMailboxBufferFilledDispatch)
IPC_MESSAGE_HANDLER(VideoCaptureMsg_StateChanged, OnStateChangedDispatch)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -205,8 +215,8 @@ class MockVideoCaptureHost : public VideoCaptureHost {
void OnBufferFilledDispatch(int device_id,
int buffer_id,
- base::TimeTicks timestamp,
- const media::VideoCaptureFormat& frame_format) {
+ const media::VideoCaptureFormat& frame_format,
+ base::TimeTicks timestamp) {
base::SharedMemory* dib = filled_dib_[buffer_id];
ASSERT_TRUE(dib != NULL);
if (dump_video_) {
@@ -222,9 +232,22 @@ class MockVideoCaptureHost : public VideoCaptureHost {
dumper_.NewVideoFrame(dib->memory());
}
- OnBufferFilled(device_id, buffer_id, timestamp, frame_format);
+ OnBufferFilled(device_id, buffer_id, frame_format, timestamp);
+ if (return_buffers_) {
+ VideoCaptureHost::OnReceiveEmptyBuffer(device_id, buffer_id, 0);
+ }
+ }
+
+ void OnMailboxBufferFilledDispatch(int device_id,
+ int buffer_id,
+ const gpu::MailboxHolder& mailbox_holder,
+ const media::VideoCaptureFormat& format,
+ base::TimeTicks timestamp) {
+ OnMailboxBufferFilled(
+ device_id, buffer_id, mailbox_holder, format, timestamp);
if (return_buffers_) {
- VideoCaptureHost::OnReceiveEmptyBuffer(device_id, buffer_id);
+ VideoCaptureHost::OnReceiveEmptyBuffer(
+ device_id, buffer_id, mailbox_holder.sync_point);
}
}

Powered by Google App Engine
This is Rietveld 408576698