GNOME Bugzilla – Bug 520026
provide an easy way to claim usb device from gphoto2 backend
Last modified: 2018-09-21 16:18:32 UTC
Advanced photo capture and media management applications might want to use the device directly using libgphoto2 (for capturing photos), libmtp (provides easy way to find special folders) or some custom library/code operating on the device. Today that is a little hard save for using g_volume_monitor_get_mounts() and manually checking each device file from the assoicated GVolume object obtained by using G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE against the device file for the device they want to use (e.g. /dev/usb/001/042). Or (better) checking if the uri starts with gphoto2://[usb:001,042]/ (for e.g. device 42 on bus 1). It makes it a little harder that neither libgphoto2 nor libmtp exports an easy way to get the device number. It's also ugly having to match on the uri name. Maybe we need a better way to do this such as defining a new identifier - G_VOLUME_IDENTIFIER_KIND_USB_DEVICE with an identifier for the device (probably bus and device number) as the values, e.g. "001,042". Then any backend operating on a USB device (obex:// for USB (see bug 511671) comes to mind) would set this. And any other application wanting to use the USB device directly can easily claim the device by querying the volume monitor and unmounting mounts from the found volumes. (and we probably need convenience API a'la usb_device_id = "001,010"; g_volume_monitor_unmount_with_identifier (monitor, G_VOLUME_IDENTIFIER_KIND_USB_DEVICE, usb_device_id); both in async and sync versions otherwise it's going to be too complicated to use from applications. I bet for a while we're going to see some friction here with users manually having to unmount gphoto2:// mounts to get Rhythmbox and Banshee working.
Sigh. Looks like this won't be a "problem" for 2.22 at least. http://mail.gnome.org/archives/gnome-vfs-list/2008-March/msg00007.html > Don't automount gphoto:// volumes. This is problematic, > as when they are mounted other apps can't access the device. > Longterm they should ideally use gio to access the files so > that everyone can share the connection and apps don't need > gphoto specific code. However, atm the automount is causing > problem by locking out apps using libgphoto directly.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gvfs/issues/38.