OLD | NEW |
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 | 6 |
7 namespace media { | 7 namespace media { |
8 | 8 |
9 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { | 9 const std::string VideoCaptureDevice::Name::GetNameAndModel() const { |
10 // On Linux, the device name already includes the model identifier. | 10 // On Linux, the device name already includes the model identifier. |
11 #if !defined(OS_LINUX) | 11 #if !defined(OS_LINUX) |
12 std::string model_id = GetModel(); | 12 std::string model_id = GetModel(); |
13 if (!model_id.empty()) | 13 if (!model_id.empty()) |
14 return device_name_ + " (" + model_id + ")"; | 14 return device_name_ + " (" + model_id + ")"; |
15 #endif // if !defined(OS_LINUX) | 15 #endif // if !defined(OS_LINUX) |
16 return device_name_; | 16 return device_name_; |
17 } | 17 } |
18 | 18 |
19 VideoCaptureDevice::Name* | 19 VideoCaptureDevice::Name* |
20 VideoCaptureDevice::Names::FindById(const std::string& id) { | 20 VideoCaptureDevice::Names::FindById(const std::string& id) { |
21 for (iterator it = begin(); it != end(); ++it) { | 21 for (iterator it = begin(); it != end(); ++it) { |
22 if (it->id() == id) | 22 if (it->id() == id) |
23 return &(*it); | 23 return &(*it); |
24 } | 24 } |
25 return NULL; | 25 return NULL; |
26 } | 26 } |
27 | 27 |
| 28 VideoCaptureDevice::~VideoCaptureDevice() {} |
| 29 |
| 30 VideoCaptureDevice1::VideoCaptureDevice1() {} |
| 31 |
| 32 VideoCaptureDevice1::~VideoCaptureDevice1() {} |
| 33 |
| 34 void VideoCaptureDevice1::AllocateAndStart( |
| 35 const VideoCaptureCapability& capture_format, |
| 36 scoped_ptr<EventHandler> client) { |
| 37 client_ = client.Pass(); |
| 38 Allocate(capture_format, client_.get()); |
| 39 Start(); |
| 40 } |
| 41 |
| 42 void VideoCaptureDevice1::StopAndDeAllocate() { |
| 43 Stop(); |
| 44 DeAllocate(); |
| 45 client_.reset(); |
| 46 }; |
| 47 |
| 48 |
28 } // namespace media | 49 } // namespace media |
OLD | NEW |