GNOME Bugzilla – Bug 662852
CheeseCameraDeviceMonitor::added should have CheeseCameraDevice argument
Last modified: 2011-10-28 15:40:40 UTC
Currently, the CheeseCameraDeviceMonitor::added signal has several strings as arguments: http://developer.gnome.org/cheese/unstable/CheeseCameraDeviceMonitor.html#CheeseCameraDeviceMonitor-added The ::removed signal has just the ID string: http://developer.gnome.org/cheese/unstable/CheeseCameraDeviceMonitor.html#CheeseCameraDeviceMonitor-removed As the handler for the ::added signal inside CheeseCamera already creates a CheeseCameraDevice from these strings, the ::added signal should be changed to just provide a CheeseCameraDevice directly as an argument. The ::removed signal should also be changed to do the same. This would make the hotplug code inside CheeseCamera simpler, as it would not have to construct the CheeseCameraDevice.
Created attachment 200177 [details] [review] Improved CheeseCameraDeviceMonitor::added signal. This patch should fix this bug. Regarding the ::removed signal, this was not possible due to the way that the device object is created. When a new cheese device is created, the device must be present, to retrieve all the information that is needed for its creation. Since the callback is call right after removing the device, and therefore, the device will not be present, cheese breaks prompting different errors to communicate what I just explained. Because of this reason, and until this is solved, we need to go on using the device *id as the argument of this signal.
Comment on attachment 200177 [details] [review] Improved CheeseCameraDeviceMonitor::added signal. Pushed to master as commit 054a929303468353537442b4ba77590449c90a73, thanks!