Commit 528e7694 authored by Julian Bouzas's avatar Julian Bouzas
Browse files

wip: create AGL endpoints

parent ab043344
Pipeline #279547 passed with stages
in 59 seconds
......@@ -31,7 +31,7 @@ alsa_monitor.rules = {
apply_properties = {
-- Use ALSA-Card-Profile devices. They use UCM or the profile
-- configuration to configure the device and mixer settings.
["api.alsa.use-acp"] = true,
["api.alsa.use-acp"] = false,
-- Use UCM instead of profile when available. Can be
-- disabled to skip trying to use the UCM profile.
......
......@@ -15,6 +15,9 @@ function addEndpoint (node, session_name, endpoint_type, priority)
local media_class = node.properties['media.class']
local session = nil
local name = nil
local adapter = nil
local stream_multimedia = nil
local stream_navigation = nil
-- find the session
session = sessions_om:lookup {
......@@ -29,19 +32,49 @@ function addEndpoint (node, session_name, endpoint_type, priority)
name = node.properties['node.name'] or "endpoint.node." .. id
-- create endpoint
session_items.endpoints[id] = SessionItem ( endpoint_type )
adapter = SessionItem ( endpoint_type )
-- configure endpoint
if not session_items.endpoints[id]:configure {
if not adapter:configure {
["node"] = node,
["name"] = name,
["media-class"] = media_class,
["priority"] = priority,
} then
Log.warning(node, "failed to configure adapter");
return
end
session_items.endpoints[id] = SessionItem ( "si-audio-softdsp-endpoint" )
if not session_items.endpoints[id]:configure {
["adapter"] = adapter,
} then
Log.warning(node, "failed to configure endpoint");
return
end
-- add Multimedia stream
stream_multimedia = SessionItem ( "si-convert" )
if not stream_multimedia:configure {
["target"] = adapter,
["name"] = "Multimedia",
} then
Log.warning(node, "failed to configure multimedia stream");
return
end
session_items.endpoints[id]:add (stream_multimedia)
-- add Navigation stream
stream_navigation = SessionItem ( "si-convert" )
if not stream_navigation:configure {
["target"] = adapter,
["name"] = "Navigation",
} then
Log.warning(node, "failed to configure navigation stream");
return
end
session_items.endpoints[id]:add (stream_navigation)
-- activate endpoint
session_items.endpoints[id]:activate (function (activated_ep)
Log.debug(activated_ep, "activated endpoint " .. name);
......@@ -49,32 +82,6 @@ function addEndpoint (node, session_name, endpoint_type, priority)
-- export endpoint
activated_ep:export (session, function (exported_ep)
Log.info(exported_ep, "exported endpoint " .. name);
-- only use monitor audio sinks
if media_class == "Audio/Sink" then
-- create monitor
local monitor = SessionItem ( "si-monitor-endpoint" )
-- configure monitor
if not monitor:configure {
["adapter"] = session_items.endpoints[id]
} then
Log.warning(monitor, "failed to configure monitor " .. name);
return
end
session_items.monitors[id] = monitor
-- activate monitor
monitor:activate (function (activated_mon)
Log.debug(activated_mon, "activated monitor " .. name);
-- export monitor
activated_mon:export (session, function (exported_mon)
Log.info(exported_mon, "exported monitor " .. name);
end)
end)
end
end)
end)
end
......@@ -92,8 +99,6 @@ nodes_om:connect("object-added", function (om, node)
if string.find (media_class, "Audio") then
addEndpoint (node, "audio", "si-adapter", 1)
else
addEndpoint (node, "video", "si-simple-node-endpoint", 1)
end
end)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment