| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // VideoCaptureDevice implementation. | 49 // VideoCaptureDevice implementation. |
| 50 void AllocateAndStart( | 50 void AllocateAndStart( |
| 51 const VideoCaptureParams& params, | 51 const VideoCaptureParams& params, |
| 52 std::unique_ptr<VideoCaptureDevice::Client> client) override; | 52 std::unique_ptr<VideoCaptureDevice::Client> client) override; |
| 53 void StopAndDeAllocate() override; | 53 void StopAndDeAllocate() override; |
| 54 | 54 |
| 55 // Captured new video data. | 55 // Captured new video data. |
| 56 void OnIncomingCapturedData(const uint8_t* data, | 56 void OnIncomingCapturedData(const uint8_t* data, |
| 57 int length, | 57 int length, |
| 58 int rotation, | 58 int rotation, |
| 59 const base::TimeTicks& time_stamp); | 59 base::TimeTicks reference_time, |
| 60 base::TimeDelta timestamp); |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 void OnError(const tracked_objects::Location& from_here, HRESULT hr); | 63 void OnError(const tracked_objects::Location& from_here, HRESULT hr); |
| 63 | 64 |
| 64 Name name_; | 65 Name name_; |
| 65 base::win::ScopedComPtr<IMFActivate> device_; | 66 base::win::ScopedComPtr<IMFActivate> device_; |
| 66 scoped_refptr<MFReaderCallback> callback_; | 67 scoped_refptr<MFReaderCallback> callback_; |
| 67 | 68 |
| 68 base::Lock lock_; // Used to guard the below variables. | 69 base::Lock lock_; // Used to guard the below variables. |
| 69 std::unique_ptr<VideoCaptureDevice::Client> client_; | 70 std::unique_ptr<VideoCaptureDevice::Client> client_; |
| 70 base::win::ScopedComPtr<IMFSourceReader> reader_; | 71 base::win::ScopedComPtr<IMFSourceReader> reader_; |
| 71 VideoCaptureFormat capture_format_; | 72 VideoCaptureFormat capture_format_; |
| 72 bool capture_; | 73 bool capture_; |
| 73 | 74 |
| 74 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceMFWin); | 75 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoCaptureDeviceMFWin); |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 } // namespace media | 78 } // namespace media |
| 78 | 79 |
| 79 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ | 80 #endif // MEDIA_VIDEO_CAPTURE_WIN_VIDEO_CAPTURE_DEVICE_MF_WIN_H_ |
| OLD | NEW |