OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import "media/video/capture/mac/video_capture_device_qtkit_mac.h" | 5 #import "media/video/capture/mac/video_capture_device_qtkit_mac.h" |
6 | 6 |
7 #import <QTKit/QTKit.h> | 7 #import <QTKit/QTKit.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "media/video/capture/mac/video_capture_device_mac.h" | 10 #include "media/video/capture/mac/video_capture_device_mac.h" |
11 #include "media/video/capture/video_capture_device.h" | 11 #include "media/video/capture/video_capture_device.h" |
12 | 12 |
13 @implementation VideoCaptureDeviceQTKit | 13 @implementation VideoCaptureDeviceQTKit |
14 | 14 |
15 #pragma mark Class methods | 15 #pragma mark Class methods |
16 | 16 |
17 + (NSArray *)deviceNames { | 17 + (NSDictionary *)deviceNames { |
18 return [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo]; | 18 NSArray *captureDevices = |
19 [QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo]; | |
20 NSMutableDictionary *device_names = [[NSMutableDictionary alloc] init]; | |
mflodman_chromium_OOO
2012/04/25 05:57:09
'device_names' -> 'deviceNames'
mflodman_chromium_OOO
2012/04/25 05:57:09
|device_names| is never released.
| |
21 | |
22 for (QTCaptureDevice* device in captureDevices) { | |
23 NSString* qt_device_name = [device localizedDisplayName]; | |
mflodman_chromium_OOO
2012/04/25 05:57:09
'qt_device_name' -> 'qtDeviceName'
| |
24 NSString* qt_unique_id = [device uniqueID]; | |
mflodman_chromium_OOO
2012/04/25 05:57:09
'qt_unique_id' -> 'qtUniqueId'
| |
25 [device_names setObject:qt_device_name forKey:qt_unique_id]; | |
26 } | |
27 return device_names; | |
19 } | 28 } |
20 | 29 |
21 #pragma mark Public methods | 30 #pragma mark Public methods |
22 | 31 |
23 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac *)frameReceiver { | 32 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac *)frameReceiver { |
24 self = [super init]; | 33 self = [super init]; |
25 if (self) { | 34 if (self) { |
26 frameReceiver_ = frameReceiver; | 35 frameReceiver_ = frameReceiver; |
27 } | 36 } |
28 return self; | 37 return self; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 | 176 |
168 // Deliver the captured video frame. | 177 // Deliver the captured video frame. |
169 frameReceiver_->ReceiveFrame(static_cast<UInt8*>(baseAddress), frameSize, | 178 frameReceiver_->ReceiveFrame(static_cast<UInt8*>(baseAddress), frameSize, |
170 captureCapability); | 179 captureCapability); |
171 | 180 |
172 CVPixelBufferUnlockBaseAddress(videoFrame, kLockFlags); | 181 CVPixelBufferUnlockBaseAddress(videoFrame, kLockFlags); |
173 } | 182 } |
174 } | 183 } |
175 | 184 |
176 @end | 185 @end |
OLD | NEW |