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

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

Issue 22875047: EVEA cleanup: use video utility functions in media::* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@git-svn
Patch Set: b2b1b2ee Last comments. Created 7 years, 4 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
« no previous file with comments | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « media/base/video_frame.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698