| 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/video/capture/win/video_capture_device_win.h" | 5 #include "media/video/capture/win/video_capture_device_win.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // and DirectShow for any other platforms. | 156 // and DirectShow for any other platforms. |
| 157 if (base::win::IsMetroProcess() && | 157 if (base::win::IsMetroProcess() && |
| 158 !cmd_line->HasSwitch(switches::kForceDirectShowVideoCapture)) { | 158 !cmd_line->HasSwitch(switches::kForceDirectShowVideoCapture)) { |
| 159 VideoCaptureDeviceMFWin::GetDeviceNames(device_names); | 159 VideoCaptureDeviceMFWin::GetDeviceNames(device_names); |
| 160 } else { | 160 } else { |
| 161 VideoCaptureDeviceWin::GetDeviceNames(device_names); | 161 VideoCaptureDeviceWin::GetDeviceNames(device_names); |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 // static | 165 // static |
| 166 void VideoCaptureDevice::GetDeviceSupportedFormats(const Name& device, |
| 167 VideoCaptureCapabilities* formats) { |
| 168 NOTIMPLEMENTED(); |
| 169 } |
| 170 |
| 171 // static |
| 166 VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) { | 172 VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) { |
| 167 VideoCaptureDevice* ret = NULL; | 173 VideoCaptureDevice* ret = NULL; |
| 168 if (device_name.capture_api_type() == Name::MEDIA_FOUNDATION) { | 174 if (device_name.capture_api_type() == Name::MEDIA_FOUNDATION) { |
| 169 DCHECK(VideoCaptureDeviceMFWin::PlatformSupported()); | 175 DCHECK(VideoCaptureDeviceMFWin::PlatformSupported()); |
| 170 scoped_ptr<VideoCaptureDeviceMFWin> device( | 176 scoped_ptr<VideoCaptureDeviceMFWin> device( |
| 171 new VideoCaptureDeviceMFWin(device_name)); | 177 new VideoCaptureDeviceMFWin(device_name)); |
| 172 DVLOG(1) << " MediaFoundation Device: " << device_name.name(); | 178 DVLOG(1) << " MediaFoundation Device: " << device_name.name(); |
| 173 if (device->Init()) | 179 if (device->Init()) |
| 174 ret = device.release(); | 180 ret = device.release(); |
| 175 } else if (device_name.capture_api_type() == Name::DIRECT_SHOW) { | 181 } else if (device_name.capture_api_type() == Name::DIRECT_SHOW) { |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 return !capabilities_.empty(); | 594 return !capabilities_.empty(); |
| 589 } | 595 } |
| 590 | 596 |
| 591 void VideoCaptureDeviceWin::SetErrorState(const char* reason) { | 597 void VideoCaptureDeviceWin::SetErrorState(const char* reason) { |
| 592 DCHECK(CalledOnValidThread()); | 598 DCHECK(CalledOnValidThread()); |
| 593 DVLOG(1) << reason; | 599 DVLOG(1) << reason; |
| 594 state_ = kError; | 600 state_ = kError; |
| 595 client_->OnError(); | 601 client_->OnError(); |
| 596 } | 602 } |
| 597 } // namespace media | 603 } // namespace media |
| OLD | NEW |