| 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_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ | 9 #ifndef MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ |
| 10 #define MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ | 10 #define MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // but the API is advertised as a part of Windows 7 and onwards. However, | 48 // but the API is advertised as a part of Windows 7 and onwards. However, |
| 49 // we've seen that the required DLLs are not available in some Win7 | 49 // we've seen that the required DLLs are not available in some Win7 |
| 50 // distributions such as Windows 7 N and Windows 7 KN. | 50 // distributions such as Windows 7 N and Windows 7 KN. |
| 51 static bool PlatformSupported(); | 51 static bool PlatformSupported(); |
| 52 | 52 |
| 53 static void GetDeviceNames(Names* device_names); | 53 static void GetDeviceNames(Names* device_names); |
| 54 | 54 |
| 55 // Captured a new video frame. | 55 // Captured a new video frame. |
| 56 void OnIncomingCapturedFrame(const uint8* data, | 56 void OnIncomingCapturedFrame(const uint8* data, |
| 57 int length, | 57 int length, |
| 58 const base::TimeTicks& time_stamp, | 58 int rotation, |
| 59 int rotation); | 59 const base::TimeTicks& time_stamp); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 void OnError(HRESULT hr); | 62 void OnError(HRESULT hr); |
| 63 | 63 |
| 64 Name name_; | 64 Name name_; |
| 65 base::win::ScopedComPtr<IMFActivate> device_; | 65 base::win::ScopedComPtr<IMFActivate> device_; |
| 66 scoped_refptr<MFReaderCallback> callback_; | 66 scoped_refptr<MFReaderCallback> callback_; |
| 67 | 67 |
| 68 base::Lock lock_; // Used to guard the below variables. | 68 base::Lock lock_; // Used to guard the below variables. |
| 69 scoped_ptr<VideoCaptureDevice::Client> client_; | 69 scoped_ptr<VideoCaptureDevice::Client> client_; |
| 70 base::win::ScopedComPtr<IMFSourceReader> reader_; | 70 base::win::ScopedComPtr<IMFSourceReader> reader_; |
| 71 VideoCaptureFormat capture_format_; | 71 VideoCaptureFormat capture_format_; |
| 72 bool capture_; | 72 bool capture_; |
| 73 | 73 |
| 74 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceMFWin); | 74 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceMFWin); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace media | 77 } // namespace media |
| 78 | 78 |
| 79 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ | 79 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ |
| OLD | NEW |