[FFmpeg-devel] [PATCH] OpenAL 1.1 Capture Support

Stefano Sabatini stefano.sabatini-lala at poste.it
Sat Jun 25 00:37:39 CEST 2011


On date Thursday 2011-06-23 19:58:53 -0400, Jonathan Baldwin encoded:
> * Added the list_device option.
> * configure now checks for both 'openal' and 'OpenAL32.dll' library names.
> * Fixed a bug (al_data needed to begin with an AVClass pointer. Dunno
> why no segfaulting occured before.)
> * Did some (actually quite a bit of) testing.
>     - I tested against both my distro's OpenAL Soft version as well as
> the latest version.
>     - I tested on Windows cross-compiling from my Kubuntu box. I used
> OpenAL Soft's import library, libOpenAL32.dll.a (MinGW and MSVC use
> incompatible import library formats, no?). After rebooting into
> Windows 7, I tested the binary against both the Creative
> implementation, the OpenAL Soft implementation plus the Creative
> router dll, and OpenAL Soft solo.
> * The patch applies cleanly against git HEAD, as of writing this.
> 
> I'm now out of school for the summer, so I won't be as slow responding now.

> diff --git a/Changelog b/Changelog
> index 4362371..b8b4939 100644
> --- a/Changelog
> +++ b/Changelog
> @@ -36,6 +36,7 @@ version 0.7_beta2:
>  - split filter added
>  - select filter added
>  - sdl output device added
> +- openal input device added
>  
>  
>  version 0.7_beta1:
> diff --git a/configure b/configure
> index aa62831..1185310 100755
> --- a/configure
> +++ b/configure
> @@ -188,6 +188,7 @@ External library support:
>    --enable-libxavs         enable AVS encoding via xavs [no]
>    --enable-libxvid         enable Xvid encoding via xvidcore,
>                             native MPEG-4/Xvid encoder exists [no]
> +  --enable-openal          enable OpenAL 1.1 capture support [no]
>    --enable-mlib            enable Sun medialib [no]
>    --enable-zlib            enable zlib [autodetect]
>  
> @@ -959,6 +960,7 @@ CONFIG_LIST="
>      mpegaudiodsp
>      network
>      nonfree
> +    openal
>      pic
>      postproc
>      rdft
> @@ -1470,6 +1472,7 @@ dv1394_indev_deps="dv1394 dv_demuxer"
>  fbdev_indev_deps="linux_fb_h"
>  jack_indev_deps="jack_jack_h sem_timedwait"
>  libdc1394_indev_deps="libdc1394"
> +openal_indev_deps="openal"
>  oss_indev_deps_any="soundcard_h sys_soundcard_h"
>  oss_outdev_deps_any="soundcard_h sys_soundcard_h"
>  sdl_outdev_deps="sdl"
> @@ -2946,6 +2949,11 @@ enabled libx264    && require  libx264 x264.h x264_encoder_encode -lx264 &&
>                          die "ERROR: libx264 version must be >= 0.115."; }
>  enabled libxavs    && require  libxavs xavs.h xavs_encoder_encode -lxavs
>  enabled libxvid    && require  libxvid xvid.h xvid_global -lxvidcore
> +enabled openal     && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32.dll"; do
> +                        check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
> +                        die "ERROR: openal not found"; } &&
> +                      { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
> +                        die "ERROR: openal version must be 1.1 or compatible"; }

Maybe this could be simplified, but I think it's safe to commit and
see if someone has better ideas.

>  enabled mlib       && require  mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
>  
>  SDL_CONFIG="${cross_prefix}sdl-config"
> @@ -3242,6 +3250,7 @@ echo "libvpx enabled            ${libvpx-no}"
>  echo "libx264 enabled           ${libx264-no}"
>  echo "libxavs enabled           ${libxavs-no}"
>  echo "libxvid enabled           ${libxvid-no}"
> +echo "openal enabled            ${openal-no}"
>  echo "zlib enabled              ${zlib-no}"
>  echo "bzlib enabled             ${bzlib-no}"
>  echo
> diff --git a/doc/indevs.texi b/doc/indevs.texi
> index 0487108..0c0766b 100644
> --- a/doc/indevs.texi
> +++ b/doc/indevs.texi
> @@ -137,6 +137,76 @@ For more information read:
>  
>  IIDC1394 input device, based on libdc1394 and libraw1394.
>  
> + at section openal
> +
> +The OpenAL input device provides audio capture on all systems with a
> +working OpenAL 1.1 implementation.
> +
> +To enable this input device during configuration, you will need the
> +OpenAL headers and libraries. These should be provided as part of 
> +your OpenAL implementation, or as an additional download (an SDK).
> +
> +Incomplete List of OpenAL Implementations:
> +
> + at table @strong
> + at item Creative
> +The official Windows implementation, providing hardware acceleration
> +with supported devices and software fallback.
> +http://openal.org/
> + at item OpenAL Soft
> +Portable, open source (LGPL) software implementation. Includes 
> +backends for the most common sound APIs on the Windows, Linux,
> +Solaris, and BSD operating systems.
> +http://kcat.strangesoft.net/openal.html
> + at item Apple
> +OpenAL is part of Core Audio, the official Mac OS X Audio interface.
> +http://developer.apple.com/technologies/mac/audio-and-video.html
> + at end table
> +
> + at subsection Options
> +
> + at table @option
> +
> + at item channels
> +The number of channels in the captured audio. Only the 
> +values @option{1} (monaural) and @option{2} (stereo) are currently supported.
> +Defaults to @option{2}.
> +
> + at item sample_size
> +The sample size (in bits) of the captured audio. Only the
> +values @option{8} and @option{16} are currently supported.
> +Defaults to @option{16}.
> +
> + at item sample_rate
> +The sample rate (in Hz) of the captured audio.
> +Defaults to @option{44.1k}.
> +
> + at item list_devices
> +If set to @option{true}, print a list of devices and exit.
> +Defaults to @option{false}.

Note: maybe we could add proper support to "booleans" in avopt.

[...]

Looks fine to me, I'll test and commit in a few days if I see no
comments from other devs (and if it works for me).
-- 
FFmpeg = Fabulous and Fancy Muttering Philosofic Epic Gargoyle


More information about the ffmpeg-devel mailing list