| 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 // Windows specific implementation of VideoCaptureDevice. | 5 // Windows specific implementation of VideoCaptureDevice. |
| 6 // DirectShow is used for capturing. DirectShow provide its own threads | 6 // DirectShow is used for capturing. DirectShow provide its own threads |
| 7 // for capturing. | 7 // for capturing. |
| 8 | 8 |
| 9 #ifndef MEDIA_CAPTURE_VIDEO_WIN_CAPABILITY_LIST_WIN_H_ | 9 #ifndef DEVICE_CAPTURE_VIDEO_WIN_CAPABILITY_LIST_WIN_H_ |
| 10 #define MEDIA_CAPTURE_VIDEO_WIN_CAPABILITY_LIST_WIN_H_ | 10 #define DEVICE_CAPTURE_VIDEO_WIN_CAPABILITY_LIST_WIN_H_ |
| 11 | 11 |
| 12 #include <list> | 12 #include <list> |
| 13 #include <windows.h> | 13 #include <windows.h> |
| 14 | 14 |
| 15 #include "media/base/video_capture_types.h" | 15 #include "media/base/video_capture_types.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace device { |
| 18 |
| 19 using media::VideoCaptureFormat; |
| 18 | 20 |
| 19 struct CapabilityWin { | 21 struct CapabilityWin { |
| 20 CapabilityWin(int index, const VideoCaptureFormat& format) | 22 CapabilityWin(int index, const VideoCaptureFormat& format) |
| 21 : stream_index(index), supported_format(format), info_header() {} | 23 : stream_index(index), supported_format(format), info_header() {} |
| 22 | 24 |
| 23 // Used by VideoCaptureDeviceWin. | 25 // Used by VideoCaptureDeviceWin. |
| 24 CapabilityWin(int index, | 26 CapabilityWin(int index, |
| 25 const VideoCaptureFormat& format, | 27 const VideoCaptureFormat& format, |
| 26 const BITMAPINFOHEADER& info_header) | 28 const BITMAPINFOHEADER& info_header) |
| 27 : stream_index(index), | 29 : stream_index(index), |
| 28 supported_format(format), | 30 supported_format(format), |
| 29 info_header(info_header) {} | 31 info_header(info_header) {} |
| 30 | 32 |
| 31 const int stream_index; | 33 const int stream_index; |
| 32 const VideoCaptureFormat supported_format; | 34 const VideoCaptureFormat supported_format; |
| 33 | 35 |
| 34 // |info_header| is only valid if DirectShow is used. | 36 // |info_header| is only valid if DirectShow is used. |
| 35 const BITMAPINFOHEADER info_header; | 37 const BITMAPINFOHEADER info_header; |
| 36 }; | 38 }; |
| 37 | 39 |
| 38 typedef std::list<CapabilityWin> CapabilityList; | 40 typedef std::list<CapabilityWin> CapabilityList; |
| 39 | 41 |
| 40 const CapabilityWin& GetBestMatchedCapability( | 42 const CapabilityWin& GetBestMatchedCapability( |
| 41 const VideoCaptureFormat& requested, | 43 const VideoCaptureFormat& requested, |
| 42 const CapabilityList& capabilities); | 44 const CapabilityList& capabilities); |
| 43 | 45 |
| 44 } // namespace media | 46 } // namespace device |
| 45 | 47 |
| 46 #endif // MEDIA_CAPTURE_VIDEO_WIN_CAPABILITY_LIST_WIN_H_ | 48 #endif // DEVICE_CAPTURE_VIDEO_WIN_CAPABILITY_LIST_WIN_H_ |
| OLD | NEW |