Commit graph

10 commits

Author SHA1 Message Date
Piotr Brzeziński
8f5caeb86d osxaudiosrc: Work around timestamps on iOS not starting from 0
On macOS, you always get your own 'timeline' for the AudioUnit session, so timestamps start from 0.
On iOS however, AudioUnit seems to give you a 'shared' timeline so timestamps start at a later, non-0 point in time.
Simply offsetting seems to do the trick.

This was causing osxaudiosrc to not output any sound on iOS.

Regressed in 2df9283d3f

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7856>
2025-01-07 11:55:03 +00:00
Piotr Brzeziński
307cfc2561 osxaudio: Automatically set up AVAudioSession on iOS
A correctly configured AVAudioSession is needed on iOS to:
- allow the application to capture microphone audio (in some cases)
- avoid playback being silenced in silent mode

Without this, initializing AudioUnit for capture can fail on iOS >=17 (from my testing).

Since AVAudioSession has a lot of settings, in most cases its setup should be handled by the user/app.
However, just to have a basic default scenario covered, let's configure the bare minimum ourselves,
and allow anyone to disable that behaviour by setting configure-session=false on src/sink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7856>
2025-01-07 11:55:02 +00:00
Nirbheek Chauhan
e881817567 vtenc, osxaudio: Fix missing since markers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8120>
2024-12-16 18:52:21 +00:00
Thibault Saunier
3506f5fb07 osxaudio: Avoid dangling pointer on shutdown
When tearing down the elements we were still referring to the ringbuffer unique_id
as our property while it was already freed, leading to potential segfaults when
accessing the property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7426>
2024-09-04 10:37:37 +00:00
Nirbheek Chauhan
314d67b8cc osxaudio: Implement unique-id property on elements
The actual value is stored on GstCoreAudio now, which involved a lot
of moving code around due to the strange layering in the plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5274>
2024-08-12 13:04:24 +00:00
Dominique Leroux
7affa01e05 osxaudio: add individual elements registration for gst-full compatibility
Found that osxaudiosink could not be added standalone in gst-full build
using
-Dgst-full-elements=osxaudio:osxaudiosink because element registration
was
done at the plugin level. Now src/sink elements and deviceprovider have
their
individual registration.

Copied/adapted from the alsa plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5419>
2023-09-28 21:44:48 +00:00
Jan Schmidt
461f943b52 osxaudio: Interpolate clock by counting elapsed time since render calls
When advancing the ringbuffer, store the processed CoreAudio sample
time, then interpolate the clock in the _get_delay() calls to smooth
the clock. CoreAudio's "latency" report is always a constant and
otherwise leads to the clock generating a latency-time staircase.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5140>
2023-08-07 21:33:45 +00:00
Jan Schmidt
2df9283d3f osxaudiosrc: Set sample timestamps
Set the timestamp on output buffers based on the incoming sample
times from Core Audio

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5140>
2023-08-07 21:33:45 +00:00
Nirbheek Chauhan
f1449ac116 docs: Rename "OS X" to "macOS" in some documentation
No one uses the term "Mac OS X" anymore, it's "macOS". "OS X" is even
worse, because people will usually start the search with "mac".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1607>
2022-01-30 19:17:18 +05:30
Thibault Saunier
5ff769d731 Move files from gst-plugins-good into the "subprojects/gst-plugins-good/" subdir 2021-09-24 16:13:50 -03:00
Renamed from sys/osxaudio/gstosxaudiosrc.c (Browse further)