OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/video/win/video_capture_device_mf_win.h" | 5 #include "media/capture/video/win/video_capture_device_mf_win.h" |
6 | 6 |
7 #include <mfapi.h> | 7 #include <mfapi.h> |
8 #include <mferror.h> | 8 #include <mferror.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
| 11 #include <utility> |
| 12 |
11 #include "base/location.h" | 13 #include "base/location.h" |
12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
13 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
14 #include "base/strings/sys_string_conversions.h" | 16 #include "base/strings/sys_string_conversions.h" |
15 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
16 #include "base/win/scoped_co_mem.h" | 18 #include "base/win/scoped_co_mem.h" |
17 #include "base/win/windows_version.h" | 19 #include "base/win/windows_version.h" |
18 #include "media/capture/video/win/capability_list_win.h" | 20 #include "media/capture/video/win/capability_list_win.h" |
19 | 21 |
20 using base::win::ScopedCoMem; | 22 using base::win::ScopedCoMem; |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 source.get(), attributes.get(), reader_.Receive())); | 229 source.get(), attributes.get(), reader_.Receive())); |
228 } | 230 } |
229 | 231 |
230 void VideoCaptureDeviceMFWin::AllocateAndStart( | 232 void VideoCaptureDeviceMFWin::AllocateAndStart( |
231 const VideoCaptureParams& params, | 233 const VideoCaptureParams& params, |
232 scoped_ptr<VideoCaptureDevice::Client> client) { | 234 scoped_ptr<VideoCaptureDevice::Client> client) { |
233 DCHECK(CalledOnValidThread()); | 235 DCHECK(CalledOnValidThread()); |
234 | 236 |
235 base::AutoLock lock(lock_); | 237 base::AutoLock lock(lock_); |
236 | 238 |
237 client_ = client.Pass(); | 239 client_ = std::move(client); |
238 DCHECK_EQ(capture_, false); | 240 DCHECK_EQ(capture_, false); |
239 | 241 |
240 CapabilityList capabilities; | 242 CapabilityList capabilities; |
241 HRESULT hr = S_OK; | 243 HRESULT hr = S_OK; |
242 if (reader_.get()) { | 244 if (reader_.get()) { |
243 hr = FillCapabilities(reader_.get(), &capabilities); | 245 hr = FillCapabilities(reader_.get(), &capabilities); |
244 if (SUCCEEDED(hr)) { | 246 if (SUCCEEDED(hr)) { |
245 const CapabilityWin found_capability = | 247 const CapabilityWin found_capability = |
246 GetBestMatchedCapability(params.requested_format, capabilities); | 248 GetBestMatchedCapability(params.requested_format, capabilities); |
247 ScopedComPtr<IMFMediaType> type; | 249 ScopedComPtr<IMFMediaType> type; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 HRESULT hr) { | 325 HRESULT hr) { |
324 if (client_.get()) { | 326 if (client_.get()) { |
325 client_->OnError( | 327 client_->OnError( |
326 from_here, | 328 from_here, |
327 base::StringPrintf("VideoCaptureDeviceMFWin: %s", | 329 base::StringPrintf("VideoCaptureDeviceMFWin: %s", |
328 logging::SystemErrorCodeToString(hr).c_str())); | 330 logging::SystemErrorCodeToString(hr).c_str())); |
329 } | 331 } |
330 } | 332 } |
331 | 333 |
332 } // namespace media | 334 } // namespace media |
OLD | NEW |