Commit Graph

31 Commits

Author SHA1 Message Date
Misaki Kasumi 1ed8607292 ao_avfoundation: initial avfoundation ao support 2024-03-29 13:46:59 +01:00
der richter 86fa9b18a3 osdep/mac: make mac naming of files, folders and function consistent
rename all macOS namings (osx, macosx, macOS, macos, apple) to mac, to
make naming consistent.
2024-02-28 15:52:47 +01:00
NRK 2070331f64 osdep: remove atomic.h
replace it with <stdatomic.h> and replace the mp_atomic_* typedefs with
explicit _Atomic qualified types.

also add missing config.h includes on some files.
2023-10-20 21:31:09 +02:00
Dudemanguy 50025428b1 ao: convert all timing code to nanoseconds
Pull AOs work off of a callback that relies on mpv's internal timer. So
like with the related video changes, convert all of these to nanoseconds
instead. In many cases, the underlying audio API does actually provide
nanosecond resolution as well.
2023-10-16 15:38:59 +00:00
rcombs 0463096b3c osdep: move cfstr<->cstr conversions to a new apple_utils.c file 2023-06-25 11:01:58 +02:00
rcombs 89bd6ead6c ao_coreaudio: specify UTF-8 as text encoding for CFString conversions
This matches our internal expectations, as well as fixes handling
of non-ASCII device descriptions.
2022-10-29 00:00:09 +03:00
Aman Gupta e35aca3cb4 ao/audiounit: improve a/v sync
This more closely mimics ao_coreaudio, on which this driver was
originally based.

Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-04-05 10:29:44 +07:00
wm4 c87224bf1b ao_coreaudio: change license to LGPL
All authors have agreed to the relicensing.

The code was pretty much rewritten by Stefano Pigozzi. Since the rewrite
happened incrementally, and seems to include refactored portions of
older code, this relicensing was done on the pre-refactor code do.

The original commit adding this AO (as ao_macosx.c) credits Timothy J.
Wood as original author. He was asked and agreed to LGPL. It's not
entirely sure from which project this code came from, but it's probably
libao. In that project, Stanley Seibert made some changes to it (who as
a major developer of libao was asked just to be sure), and also Ralph
Giles and Ben Hines made two small changes. The latter were not asked,
but none of their code survived anyway.
2017-05-08 13:57:40 +02:00
Aman Gupta 3f5b41dfa3 audio/out: add AudioUnit output driver for iOS 2016-11-01 16:25:40 +01:00
wm4 1aa943d8ab ao_coreaudio: remove unused function 2016-04-15 14:14:42 +02:00
wm4 9fee7077d4 ao_coreaudio: replace fourcc_repr()
Replace with the more general mp_tag_str().
2016-01-11 20:25:00 +01:00
wm4 7c032bde3e ao_coreaudio: fix device latency, share the code
ao_coreaudio (using AudioUnit) accounted only for part of the latency -
move the code in ao_coreaudio_exclusive to utils, and use that for the
AudioUnit code.

