| 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_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 9 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
| 10 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 10 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
| 11 | 11 |
| 12 #import <Foundation/Foundation.h> | 12 #import <Foundation/Foundation.h> |
| 13 #include <stdint.h> | 13 #include <stdint.h> |
| 14 | 14 |
| 15 #include <string> | 15 #include <string> |
| 16 | 16 |
| 17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
| 18 #include "base/mac/scoped_nsobject.h" | 18 #include "base/mac/scoped_nsobject.h" |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
| 21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
| 22 #include "media/base/video_capture_types.h" | 22 #include "media/base/video_capture_types.h" |
| 23 #include "media/capture/video/video_capture_device.h" | 23 #include "media/capture/video/video_capture_device.h" |
| 24 | 24 |
| 25 @protocol PlatformVideoCapturingMac; | 25 @class VideoCaptureDeviceAVFoundation; |
| 26 | 26 |
| 27 namespace base { | 27 namespace base { |
| 28 class SingleThreadTaskRunner; | 28 class SingleThreadTaskRunner; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace tracked_objects { | 31 namespace tracked_objects { |
| 32 class Location; | 32 class Location; |
| 33 } // namespace tracked_objects | 33 } // namespace tracked_objects |
| 34 | 34 |
| 35 // Small class to bundle device name and connection type into a dictionary. | 35 // Small class to bundle device name and connection type into a dictionary. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 Name device_name_; | 90 Name device_name_; |
| 91 scoped_ptr<VideoCaptureDevice::Client> client_; | 91 scoped_ptr<VideoCaptureDevice::Client> client_; |
| 92 | 92 |
| 93 VideoCaptureFormat capture_format_; | 93 VideoCaptureFormat capture_format_; |
| 94 | 94 |
| 95 // Only read and write state_ from inside this loop. | 95 // Only read and write state_ from inside this loop. |
| 96 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 96 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 97 InternalState state_; | 97 InternalState state_; |
| 98 | 98 |
| 99 id<PlatformVideoCapturingMac> capture_device_; | 99 base::scoped_nsobject<VideoCaptureDeviceAVFoundation> capture_device_; |
| 100 | 100 |
| 101 base::TimeDelta first_timestamp_; | 101 base::TimeDelta first_timestamp_; |
| 102 base::TimeTicks first_aligned_timestamp_; | 102 base::TimeTicks first_aligned_timestamp_; |
| 103 | 103 |
| 104 // Used with Bind and PostTask to ensure that methods aren't called after the | 104 // Used with Bind and PostTask to ensure that methods aren't called after the |
| 105 // VideoCaptureDeviceMac is destroyed. | 105 // VideoCaptureDeviceMac is destroyed. |
| 106 // NOTE: Weak pointers must be invalidated before all other member variables. | 106 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 107 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; | 107 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; |
| 108 | 108 |
| 109 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); | 109 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace media | 112 } // namespace media |
| 113 | 113 |
| 114 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 114 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
| OLD | NEW |