| 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 7a1109683f2bad25820529dd251610aff75cc9b1..ae7c07bc042558e63207efad091e35aaedfb656b 100644
|
| --- a/media/video/capture/fake_video_capture_device.cc
|
| +++ b/media/video/capture/fake_video_capture_device.cc
|
| @@ -92,8 +92,9 @@ void FakeVideoCaptureDevice::Allocate(
|
| capture_format_.frame_rate = 30;
|
| }
|
|
|
| - size_t fake_frame_size =
|
| - capture_format_.width * capture_format_.height * 3 / 2;
|
| + const size_t fake_frame_size = VideoFrame::AllocationSize(
|
| + VideoFrame::I420,
|
| + gfx::Size(capture_format_.width, capture_format_.height));
|
| fake_frame_.reset(new uint8[fake_frame_size]);
|
|
|
| state_ = kAllocated;
|
| @@ -108,8 +109,9 @@ void FakeVideoCaptureDevice::Reallocate() {
|
| DVLOG(3) << "Reallocating FakeVideoCaptureDevice, new capture resolution ("
|
| << capture_format_.width << "x" << capture_format_.height << ")";
|
|
|
| - size_t fake_frame_size =
|
| - capture_format_.width * capture_format_.height * 3 / 2;
|
| + const size_t fake_frame_size = VideoFrame::AllocationSize(
|
| + VideoFrame::I420,
|
| + gfx::Size(capture_format_.width, capture_format_.height));
|
| fake_frame_.reset(new uint8[fake_frame_size]);
|
|
|
| observer_->OnFrameInfoChanged(capture_format_);
|
| @@ -152,7 +154,9 @@ void FakeVideoCaptureDevice::OnCaptureTask() {
|
| return;
|
| }
|
|
|
| - int frame_size = capture_format_.width * capture_format_.height * 3 / 2;
|
| + const size_t frame_size = VideoFrame::AllocationSize(
|
| + VideoFrame::I420,
|
| + gfx::Size(capture_format_.width, capture_format_.height));
|
| memset(fake_frame_.get(), 0, frame_size);
|
|
|
| SkBitmap bitmap;
|
|
|