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

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

Issue 897483002: Refactored pixel format resize operations in media/video/capture into a function called VideoCaptu… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed function to a public member. Added tests. Created 5 years, 11 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: media/video/capture/file_video_capture_device.cc
diff --git a/media/video/capture/file_video_capture_device.cc b/media/video/capture/file_video_capture_device.cc
index 24673aa45934d824faba863e65c650c925587f19..11172ca8f75e6f1821c112a59568057461c79ec1 100644
--- a/media/video/capture/file_video_capture_device.cc
+++ b/media/video/capture/file_video_capture_device.cc
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
+#include "media/video/capture/video_capture_types.h"
namespace media {
static const int kY4MHeaderMaxSize = 200;
@@ -172,7 +173,7 @@ void FileVideoCaptureDevice::StopAndDeAllocate() {
int FileVideoCaptureDevice::CalculateFrameSize() {
mcasas 2015/02/03 20:48:46 I suspect this method can be made const (in the d
DCHECK_EQ(capture_format_.pixel_format, PIXEL_FORMAT_I420);
DCHECK_EQ(capture_thread_.message_loop(), base::MessageLoop::current());
- return capture_format_.frame_size.GetArea() * 12 / 8;
+ return capture_format_.ImageAllocationSize();
}
void FileVideoCaptureDevice::OnAllocateAndStart(

Powered by Google App Engine
This is Rietveld 408576698