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 either QTKit or | 5 // MacOSX implementation of generic VideoCaptureDevice, using either QTKit or |
6 // AVFoundation as native capture API. QTKit is available in all OSX versions, | 6 // AVFoundation as native capture API. QTKit is available in all OSX versions, |
7 // although namely deprecated in 10.9, and AVFoundation is available in versions | 7 // although namely deprecated in 10.9, and AVFoundation is available in versions |
8 // 10.7 (Lion) and later. | 8 // 10.7 (Lion) and later. |
9 | 9 |
10 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 10 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
11 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 11 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
12 | 12 |
13 #import <Foundation/Foundation.h> | |
Robert Sesek
2014/07/01 14:16:07
nit: blank line after
mcasas
2014/07/01 16:06:10
Done.
| |
13 #include <string> | 14 #include <string> |
14 | 15 |
15 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
16 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
17 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
18 #include "media/video/capture/video_capture_device.h" | 19 #include "media/video/capture/video_capture_device.h" |
19 #include "media/video/capture/video_capture_types.h" | 20 #include "media/video/capture/video_capture_types.h" |
20 | 21 |
21 @protocol PlatformVideoCapturingMac; | 22 @protocol PlatformVideoCapturingMac; |
22 | 23 |
23 namespace base { | 24 namespace base { |
24 class SingleThreadTaskRunner; | 25 class SingleThreadTaskRunner; |
25 } | 26 } |
26 | 27 |
28 MEDIA_EXPORT | |
29 @interface DeviceNameAndTransportType : NSObject { | |
Robert Sesek
2014/07/01 14:16:07
Class needs a comment about its purpose.
mcasas
2014/07/01 16:06:10
Done.
| |
30 enum { | |
31 // Unknown transport type, addition to the kIOAudioDeviceTransportType* | |
32 // family for QTKit devices where this attribute isn't published. | |
33 kIOAudioDeviceTransportTypeUnknown = 'unkn' | |
34 }; | |
Robert Sesek
2014/07/01 14:16:07
nit: blank line after, and I"d maybe move this enu
mcasas
2014/07/01 16:06:10
Done.
| |
35 @private | |
36 NSString* deviceName_; | |
Robert Sesek
2014/07/01 14:16:07
This should be strongly referenced, otherwise who
mcasas
2014/07/01 16:06:10
Done.
| |
37 // The transport type of the device (USB, PCI, etc), values are defined in | |
38 // <IOKit/audio/IOAudioTypes.h> as kIOAudioDeviceTransportType*. | |
39 int32_t transportType_; | |
40 } | |
41 | |
42 - (id)initWithName:(NSString*)name transportType:(int32_t)transportType; | |
43 | |
44 - (NSString*)deviceName; | |
45 - (int32_t)transportType; | |
46 @end | |
47 | |
27 namespace media { | 48 namespace media { |
28 | 49 |
29 // Called by VideoCaptureManager to open, close and start, stop Mac video | 50 // Called by VideoCaptureManager to open, close and start, stop Mac video |
30 // capture devices. | 51 // capture devices. |
31 class VideoCaptureDeviceMac : public VideoCaptureDevice { | 52 class VideoCaptureDeviceMac : public VideoCaptureDevice { |
32 public: | 53 public: |
33 explicit VideoCaptureDeviceMac(const Name& device_name); | 54 explicit VideoCaptureDeviceMac(const Name& device_name); |
34 virtual ~VideoCaptureDeviceMac(); | 55 virtual ~VideoCaptureDeviceMac(); |
35 | 56 |
36 // VideoCaptureDevice implementation. | 57 // VideoCaptureDevice implementation. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 // VideoCaptureDeviceMac is destroyed. | 105 // VideoCaptureDeviceMac is destroyed. |
85 // NOTE: Weak pointers must be invalidated before all other member variables. | 106 // NOTE: Weak pointers must be invalidated before all other member variables. |
86 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; | 107 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; |
87 | 108 |
88 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); | 109 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); |
89 }; | 110 }; |
90 | 111 |
91 } // namespace media | 112 } // namespace media |
92 | 113 |
93 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | 114 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ |
OLD | NEW |