| OLD | NEW |
| 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/video/win/video_capture_device_factory_win.h" | 5 #include "media/capture/video/win/video_capture_device_factory_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 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 | 339 |
| 340 GUID type_guid; | 340 GUID type_guid; |
| 341 hr = type->GetGUID(MF_MT_SUBTYPE, &type_guid); | 341 hr = type->GetGUID(MF_MT_SUBTYPE, &type_guid); |
| 342 if (FAILED(hr)) { | 342 if (FAILED(hr)) { |
| 343 DLOG(ERROR) << "GetGUID failed: " << logging::SystemErrorCodeToString(hr); | 343 DLOG(ERROR) << "GetGUID failed: " << logging::SystemErrorCodeToString(hr); |
| 344 return; | 344 return; |
| 345 } | 345 } |
| 346 VideoCaptureDeviceMFWin::FormatFromGuid(type_guid, | 346 VideoCaptureDeviceMFWin::FormatFromGuid(type_guid, |
| 347 &capture_format.pixel_format); | 347 &capture_format.pixel_format); |
| 348 type.Release(); | 348 type.Release(); |
| 349 ++stream_index; |
| 350 if (capture_format.pixel_format == PIXEL_FORMAT_UNKNOWN) |
| 351 continue; |
| 349 formats->push_back(capture_format); | 352 formats->push_back(capture_format); |
| 350 ++stream_index; | |
| 351 | 353 |
| 352 DVLOG(1) << device.name() << " " | 354 DVLOG(1) << device.name() << " " |
| 353 << VideoCaptureFormat::ToString(capture_format); | 355 << VideoCaptureFormat::ToString(capture_format); |
| 354 } | 356 } |
| 355 } | 357 } |
| 356 | 358 |
| 357 // Returns true iff the current platform supports the Media Foundation API | 359 // Returns true iff the current platform supports the Media Foundation API |
| 358 // and that the DLLs are available. On Vista this API is an optional download | 360 // and that the DLLs are available. On Vista this API is an optional download |
| 359 // but the API is advertised as a part of Windows 7 and onwards. However, | 361 // but the API is advertised as a part of Windows 7 and onwards. However, |
| 360 // we've seen that the required DLLs are not available in some Win7 | 362 // we've seen that the required DLLs are not available in some Win7 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 422 } |
| 421 | 423 |
| 422 // static | 424 // static |
| 423 VideoCaptureDeviceFactory* | 425 VideoCaptureDeviceFactory* |
| 424 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 426 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
| 425 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 427 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 426 return new VideoCaptureDeviceFactoryWin(); | 428 return new VideoCaptureDeviceFactoryWin(); |
| 427 } | 429 } |
| 428 | 430 |
| 429 } // namespace media | 431 } // namespace media |
| OLD | NEW |