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

Side by Side Diff: media/video/capture/win/video_capture_device_win.cc

Issue 270263008: Add a ChromeOS implementation of VideoCaptureDevice (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « media/video/capture/video_capture_device_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/video/capture/win/video_capture_device_win.h" 5 #include "media/video/capture/win/video_capture_device_win.h"
6 6
7 #include <ks.h> 7 #include <ks.h>
8 #include <ksmedia.h> 8 #include <ksmedia.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 !cmd_line->HasSwitch(switches::kForceDirectShowVideoCapture)) || 238 !cmd_line->HasSwitch(switches::kForceDirectShowVideoCapture)) ||
239 (base::win::GetVersion() >= base::win::VERSION_WIN7 && 239 (base::win::GetVersion() >= base::win::VERSION_WIN7 &&
240 cmd_line->HasSwitch(switches::kForceMediaFoundationVideoCapture))) { 240 cmd_line->HasSwitch(switches::kForceMediaFoundationVideoCapture))) {
241 VideoCaptureDeviceMFWin::GetDeviceSupportedFormats(device, formats); 241 VideoCaptureDeviceMFWin::GetDeviceSupportedFormats(device, formats);
242 } else { 242 } else {
243 VideoCaptureDeviceWin::GetDeviceSupportedFormats(device, formats); 243 VideoCaptureDeviceWin::GetDeviceSupportedFormats(device, formats);
244 } 244 }
245 } 245 }
246 246
247 // static 247 // static
248 VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) { 248 VideoCaptureDevice* VideoCaptureDevice::Create(
249 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner,
250 const Name& device_name) {
249 VideoCaptureDevice* ret = NULL; 251 VideoCaptureDevice* ret = NULL;
250 if (device_name.capture_api_type() == Name::MEDIA_FOUNDATION) { 252 if (device_name.capture_api_type() == Name::MEDIA_FOUNDATION) {
251 DCHECK(VideoCaptureDeviceMFWin::PlatformSupported()); 253 DCHECK(VideoCaptureDeviceMFWin::PlatformSupported());
252 scoped_ptr<VideoCaptureDeviceMFWin> device( 254 scoped_ptr<VideoCaptureDeviceMFWin> device(
253 new VideoCaptureDeviceMFWin(device_name)); 255 new VideoCaptureDeviceMFWin(device_name));
254 DVLOG(1) << " MediaFoundation Device: " << device_name.name(); 256 DVLOG(1) << " MediaFoundation Device: " << device_name.name();
255 if (device->Init()) 257 if (device->Init())
256 ret = device.release(); 258 ret = device.release();
257 } else if (device_name.capture_api_type() == Name::DIRECT_SHOW) { 259 } else if (device_name.capture_api_type() == Name::DIRECT_SHOW) {
258 scoped_ptr<VideoCaptureDeviceWin> device( 260 scoped_ptr<VideoCaptureDeviceWin> device(
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
789 } 791 }
790 } 792 }
791 793
792 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { 794 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) {
793 DCHECK(CalledOnValidThread()); 795 DCHECK(CalledOnValidThread());
794 DVLOG(1) << reason; 796 DVLOG(1) << reason;
795 state_ = kError; 797 state_ = kError;
796 client_->OnError(reason); 798 client_->OnError(reason);
797 } 799 }
798 } // namespace media 800 } // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/video_capture_device_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698