video device: use device id instead of friendly name
- Video settings, and APIs will now use a device id, which will be
a path on platforms where everything is a file, and a DevicePath
with a bonus ffmpeg-dshow compliant prefix on Windows.
- The device's friendly name is uniquified, and stored in the
settings still, but only retrieved/translated for UI.
- MRLs are now constructed with the device id.
Change-Id: I092f08cc2cd31bd78aeec5c774c2cc33d75c1d4e
diff --git a/src/media/video/osxvideo/video_device_impl.mm b/src/media/video/osxvideo/video_device_impl.mm
index 940deb0..45a3cbf 100644
--- a/src/media/video/osxvideo/video_device_impl.mm
+++ b/src/media/video/osxvideo/video_device_impl.mm
@@ -42,7 +42,7 @@
*/
VideoDeviceImpl(const std::string& path);
- std::string device;
+ std::string id;
std::string name;
std::vector<std::string> getChannelList() const;
@@ -64,7 +64,7 @@
};
VideoDeviceImpl::VideoDeviceImpl(const std::string& uniqueID)
- : device(uniqueID)
+ : id(uniqueID)
, current_size_(-1, -1)
, avDevice_([AVCaptureDevice deviceWithUniqueID:
[NSString stringWithCString:uniqueID.c_str() encoding:[NSString defaultCStringEncoding]]])
@@ -112,7 +112,7 @@
{
DeviceParams params;
params.name = [[avDevice_ localizedName] UTF8String];
- params.input = params.name;
+ params.input = [[avDevice_ localizedName] UTF8String];
params.framerate = rate_;
params.format = "avfoundation";
params.pixel_format = "nv12";
@@ -155,7 +155,7 @@
VideoDevice::VideoDevice(const std::string& path, const std::vector<std::map<std::string, std::string>>&) :
deviceImpl_(new VideoDeviceImpl(path))
{
- node_ = path;
+ id_ = path;
name = deviceImpl_->name;
}