Video capture device monitor for Linux. More...
Inherits Foodolini::Activities::FoodRegistration::Devices::ICaptureDeviceMonitor.
Public Member Functions | |
void | Dispose () |
Stop listing for devices. | |
Properties | |
static LinuxCaptureDeviceMonitor | Instance [get] |
Gets and instance of VideoSourceManager. | |
ICollection< IDeviceInfo > | Devices [get] |
List potential video sources on the system. | |
bool | SupportsAutoRefresh [get] |
Events | |
EventHandler< DeviceEventArgs > | DeviceAdded |
Occurs whenever a device is added to the system. | |
EventHandler< DeviceEventArgs > | DeviceRemoved |
Occurs whenever a device removed from the system. | |
Private Member Functions | |
LinuxCaptureDeviceMonitor () | |
DeviceEventArgs | DeviceInfo (ObjectPath path) |
void | HandleDeviceAdded (ObjectPath path) |
Handles HAL dbus signal for device added. | |
void | HandleDeviceRemoved (ObjectPath path) |
Handles HAL dbus signal for device removed. | |
void | iterate () |
Runs the dbus event loop. | |
Private Attributes | |
Bus | dbus |
Thread | worker |
HalManager | hal |
bool | disposed = false |
Dictionary< string, IDeviceInfo > | devices = new Dictionary<string, IDeviceInfo>() |
Devices on the system and their path in hal/dbus. | |
Static Private Attributes | |
static LinuxCaptureDeviceMonitor | instance = null |
Singleton instance of VideoSourceManager. |
Video capture device monitor for Linux.
If compiled with USE_DBUS, this class will be able to provide correct events and it will also run a NDesk.DBus.Bus on a worker thread. Note: This is a Singleton class, and it should be disposed of after use. It's not strictly necessary to dispose this object, however, it have been made possible.
Definition at line 22 of file LinuxCaptureDeviceMonitor.cs.
Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.LinuxCaptureDeviceMonitor | ( | ) | [private] |
Definition at line 29 of file LinuxCaptureDeviceMonitor.cs.
DeviceEventArgs Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.DeviceInfo | ( | ObjectPath | path | ) | [private] |
Definition at line 55 of file LinuxCaptureDeviceMonitor.cs.
void Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.Dispose | ( | ) |
Stop listing for devices.
Definition at line 284 of file LinuxCaptureDeviceMonitor.cs.
void Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.HandleDeviceAdded | ( | ObjectPath | path | ) | [private] |
Handles HAL dbus signal for device added.
Definition at line 79 of file LinuxCaptureDeviceMonitor.cs.
void Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.HandleDeviceRemoved | ( | ObjectPath | path | ) | [private] |
Handles HAL dbus signal for device removed.
Definition at line 95 of file LinuxCaptureDeviceMonitor.cs.
void Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.iterate | ( | ) | [private] |
Runs the dbus event loop.
Definition at line 113 of file LinuxCaptureDeviceMonitor.cs.
Definition at line 24 of file LinuxCaptureDeviceMonitor.cs.
Dictionary<string, IDeviceInfo> Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.devices = new Dictionary<string, IDeviceInfo>() [private] |
Devices on the system and their path in hal/dbus.
May only be accessed from the UI-thread.
Definition at line 161 of file LinuxCaptureDeviceMonitor.cs.
bool Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.disposed = false [private] |
Definition at line 27 of file LinuxCaptureDeviceMonitor.cs.
Definition at line 26 of file LinuxCaptureDeviceMonitor.cs.
LinuxCaptureDeviceMonitor Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.instance = null [static, private] |
Singleton instance of VideoSourceManager.
Definition at line 137 of file LinuxCaptureDeviceMonitor.cs.
Definition at line 25 of file LinuxCaptureDeviceMonitor.cs.
ICollection<IDeviceInfo> Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.Devices [get] |
List potential video sources on the system.
If HAL (Hardware Abstraction Layer) is running this list the devices provided by HAL which offer video capture capability.
If HAL is not running it list all /dev/video* devices, and attempts to get their name using /lib/udev/v4l_id, see the udev source (link available in source comments) for more information on this utility. If finding a name for a device fails using /lib/udev/v4l_id, it will provide "Video *" as name for /dev/video*.
Alternately, define UDEV_RULES and the "/dev/v4l/by-id/" symlinks will be used to find the names. Note this likely depends on Ubuntu 9.10 udev rules. Thus the other approach is preffered, if HAL is not running.
A IDictionary of Name and device
Implements Foodolini.Activities.FoodRegistration.Devices.ICaptureDeviceMonitor.
Definition at line 197 of file LinuxCaptureDeviceMonitor.cs.
LinuxCaptureDeviceMonitor Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.Instance [static, get] |
Gets and instance of VideoSourceManager.
Definition at line 142 of file LinuxCaptureDeviceMonitor.cs.
bool Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.SupportsAutoRefresh [get] |
True, if HAL is running, then auto refresh is supported
Implements Foodolini.Activities.FoodRegistration.Devices.ICaptureDeviceMonitor.
Definition at line 271 of file LinuxCaptureDeviceMonitor.cs.
EventHandler<DeviceEventArgs> Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.DeviceAdded |
Occurs whenever a device is added to the system.
This event is only usable if HAL is available.
Implements Foodolini.Activities.FoodRegistration.Devices.ICaptureDeviceMonitor.
Definition at line 169 of file LinuxCaptureDeviceMonitor.cs.
EventHandler<DeviceEventArgs> Foodolini.Activities.FoodRegistration.Devices.LinuxCaptureDeviceMonitor.DeviceRemoved |
Occurs whenever a device removed from the system.
This event is only usable if HAL is available.
Implements Foodolini.Activities.FoodRegistration.Devices.ICaptureDeviceMonitor.
Definition at line 175 of file LinuxCaptureDeviceMonitor.cs.