Index: media/video/capture/fake_video_capture_device.cc |
diff --git a/media/video/capture/fake_video_capture_device.cc b/media/video/capture/fake_video_capture_device.cc |
index e7b90ade34c185a4645a67d167f79ee57b4b3990..ff6f1ae82244cc4c5bec234a1a9890b72f5df363 100644 |
--- a/media/video/capture/fake_video_capture_device.cc |
+++ b/media/video/capture/fake_video_capture_device.cc |
@@ -102,6 +102,7 @@ void FakeVideoCaptureDevice::AllocateAndStart( |
if (device_type_ == USING_OWN_BUFFERS || |
device_type_ == USING_OWN_BUFFERS_TRIPLANAR) { |
+ capture_format_.pixel_storage = PIXEL_STORAGE_CPU; |
fake_frame_.reset(new uint8[VideoFrame::AllocationSize( |
VideoFrame::I420, capture_format_.frame_size)]); |
BeepAndScheduleNextCapture( |
@@ -115,11 +116,15 @@ void FakeVideoCaptureDevice::AllocateAndStart( |
: "GpuMemoryBuffers"); |
BeepAndScheduleNextCapture( |
base::TimeTicks::Now(), |
- base::Bind(&FakeVideoCaptureDevice::CaptureUsingClientBuffers, |
- weak_factory_.GetWeakPtr(), |
- (device_type_ == USING_CLIENT_BUFFERS_I420 |
- ? PIXEL_FORMAT_I420 |
- : PIXEL_FORMAT_GPUMEMORYBUFFER))); |
+ base::Bind( |
+ &FakeVideoCaptureDevice::CaptureUsingClientBuffers, |
+ weak_factory_.GetWeakPtr(), |
+ (device_type_ == USING_CLIENT_BUFFERS_GPU |
+ ? PIXEL_FORMAT_ARGB |
+ : PIXEL_FORMAT_I420), |
+ (device_type_ == USING_CLIENT_BUFFERS_GPU |
+ ? PIXEL_STORAGE_GPUMEMORYBUFFER |
+ : PIXEL_STORAGE_CPU))); |
} else { |
client_->OnError("Unknown Fake Video Capture Device type."); |
} |
@@ -169,11 +174,13 @@ void FakeVideoCaptureDevice::CaptureUsingOwnBuffers( |
void FakeVideoCaptureDevice::CaptureUsingClientBuffers( |
VideoPixelFormat pixel_format, |
+ VideoPixelStorage pixel_storage, |
base::TimeTicks expected_execution_time) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
scoped_ptr<VideoCaptureDevice::Client::Buffer> capture_buffer( |
- client_->ReserveOutputBuffer(pixel_format, capture_format_.frame_size)); |
+ client_->ReserveOutputBuffer(capture_format_.frame_size, pixel_format, |
+ pixel_storage)); |
DLOG_IF(ERROR, !capture_buffer) << "Couldn't allocate Capture Buffer"; |
if (capture_buffer.get()) { |
@@ -181,17 +188,14 @@ void FakeVideoCaptureDevice::CaptureUsingClientBuffers( |
DCHECK(data_ptr) << "Buffer has NO backing memory"; |
memset(data_ptr, 0, capture_buffer->size()); |
- DrawPacman( |
- (pixel_format == media::PIXEL_FORMAT_GPUMEMORYBUFFER), /* use_argb */ |
- data_ptr, |
- frame_count_, |
- kFakeCapturePeriodMs, |
- capture_format_.frame_size); |
+ DrawPacman((pixel_format == media::PIXEL_FORMAT_ARGB), /* use_argb */ |
+ data_ptr, frame_count_, kFakeCapturePeriodMs, |
+ capture_format_.frame_size); |
// Give the captured frame to the client. |
const VideoCaptureFormat format(capture_format_.frame_size, |
- capture_format_.frame_rate, |
- pixel_format); |
+ capture_format_.frame_rate, pixel_format, |
+ pixel_storage); |
client_->OnIncomingCapturedBuffer(capture_buffer.Pass(), format, |
base::TimeTicks::Now()); |
} |
@@ -199,7 +203,7 @@ void FakeVideoCaptureDevice::CaptureUsingClientBuffers( |
BeepAndScheduleNextCapture( |
expected_execution_time, |
base::Bind(&FakeVideoCaptureDevice::CaptureUsingClientBuffers, |
- weak_factory_.GetWeakPtr(), pixel_format)); |
+ weak_factory_.GetWeakPtr(), pixel_format, pixel_storage)); |
} |
void FakeVideoCaptureDevice::BeepAndScheduleNextCapture( |