(There's still the question why CoreAudio and AudioUnit require you to
jump through hoops this much, but apparently that's how it is.)
2015-07-06 17:49:28 +02:00
wm4 7556f367d6 ao_coreaudio_exclusive: move generic functions to utils 2015-06-02 22:25:34 +02:00
wm4 399267393b ao_coreaudio_utils: don't require talloc for fourcc_repr()
Instead, apply a trick to make the caller allocate enough space on the
stack.
2015-05-05 21:47:04 +02:00
wm4 305a85cc9a ao_coreaudio_utils: add a format negotiation helper function 2015-05-05 01:11:16 +02:00
wm4 32b835c03b ao_coreaudio_utils: add function for ASBD -> mp format lookup
Useful with some of the following commits.

ca_fill_asbd() should behave exactly as before.

Instead of actually implementing the inverse function of ca_fill_asbd(),
just loop over the (small) list of mpv functions and check if any mpv
equivalent to a given ASBD exists.
2015-04-29 23:06:10 +02:00
wm4 fa75a7b6d7 ao_coreaudio: move some helpers to utils
Needed by ao_coreaudio_exclusive.c in the next commit.
2015-03-10 10:13:23 +01:00
Stefano Pigozzi de4f997752 ao_coreaudio: use device UID instead of ID for selection
Previously we let the user use the audio device ID, but this is not persistent
and can change when plugging in new devices. That of course made it quite
worthless for storing it as a user setting for GUIs, or for user scripts.

In theory getting the kAudioDevicePropertyDeviceUID can fail but it doesn't
on any of my devices, so I'm leaving the error reporting quite high and see if
someone complains.
2015-02-03 00:40:02 +01:00
Stefano Pigozzi 7c07da57e3 coreaudio: use the new device selection API
The CoreAudio API is built around device IDs so we store the integer as string
and read it back.
2014-10-12 12:22:17 +02:00
Stefano Pigozzi 4f5f034ba2 ao_coreaudio: move channel mapping away from utils
Channel mapping functions are only used in the AUHAL based coreaudio, so move
them there.
2014-07-02 21:43:08 +02:00
Stefano Pigozzi 80ec0ba6d0 ao_coreaudio: fill asbd with an helper function 2014-07-02 21:43:07 +02:00
Stefano Pigozzi f317d24a39 ao_coreaudio: move device related functions to the new AO 2014-07-02 21:43:07 +02:00
Stefano Pigozzi 041557b639 ao_coreaudio: move spdif code to a new AO
The mplayer1/2/mpv CoreAudio audio output historically contained both usage
of AUHAL APIs (these go through the CoreAudio audio server) and the Device
based APIs (used only for output of compressed formats in exclusive mode).

The latter is a very unwieldy and low level API and pretty much forces us to
write a lot of code for little workr. Also with the widespread of HDMI, the
actual need for outputting compressed audio directly to the device is getting
lower (it was very useful with S/PDIF for bandwidth constraints not allowing
a number if channels transmitted in LPCM).

Considering how invasive it is (uses hog/exclusive mode), the new AO
(`ao_coreaudio_device`) is not going to be autoprobed but the user will have
to select it.
2014-07-02 21:43:07 +02:00
Stefano Pigozzi b46ffaec7c ao_coreaudio: use description-based channel layouts
CoreAudio supports 3 kinds of layouts: bitmap based, tag based, and speaker
description based (using either channel labels or positional data).

Previously we tried to convert everything to bitmap based channel layouts,
but it turns out description based ones are the most generic and there are
built-in CoreAudio APIs to perform the conversion in this direction.

Moreover description based layouts support waveext extensions (like SDL and
SDR), and are easier to map to mp_chmaps.
2014-05-10 14:07:45 +02:00
wm4 41f2b26d11 audio/out: make ao struct opaque
We want to move the AO to its own thread. There's no technical reason
for making the ao struct opaque to do this. But it helps us sleep at
night, because we can control access to shared state better.
2014-03-09 00:19:31 +01:00
wm4 0112143fda Split mpvcore/ into common/, misc/, bstr/ 2013-12-17 02:39:45 +01:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
Stefano Pigozzi 0bd09da570 ao_coreaudio: move to new log API 2013-08-01 20:32:49 +02:00
Stefano Pigozzi c11c744998 ao_coreaudio: refactor chmap detection
b2f9e0610 introduced this functionality with code that was quite 'monolithic'.
Split the functionality over several functions and ose the new macros to get
array properties.
2013-07-22 21:53:18 +02:00
Stefano Pigozzi 1ed1175636 ao_coreaudio: move utils functions to snake_case 2013-07-22 21:53:18 +02:00
Stefano Pigozzi 1e37965597 ao_coreaudio: split ao_coreaudio_common in two files
* ao_coreaudio_utils: contains several utility function
 * ao_coreaudio_properties: contains functions to set and get  audio object
   properties.

Conflicts:
	audio/out/ao_coreaudio.c
2013-07-22 21:53:18 +02:00