video_capture_device.cc revision 558790d6acca3451cf3a6b497803a5f07d0bec58
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 3// found in the LICENSE file. 4 5#include "media/video/capture/video_capture_device.h" 6 7namespace media { 8 9const std::string VideoCaptureDevice::Name::GetNameAndModel() const { 10// On Linux, the device name already includes the model identifier. 11#if !defined(OS_LINUX) 12 std::string model_id = GetModel(); 13 if (!model_id.empty()) 14 return device_name_ + " (" + model_id + ")"; 15#endif // if !defined(OS_LINUX) 16 return device_name_; 17} 18 19VideoCaptureDevice::Name* 20VideoCaptureDevice::Names::FindById(const std::string& id) { 21 for (iterator it = begin(); it != end(); ++it) { 22 if (it->id() == id) 23 return &(*it); 24 } 25 return NULL; 26} 27 28} // namespace media 29