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

Unified Diff: media/capture/screen_capture_device_core.cc

Issue 1204063005: Reland: Video Capture: extract storage info from pixel format in VideoCaptureFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheng@ nit on DCHECK_EQ(expected, actual) Created 5 years, 6 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_capture_types.cc ('k') | media/capture/thread_safe_capture_oracle.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/screen_capture_device_core.cc
diff --git a/media/capture/screen_capture_device_core.cc b/media/capture/screen_capture_device_core.cc
index a8993e7ef897b64691500c27b04eedcfbf7d2293..3705eadab1338eb332550c27e892d5001df1bbaf 100644
--- a/media/capture/screen_capture_device_core.cc
+++ b/media/capture/screen_capture_device_core.cc
@@ -41,17 +41,19 @@ void ScreenCaptureDeviceCore::AllocateAndStart(
return;
}
- if (params.requested_format.pixel_format != PIXEL_FORMAT_I420 &&
- params.requested_format.pixel_format != PIXEL_FORMAT_TEXTURE) {
- std::string error_msg = base::StringPrintf(
- "unsupported format: %d", params.requested_format.pixel_format);
+ if (!(params.requested_format.pixel_format == PIXEL_FORMAT_I420 &&
+ params.requested_format.pixel_storage == PIXEL_STORAGE_CPU) &&
+ !(params.requested_format.pixel_format == PIXEL_FORMAT_ARGB &&
+ params.requested_format.pixel_storage == PIXEL_STORAGE_TEXTURE)) {
+ const std::string error_msg = base::StringPrintf(
+ "unsupported format: %s", params.requested_format.ToString().c_str());
DVLOG(1) << error_msg;
client->OnError(error_msg);
return;
}
if (params.requested_format.frame_size.IsEmpty()) {
- std::string error_msg =
+ const std::string error_msg =
"invalid frame size: " + params.requested_format.frame_size.ToString();
DVLOG(1) << error_msg;
client->OnError(error_msg);
« no previous file with comments | « media/base/video_capture_types.cc ('k') | media/capture/thread_safe_capture_oracle.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698