Index: media/video/capture/mac/video_capture_device_mac.mm |
diff --git a/media/video/capture/mac/video_capture_device_mac.mm b/media/video/capture/mac/video_capture_device_mac.mm |
index 9ef29d231b8d8d0581383c1de2c48ce359e49770..ac5afed02a68df1c52dbf57842a66dc5088394e7 100644 |
--- a/media/video/capture/mac/video_capture_device_mac.mm |
+++ b/media/video/capture/mac/video_capture_device_mac.mm |
@@ -86,8 +86,9 @@ void VideoCaptureDevice::GetDeviceNames(Names* device_names) { |
} |
// static |
-void VideoCaptureDevice::GetDeviceSupportedFormats(const Name& device, |
- VideoCaptureCapabilities* formats) { |
+void VideoCaptureDevice::GetDeviceSupportedFormats( |
+ const Name& device, |
+ VideoCaptureFormats* formats) { |
NOTIMPLEMENTED(); |
} |
@@ -207,10 +208,17 @@ bool VideoCaptureDeviceMac::Init() { |
DCHECK_EQ(loop_proxy_, base::MessageLoopProxy::current()); |
DCHECK_EQ(state_, kNotInitialized); |
+ // TODO(mcasas): The following check might not be necessary; if the device has |
+ // disappeared after enumeration and before coming here, opening would just |
+ // fail but not necessarily produce a crash. |
Names device_names; |
GetDeviceNames(&device_names); |
- Name* found = device_names.FindById(device_name_.id()); |
- if (!found) |
+ Names::iterator it = device_names.begin(); |
+ for (; it != device_names.end(); ++it) { |
+ if (it->id() == device_name_.id()) |
+ break; |
+ } |
+ if (it == device_names.end()) |
return false; |
capture_device_ = |