Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • W wireplumber
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 142
    • Issues 142
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • PipeWirePipeWire
  • wireplumber
  • Merge requests
  • !144

WpSiAdapter

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Julian Bouzas requested to merge julian/wireplumber:si-adapter into master May 11, 2021
  • Overview 5
  • Commits 8
  • Pipelines 6
  • Changes 15

This MR delays the configuration of port format until 2 nodes are linked. The following changes have been done:

  • Renamed WpPortInfo interface to WpLinkable
  • Added new WpSiAdapter interface with an API to set and get the session item port format
  • Implemented such WpSiAdapter interface in both si-audio-adapter and si-audio-endpoint session items. The si-node session item does not implement the interface because it is not possible to set format in video nodes.
  • There is a wp_si_adapter_is_format_activable() API in WpSiAdapter, which is used by si-standard-link to determine which linkable item needs to be configured with a different/new format.
  • The si-audio-endpoint always return FALSE when wp_si_adapter_is_format_activable() is called, and never sets the format when the endpoint is activated. On the other hand, if using a si-audio-adapter, it will return TRUE if the node is a device node (and the item will automatically configure the ports with a sensible audio format on activation), or FALSE if the node is a client node (and the item won't configure ports on activation).
  • The linking logic in si-standard-link has been improved in the following way:
    • If both In and Out items are not adapters, just get the ports and create links like before (Used for video nodes)
    • If both In and Out items are WpSiAdapter, check wp_si_adapter_is_format_activable() return value in both items:
      • If value is FALSE in In item, and TRUE in Out item, configure In format using Out format, and then create the links (used for audio capture cases between client node and device node).
      • If value is FALSE in Out item, and TRUE in In item, configure Out format using In format, and then create the links (used for audio playback cases between client node and device node)
      • If both In and Out item values are TRUE, check if both formats are the same:
        • If both formats are the same, don't configure anything and just link nodes (used when linking 2 device nodes with same format)
        • If formats are not the same, configure In item with Out format, and then create the links (usually used when linking 2 device nodes with different format)
      • If both values are FALSE, configure Out and In node with Out default format, and create links (usually used when linking 2 client nodes)
    • If one item is an adapter, and the other item is not an adapter, throw an activation error and don't link anything
Edited May 11, 2021 by Julian Bouzas
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: si-adapter