Uname:Linux localhost.localdomain 5.14.0-596.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 27 16:02:33 UTC 2025 x86_64

403WebShell
403Webshell
Server IP : 14.225.216.240  /  Your IP : 216.73.216.26
Web Server : nginx/1.20.1
System : Linux localhost.localdomain 5.14.0-596.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jun 27 16:02:33 UTC 2025 x86_64
User : taidh ( 1001)
PHP Version : 8.3.19
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/wireplumber/scripts/lib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/wireplumber/scripts/lib/node-utils.lua
-- WirePlumber
--
-- Copyright © 2024 Collabora Ltd.
--
-- SPDX-License-Identifier: MIT

local cutils = require ("common-utils")

local module = {}

function module.get_session_priority (node_props)
  local priority = node_props ["priority.session"]
  -- fallback to driver priority if session priority is not set
  if not priority then
    priority = node_props ["priority.driver"]
  end
  return math.tointeger (priority) or 0
end

function module.get_route_priority (node_props)
  local card_profile_device = node_props ["card.profile.device"]
  local device_id = node_props ["device.id"]

  -- if the node does not have an associated device, just return 0
  if not card_profile_device or not device_id then
    return 0
  end

  -- Get the device
  devices_om = cutils.get_object_manager ("device")
  local device = devices_om:lookup {
    Constraint { "bound-id", "=", device_id, type = "gobject" },
  }

  if not device then
    return 0
  end

  -- Get the priority of the associated route
  for p in device:iterate_params ("Route") do
    local route = cutils.parseParam (p, "Route")
    if route and (route.device == tonumber (card_profile_device)) then
      return route.priority
    end
  end

  return 0
end

return module

Youez - 2016 - github.com/yon3zu
LinuXploit