Skip to content

Draft: macos: Add sckitaudiosrc element

Piotr Brzeziński requested to merge thewildtree/gstreamer:sckit-audio-src into main

TODO:

  • Figure out the bridging header depedency (separate target?) - currently it sometimes doesn't update before the Obj-C part is built
  • Test cross-compile with cerbero
  • Fix the hardcoded Xcode swift lib linkage
  • Make sure setCaps() during capture doesn't break
  • Add swift-format pre-commit hook or something?

First Swift-based element we have, so the build system is a bit rough. Opinions on what to do/not do even from a quick look over are appreciated 🙂

There are no capture filters for now, just the whole system audio is captured, with the exception of being able to exclude sound output by the current process (which is on by default). More specific filtering is possible and can be added, but will be more useful for the video capture part of this API, so I left it for later. If a video capture element is done in the future, that code will be shared between the two anyway.

Built with SwiftPM for now, because Meson support for Swift is basically none.
Uses Obj-C to call into Swift (via a bridging header) and the Swift side can directly call into C via a module
that imports Gst headers.

Only an audio element for now. Video will be a bit more complicated, and once it's needed, it will be best to split
the shared parts between both into a base class or so.

Does not allow to specify a window to capture from or anything, just system-wide audio for now. Needs figuring out
how to specify what we want to capture (bundle identifiers?), what to exclude etc.
Edited by Piotr Brzeziński

Merge request reports