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

Side by Side Diff: device/capture/content/screen_capture_device_core.cc

Issue 2214533002: move //media/capture to //device/capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
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/content/screen_capture_device_core.h" 5 #include "device/capture/content/screen_capture_device_core.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "base/strings/stringprintf.h" 15 #include "base/strings/stringprintf.h"
16 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
17 17
18 namespace media { 18 namespace device {
19 19
20 namespace { 20 namespace {
21 21
22 void DeleteCaptureMachine( 22 void DeleteCaptureMachine(
23 std::unique_ptr<VideoCaptureMachine> capture_machine) { 23 std::unique_ptr<VideoCaptureMachine> capture_machine) {
24 capture_machine.reset(); 24 capture_machine.reset();
25 } 25 }
26 26
27 } // namespace 27 } // namespace
28 28
(...skipping 10 matching lines...) Expand all
39 void ScreenCaptureDeviceCore::AllocateAndStart( 39 void ScreenCaptureDeviceCore::AllocateAndStart(
40 const VideoCaptureParams& params, 40 const VideoCaptureParams& params,
41 std::unique_ptr<VideoCaptureDevice::Client> client) { 41 std::unique_ptr<VideoCaptureDevice::Client> client) {
42 DCHECK(thread_checker_.CalledOnValidThread()); 42 DCHECK(thread_checker_.CalledOnValidThread());
43 43
44 if (state_ != kIdle) { 44 if (state_ != kIdle) {
45 DVLOG(1) << "Allocate() invoked when not in state Idle."; 45 DVLOG(1) << "Allocate() invoked when not in state Idle.";
46 return; 46 return;
47 } 47 }
48 48
49 if (params.requested_format.pixel_format != PIXEL_FORMAT_I420 || 49 if (params.requested_format.pixel_format != media::PIXEL_FORMAT_I420 ||
50 params.requested_format.pixel_storage != PIXEL_STORAGE_CPU) { 50 params.requested_format.pixel_storage != media::PIXEL_STORAGE_CPU) {
51 client->OnError( 51 client->OnError(
52 FROM_HERE, 52 FROM_HERE,
53 base::StringPrintf( 53 base::StringPrintf(
54 "unsupported format: %s", 54 "unsupported format: %s",
55 VideoCaptureFormat::ToString(params.requested_format).c_str())); 55 VideoCaptureFormat::ToString(params.requested_format).c_str()));
56 return; 56 return;
57 } 57 }
58 58
59 oracle_proxy_ = new ThreadSafeCaptureOracle( 59 oracle_proxy_ = new ThreadSafeCaptureOracle(
60 std::move(client), params, capture_machine_->IsAutoThrottlingEnabled()); 60 std::move(client), params, capture_machine_->IsAutoThrottlingEnabled());
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 if (state_ == kIdle) 134 if (state_ == kIdle)
135 return; 135 return;
136 136
137 if (oracle_proxy_.get()) 137 if (oracle_proxy_.get())
138 oracle_proxy_->ReportError(from_here, reason); 138 oracle_proxy_->ReportError(from_here, reason);
139 139
140 StopAndDeAllocate(); 140 StopAndDeAllocate();
141 TransitionStateTo(kError); 141 TransitionStateTo(kError);
142 } 142 }
143 143
144 } // namespace media 144 } // namespace device
OLDNEW
« no previous file with comments | « device/capture/content/screen_capture_device_core.h ('k') | device/capture/content/smooth_event_sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698