Skip to content

Commit

Permalink
lavdevice: Add AudioToolbox output device.
Browse files Browse the repository at this point in the history
  • Loading branch information
thiloborgmann committed Jun 15, 2020
1 parent 9d80f3e commit b737575
Show file tree
Hide file tree
Showing 6 changed files with 360 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.

version <next>:
- AudioToolbox output device


version 4.3:
Expand Down
3 changes: 3 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3367,6 +3367,8 @@ alsa_outdev_deps="alsa"
avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
avfoundation_indev_suggest="coregraphics applicationservices"
avfoundation_indev_extralibs="-framework Foundation"
audiotoolbox_outdev_deps="audiotoolbox pthreads"
audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework CoreAudio"
bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
caca_outdev_deps="libcaca"
decklink_deps_any="libdl LoadLibrary"
Expand Down Expand Up @@ -6152,6 +6154,7 @@ enabled videotoolbox && check_apple_framework VideoToolbox
check_apple_framework CoreFoundation
check_apple_framework CoreMedia
check_apple_framework CoreVideo
check_apple_framework CoreAudio

enabled avfoundation && {
disable coregraphics applicationservices
Expand Down
46 changes: 46 additions & 0 deletions doc/outdevs.texi
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,52 @@ ffmpeg -i INPUT -f alsa hw:1,7
@end example
@end itemize

@section AudioToolbox

AudioToolbox output device.

Allows native output to CoreAudio devices on OSX.

The output filename can be empty (or @code{-}) to refer to the default system output device or a number that refers to the device index as shown using: @code{-list_devices true}.

Alternatively, the audio input device can be chosen by index using the
@option{
-audio_device_index <INDEX>
}
, overriding any device name or index given in the input filename.

All available devices can be enumerated by using @option{-list_devices true}, listing
all device names, UIDs and corresponding indices.

@subsection Options

AudioToolbox supports the following options:

@table @option

@item -audio_device_index <INDEX>
Specify the audio device by its index. Overrides anything given in the output filename.

@end table

@subsection Examples

@itemize

@item
Print the list of supported devices and output a sine wave to the default device:
@example
$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
@end example

@item
Output a sine wave to the device with the index 2, overriding any output filename:
@example
$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
@end example

@end itemize

@section caca

CACA output device.
Expand Down
1 change: 1 addition & 0 deletions libavdevice/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ OBJS-$(CONFIG_SHARED) += reverse.o
OBJS-$(CONFIG_ALSA_INDEV) += alsa_dec.o alsa.o timefilter.o
OBJS-$(CONFIG_ALSA_OUTDEV) += alsa_enc.o alsa.o
OBJS-$(CONFIG_ANDROID_CAMERA_INDEV) += android_camera.o
OBJS-$(CONFIG_AUDIOTOOLBOX_OUTDEV) += audiotoolbox.o
OBJS-$(CONFIG_AVFOUNDATION_INDEV) += avfoundation.o
OBJS-$(CONFIG_BKTR_INDEV) += bktr.o
OBJS-$(CONFIG_CACA_OUTDEV) += caca.o
Expand Down
1 change: 1 addition & 0 deletions libavdevice/alldevices.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
extern AVInputFormat ff_alsa_demuxer;
extern AVOutputFormat ff_alsa_muxer;
extern AVInputFormat ff_android_camera_demuxer;
extern AVOutputFormat ff_audiotoolbox_muxer;
extern AVInputFormat ff_avfoundation_demuxer;
extern AVInputFormat ff_bktr_demuxer;
extern AVOutputFormat ff_caca_muxer;
Expand Down
Loading

0 comments on commit b737575

Please sign in to comment.