camera monitors: pass device and node properties as event data

This avoids event properties show up in device and node properties.
This commit is contained in:
Ashok Sidipotu
2023-07-20 16:25:35 +05:30
committed by George Kiagiadakis
parent 3fe930f15f
commit 7bca8cacde
6 changed files with 8 additions and 6 deletions

View File

@@ -16,7 +16,8 @@ config.properties = Conf.get_section (
function createCamDevice (parent, id, type, factory, properties) function createCamDevice (parent, id, type, factory, properties)
source = source or Plugin.find ("standard-event-source") source = source or Plugin.find ("standard-event-source")
local e = source:call ("create-event", "create-libcam-device", parent, properties) local e = source:call ("create-event", "create-libcam-device", parent, nil)
e:set_data ("device-properties", properties)
e:set_data ("factory", factory) e:set_data ("factory", factory)
e:set_data ("device-sub-id", id) e:set_data ("device-sub-id", id)

View File

@@ -17,8 +17,8 @@ SimpleEventHook {
}, },
}, },
execute = function(event) execute = function(event)
local properties = event:get_properties ()
local parent = event:get_subject () local parent = event:get_subject ()
local properties = event:get_data ("device-properties")
local id = event:get_data ("device-sub-id") local id = event:get_data ("device-sub-id")
local name = "libcamera_device." .. local name = "libcamera_device." ..

View File

@@ -16,7 +16,7 @@ SimpleEventHook {
}, },
}, },
execute = function(event) execute = function(event)
local properties = event:get_properties () local properties = event:get_data ("node-properties")
local parent = event:get_subject () local parent = event:get_subject ()
local dev_props = parent.properties local dev_props = parent.properties
local factory = event:get_data ("factory") local factory = event:get_data ("factory")

View File

@@ -17,7 +17,8 @@ config.properties = Conf.get_section (
function createCamDevice (parent, id, type, factory, properties) function createCamDevice (parent, id, type, factory, properties)
source = source or Plugin.find ("standard-event-source") source = source or Plugin.find ("standard-event-source")
local e = source:call ("create-event", "create-v4l2-device", parent, properties) local e = source:call ("create-event", "create-v4l2-device", parent, nil)
e:set_data ("device-properties", properties)
e:set_data ("factory", factory) e:set_data ("factory", factory)
e:set_data ("device-sub-id", id) e:set_data ("device-sub-id", id)

View File

@@ -16,7 +16,7 @@ SimpleEventHook {
}, },
}, },
execute = function(event) execute = function(event)
local properties = event:get_properties () local properties = event:get_data ("device-properties")
local parent = event:get_subject () local parent = event:get_subject ()
local id = event:get_data ("device-sub-id") local id = event:get_data ("device-sub-id")

View File

@@ -16,7 +16,7 @@ SimpleEventHook {
}, },
}, },
execute = function(event) execute = function(event)
local properties = event:get_properties () local properties = event:get_data ("node-properties")
local parent = event:get_subject () local parent = event:get_subject ()
local dev_props = parent.properties local dev_props = parent.properties
local factory = event:get_data ("factory") local factory = event:get_data ("factory")