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

Side by Side Diff: media/video/capture/mac/video_capture_device_mac.mm

Issue 10198016: Fix TODO comments for the mac media capture part (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix camelcase style issues Created 8 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/video/capture/mac/video_capture_device_qtkit_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "media/video/capture/mac/video_capture_device_mac.h" 5 #include "media/video/capture/mac/video_capture_device_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 "base/time.h" 10 #include "base/time.h"
11 #include "media/video/capture/mac/video_capture_device_qtkit_mac.h" 11 #include "media/video/capture/mac/video_capture_device_qtkit_mac.h"
12 12
13 namespace media { 13 namespace media {
14 14
15 void VideoCaptureDevice::GetDeviceNames(Names* device_names) { 15 void VideoCaptureDevice::GetDeviceNames(Names* device_names) {
16 // Loop through all available devices and add to |device_names|. 16 // Loop through all available devices and add to |device_names|.
17 device_names->clear(); 17 device_names->clear();
18 18
19 // TODO(mflodman) Return name and id as NSArray* instead of QTCaptureDevice*. 19 NSDictionary* capture_devices = [VideoCaptureDeviceQTKit deviceNames];
20 for (QTCaptureDevice* device in [VideoCaptureDeviceQTKit deviceNames]) { 20 for (NSString* key in capture_devices) {
21 Name name; 21 Name name;
22 NSString* qt_device_name = [device localizedDisplayName]; 22 name.device_name = [[capture_devices valueForKey:key] UTF8String];
23 name.device_name = [qt_device_name UTF8String]; 23 name.unique_id = [key UTF8String];
24 NSString* qt_unique_id = [device uniqueID];
25 name.unique_id = [qt_unique_id UTF8String];
26 device_names->push_back(name); 24 device_names->push_back(name);
27 } 25 }
28 } 26 }
29 27
30 VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) { 28 VideoCaptureDevice* VideoCaptureDevice::Create(const Name& device_name) {
31 VideoCaptureDeviceMac* capture_device = 29 VideoCaptureDeviceMac* capture_device =
32 new VideoCaptureDeviceMac(device_name); 30 new VideoCaptureDeviceMac(device_name);
33 if (!capture_device->Init()) { 31 if (!capture_device->Init()) {
34 LOG(ERROR) << "Could not initialize VideoCaptureDevice."; 32 LOG(ERROR) << "Could not initialize VideoCaptureDevice.";
35 delete capture_device; 33 delete capture_device;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 base::Time::Now()); 135 base::Time::Now());
138 } 136 }
139 137
140 void VideoCaptureDeviceMac::SetErrorState(const std::string& reason) { 138 void VideoCaptureDeviceMac::SetErrorState(const std::string& reason) {
141 DLOG(ERROR) << reason; 139 DLOG(ERROR) << reason;
142 state_ = kError; 140 state_ = kError;
143 observer_->OnError(); 141 observer_->OnError();
144 } 142 }
145 143
146 } // namespace media 144 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/video/capture/mac/video_capture_device_qtkit_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698