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

Side by Side Diff: media/video/capture/video_capture_device.cc

Issue 24133002: Make VideoCaptureController single-threaded and not ref counted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git pull Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/video_capture_device.h" 5 #include "media/video/capture/video_capture_device.h"
6 #include "base/strings/string_util.h" 6 #include "base/strings/string_util.h"
7 7
8 namespace media { 8 namespace media {
9 9
10 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { 10 const std::string VideoCaptureDevice::Name::GetNameAndModel() const {
11 const std::string model_id = GetModel(); 11 const std::string model_id = GetModel();
12 if (model_id.empty()) 12 if (model_id.empty())
13 return device_name_; 13 return device_name_;
14 const std::string suffix = " (" + model_id + ")"; 14 const std::string suffix = " (" + model_id + ")";
15 if (EndsWith(device_name_, suffix, true)) // |true| means case-sensitive. 15 if (EndsWith(device_name_, suffix, true)) // |true| means case-sensitive.
16 return device_name_; 16 return device_name_;
17 return device_name_ + suffix; 17 return device_name_ + suffix;
18 } 18 }
19 19
20 VideoCaptureDevice::Name* 20 VideoCaptureDevice::Name*
21 VideoCaptureDevice::Names::FindById(const std::string& id) { 21 VideoCaptureDevice::Names::FindById(const std::string& id) {
22 for (iterator it = begin(); it != end(); ++it) { 22 for (iterator it = begin(); it != end(); ++it) {
23 if (it->id() == id) 23 if (it->id() == id)
24 return &(*it); 24 return &(*it);
25 } 25 }
26 return NULL; 26 return NULL;
27 } 27 }
28 28
29 VideoCaptureDevice::~VideoCaptureDevice() {}
30
31 VideoCaptureDevice1::VideoCaptureDevice1() {}
32
33 VideoCaptureDevice1::~VideoCaptureDevice1() {}
34
35 void VideoCaptureDevice1::AllocateAndStart(
36 const VideoCaptureCapability& capture_format,
37 scoped_ptr<EventHandler> client) {
38 client_ = client.Pass();
39 Allocate(capture_format, client_.get());
40 Start();
41 }
42
43 void VideoCaptureDevice1::StopAndDeAllocate() {
44 Stop();
45 DeAllocate();
46 client_.reset();
47 };
48
49
29 } // namespace media 50 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698