Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1143)

Unified Diff: media/video/capture/mac/video_capture_device_qtkit_mac.mm

Issue 11017045: [Mac] Enumerate webcam devices on the main thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace change. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/mac/video_capture_device_qtkit_mac.mm
diff --git a/media/video/capture/mac/video_capture_device_qtkit_mac.mm b/media/video/capture/mac/video_capture_device_qtkit_mac.mm
index c2d2b06ff538bafe9c3a4eb036ca8c12849ebb56..c0037123b71c544c338e7340b94d44f063c9d1f4 100644
--- a/media/video/capture/mac/video_capture_device_qtkit_mac.mm
+++ b/media/video/capture/mac/video_capture_device_qtkit_mac.mm
@@ -15,17 +15,25 @@
#pragma mark Class methods
-+ (NSDictionary *)deviceNames {
- NSArray *captureDevices =
++ (void)getDeviceNames:(NSMutableDictionary*)deviceNames {
+ NSArray* captureDevices =
[QTCaptureDevice inputDevicesWithMediaType:QTMediaTypeVideo];
- NSMutableDictionary *deviceNames =
- [[[NSMutableDictionary alloc] init] autorelease];
for (QTCaptureDevice* device in captureDevices) {
- NSString* qtDeviceName = [device localizedDisplayName];
- NSString* qtUniqueId = [device uniqueID];
- [deviceNames setObject:qtDeviceName forKey:qtUniqueId];
+ [deviceNames setObject:[device localizedDisplayName]
+ forKey:[device uniqueID]];
}
+}
+
++ (NSDictionary*)deviceNames {
+ NSMutableDictionary* deviceNames =
+ [[[NSMutableDictionary alloc] init] autorelease];
+
+ // TODO(shess): Post to the main thread to see if that helps
+ // http://crbug.com/139164
+ [self performSelectorOnMainThread:@selector(getDeviceNames:)
+ withObject:deviceNames
+ waitUntilDone:YES];
return deviceNames;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698