| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 | 373 |
| 374 GUID type_guid; | 374 GUID type_guid; |
| 375 hr = type->GetGUID(MF_MT_SUBTYPE, &type_guid); | 375 hr = type->GetGUID(MF_MT_SUBTYPE, &type_guid); |
| 376 if (FAILED(hr)) { | 376 if (FAILED(hr)) { |
| 377 DLOG(ERROR) << "GetGUID failed: " << logging::SystemErrorCodeToString(hr); | 377 DLOG(ERROR) << "GetGUID failed: " << logging::SystemErrorCodeToString(hr); |
| 378 return; | 378 return; |
| 379 } | 379 } |
| 380 VideoCaptureDeviceMFWin::FormatFromGuid(type_guid, | 380 VideoCaptureDeviceMFWin::FormatFromGuid(type_guid, |
| 381 &capture_format.pixel_format); | 381 &capture_format.pixel_format); |
| 382 type.Release(); | 382 type.Release(); |
| 383 ++stream_index; |
| 384 if (capture_format.pixel_format == PIXEL_FORMAT_UNKNOWN) |
| 385 continue; |
| 383 formats->push_back(capture_format); | 386 formats->push_back(capture_format); |
| 384 ++stream_index; | |
| 385 | 387 |
| 386 DVLOG(1) << descriptor.display_name << " " | 388 DVLOG(1) << descriptor.display_name << " " |
| 387 << VideoCaptureFormat::ToString(capture_format); | 389 << VideoCaptureFormat::ToString(capture_format); |
| 388 } | 390 } |
| 389 } | 391 } |
| 390 | 392 |
| 391 // Returns true iff the current platform supports the Media Foundation API | 393 // Returns true iff the current platform supports the Media Foundation API |
| 392 // and that the DLLs are available. On Vista this API is an optional download | 394 // and that the DLLs are available. On Vista this API is an optional download |
| 393 // but the API is advertised as a part of Windows 7 and onwards. However, | 395 // but the API is advertised as a part of Windows 7 and onwards. However, |
| 394 // we've seen that the required DLLs are not available in some Win7 | 396 // we've seen that the required DLLs are not available in some Win7 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 } | 459 } |
| 458 | 460 |
| 459 // static | 461 // static |
| 460 VideoCaptureDeviceFactory* | 462 VideoCaptureDeviceFactory* |
| 461 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( | 463 VideoCaptureDeviceFactory::CreateVideoCaptureDeviceFactory( |
| 462 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 464 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
| 463 return new VideoCaptureDeviceFactoryWin(); | 465 return new VideoCaptureDeviceFactoryWin(); |
| 464 } | 466 } |
| 465 | 467 |
| 466 } // namespace media | 468 } // namespace media |
| OLD | NEW |