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 // MacOSX implementation of generic VideoCaptureDevice, using AVFoundation as | 5 // MacOSX implementation of generic VideoCaptureDevice, using AVFoundation as |
6 // native capture API. AVFoundation is available in versions 10.7 (Lion) and | 6 // native capture API. AVFoundation is available in versions 10.7 (Lion) and |
7 // later. | 7 // later. |
8 | 8 |
9 #ifndef MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 9 #ifndef MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
10 #define MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 10 #define MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 explicit VideoCaptureDeviceMac( | 57 explicit VideoCaptureDeviceMac( |
58 const VideoCaptureDeviceDescriptor& device_descriptor); | 58 const VideoCaptureDeviceDescriptor& device_descriptor); |
59 ~VideoCaptureDeviceMac() override; | 59 ~VideoCaptureDeviceMac() override; |
60 | 60 |
61 // VideoCaptureDevice implementation. | 61 // VideoCaptureDevice implementation. |
62 void AllocateAndStart( | 62 void AllocateAndStart( |
63 const VideoCaptureParams& params, | 63 const VideoCaptureParams& params, |
64 std::unique_ptr<VideoCaptureDevice::Client> client) override; | 64 std::unique_ptr<VideoCaptureDevice::Client> client) override; |
65 void StopAndDeAllocate() override; | 65 void StopAndDeAllocate() override; |
66 void TakePhoto(TakePhotoCallback callback) override; | 66 void TakePhoto(TakePhotoCallback callback) override; |
| 67 void GetPhotoCapabilities(GetPhotoCapabilitiesCallback callback) override; |
67 | 68 |
68 bool Init(VideoCaptureApi capture_api_type); | 69 bool Init(VideoCaptureApi capture_api_type); |
69 | 70 |
70 // Called to deliver captured video frames. It's safe to call this method | 71 // Called to deliver captured video frames. It's safe to call this method |
71 // from any thread, including those controlled by AVFoundation. | 72 // from any thread, including those controlled by AVFoundation. |
72 void ReceiveFrame(const uint8_t* video_frame, | 73 void ReceiveFrame(const uint8_t* video_frame, |
73 int video_frame_length, | 74 int video_frame_length, |
74 const VideoCaptureFormat& frame_format, | 75 const VideoCaptureFormat& frame_format, |
75 int aspect_numerator, | 76 int aspect_numerator, |
76 int aspect_denominator, | 77 int aspect_denominator, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // VideoCaptureDeviceMac is destroyed. | 121 // VideoCaptureDeviceMac is destroyed. |
121 // NOTE: Weak pointers must be invalidated before all other member variables. | 122 // NOTE: Weak pointers must be invalidated before all other member variables. |
122 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; | 123 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; |
123 | 124 |
124 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); | 125 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); |
125 }; | 126 }; |
126 | 127 |
127 } // namespace media | 128 } // namespace media |
128 | 129 |
129 #endif // MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 130 #endif // MEDIA_CAPTURE_VIDEO_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
OLD | NEW |