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

Unified Diff: content/common/media/media_devices.cc

Issue 2650153003: Add constructors and operators to MediaDeviceInfo. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/media/media_devices.h ('k') | content/common/media/media_devices_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/media/media_devices.cc
diff --git a/content/common/media/media_devices.cc b/content/common/media/media_devices.cc
index a18349b88136609038468d56e3c2b8fe064b35e5..80661916fe8d8e8a30c3fb77b439ab53dfe61467 100644
--- a/content/common/media/media_devices.cc
+++ b/content/common/media/media_devices.cc
@@ -4,9 +4,16 @@
#include "content/common/media/media_devices.h"
#include "media/audio/audio_device_description.h"
+#include "media/capture/video/video_capture_device_descriptor.h"
namespace content {
+MediaDeviceInfo::MediaDeviceInfo() = default;
+
+MediaDeviceInfo::MediaDeviceInfo(const MediaDeviceInfo& other) = default;
+
+MediaDeviceInfo::MediaDeviceInfo(MediaDeviceInfo&& other) = default;
+
MediaDeviceInfo::MediaDeviceInfo(const std::string& device_id,
const std::string& label,
const std::string& group_id)
@@ -18,6 +25,17 @@ MediaDeviceInfo::MediaDeviceInfo(
label(device_description.device_name),
group_id(device_description.group_id) {}
+MediaDeviceInfo::MediaDeviceInfo(
+ const media::VideoCaptureDeviceDescriptor& descriptor)
+ : device_id(descriptor.device_id), label(descriptor.GetNameAndModel()) {}
+
+MediaDeviceInfo::~MediaDeviceInfo() = default;
+
+MediaDeviceInfo& MediaDeviceInfo::operator=(const MediaDeviceInfo& other) =
+ default;
+
+MediaDeviceInfo& MediaDeviceInfo::operator=(MediaDeviceInfo&& other) = default;
+
bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second) {
return first.device_id == second.device_id && first.label == second.label;
}
« no previous file with comments | « content/common/media/media_devices.h ('k') | content/common/media/media_devices_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698