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

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

Issue 848863002: PPAPI: implement GetSupportedPreviewSizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error on Linux build 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/video_capture_types.cc
diff --git a/media/video/capture/video_capture_types.cc b/media/video/capture/video_capture_types.cc
index 590b016d998c0c8acd42f191fd7f5029660a3c1c..d4fb51a576972dfd56c6008e535c5e6e975ca1e2 100644
--- a/media/video/capture/video_capture_types.cc
+++ b/media/video/capture/video_capture_types.cc
@@ -75,9 +75,28 @@ VideoCaptureParams::VideoCaptureParams()
ImageCaptureFormat::ImageCaptureFormat() : pixel_format(PIXEL_FORMAT_UNKNOWN) {
}
+bool ImageCaptureFormat::IsValid() const {
+ return (frame_size.width() < media::limits::kMaxDimension) &&
+ (frame_size.height() < media::limits::kMaxDimension) &&
wuchengli 2015/01/19 14:05:03 This is the limit for video. Image capture shouldn
Justin Chuang 2015/01/26 15:00:50 Removed the class completely.
+ (frame_size.GetArea() >= 0) &&
+ (frame_size.GetArea() < media::limits::kMaxCanvas) &&
+ (pixel_format >= PIXEL_FORMAT_UNKNOWN) &&
+ (pixel_format < PIXEL_FORMAT_MAX);
+}
+
+std::string ImageCaptureFormat::ToString() const {
+ return base::StringPrintf(
+ "resolution: %s, pixel format: %s",
+ frame_size.ToString().c_str(),
+ VideoCaptureFormat::PixelFormatToString(pixel_format).c_str());
+}
+
ImageCaptureFormat::ImageCaptureFormat(const gfx::Size& frame_size,
VideoPixelFormat pixel_format)
: frame_size(frame_size), pixel_format(pixel_format) {
}
+ImageCaptureParams::ImageCaptureParams() {
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698