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