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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/capture/screen_capture_device_core.h" 5 #include "media/capture/screen_capture_device_core.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 if (params.requested_format.frame_rate <= 0) { 36 if (params.requested_format.frame_rate <= 0) {
37 std::string error_msg("Invalid frame_rate: "); 37 std::string error_msg("Invalid frame_rate: ");
38 error_msg += base::DoubleToString(params.requested_format.frame_rate); 38 error_msg += base::DoubleToString(params.requested_format.frame_rate);
39 DVLOG(1) << error_msg; 39 DVLOG(1) << error_msg;
40 client->OnError(error_msg); 40 client->OnError(error_msg);
41 return; 41 return;
42 } 42 }
43 43
44 if (params.requested_format.pixel_format != PIXEL_FORMAT_I420 && 44 if (!(params.requested_format.pixel_format == PIXEL_FORMAT_I420 &&
45 params.requested_format.pixel_format != PIXEL_FORMAT_TEXTURE) { 45 params.requested_format.pixel_storage == PIXEL_STORAGE_CPU) &&
46 std::string error_msg = base::StringPrintf( 46 !(params.requested_format.pixel_format == PIXEL_FORMAT_ARGB &&
47 "unsupported format: %d", params.requested_format.pixel_format); 47 params.requested_format.pixel_storage == PIXEL_STORAGE_TEXTURE)) {
48 const std::string error_msg = base::StringPrintf(
49 "unsupported format: %s", params.requested_format.ToString().c_str());
48 DVLOG(1) << error_msg; 50 DVLOG(1) << error_msg;
49 client->OnError(error_msg); 51 client->OnError(error_msg);
50 return; 52 return;
51 } 53 }
52 54
53 if (params.requested_format.frame_size.IsEmpty()) { 55 if (params.requested_format.frame_size.IsEmpty()) {
54 std::string error_msg = 56 const std::string error_msg =
55 "invalid frame size: " + params.requested_format.frame_size.ToString(); 57 "invalid frame size: " + params.requested_format.frame_size.ToString();
56 DVLOG(1) << error_msg; 58 DVLOG(1) << error_msg;
57 client->OnError(error_msg); 59 client->OnError(error_msg);
58 return; 60 return;
59 } 61 }
60 62
61 oracle_proxy_ = new ThreadSafeCaptureOracle(client.Pass(), params); 63 oracle_proxy_ = new ThreadSafeCaptureOracle(client.Pass(), params);
62 64
63 capture_machine_->Start( 65 capture_machine_->Start(
64 oracle_proxy_, 66 oracle_proxy_,
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return; 131 return;
130 132
131 if (oracle_proxy_.get()) 133 if (oracle_proxy_.get())
132 oracle_proxy_->ReportError(reason); 134 oracle_proxy_->ReportError(reason);
133 135
134 StopAndDeAllocate(); 136 StopAndDeAllocate();
135 TransitionStateTo(kError); 137 TransitionStateTo(kError);
136 } 138 }
137 139
138 } // namespace media 140 } // namespace media
OLDNEW
« 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