[Openal-devel] GStreamer OpenAL sink
Chris Robinson
chris.kcat at gmail.com
Sat Apr 3 04:01:25 PDT 2010
Here's a preview of the OpenAL sink I've been working on for GStreamer.
http://kcat.strangesoft.net/gst-openal.tar.bz2
And a small example app:
http://kcat.strangesoft.net/gst-openal.cpp
The sink allows you to specify a device/context/source to play with, or to
retrieve the same, allowing for some manipulation by the app (eg. play a
background music track with GStreamer and control its volume using the source
gain, or play a lengthy mono track and place it in 3D space like any other
source). The stream will play asynchronously, and it will work with any
GStreamer-supported format.
It even stays synced to a video stream.. imagine using a glvideo sink to paste
video onto a texture in the game world, along with an alaudio sink to play the
corresponding audio (remember those video screens in Doom 3?). And it all
happens automagically. Of course, even without going all extravagant like
that, it's an easy way to play a prerendered cut-scene, opening video logo(s),
or a simple music track on the same audio device as the app.
The sink supports the float32 and double extensions, as well as mcformats,
mulaw, and mulaw-mcformats, with proper checks.
Currently the sink requires OpenAL Soft 1.12, since it's the only
implementation to support ALC_EXT_thread_local_context which is needed for
context safety across threads. It should Just Work with any other
implementation that adds support for it, however.
I can try to relax that requirement when the sink is given a custom context,
though it will require the context to remain set and no errors generated with
it while the stream is playing.
Building the sink requires an alext.h header that defines the appropriate
extension tokens and types. It also (obviously) requires the gstreamer
development packages. You may likely need to pass --prefix=/usr to configure,
too (that's the default prefix for GStreamer installed by package managers,
and it doesn't seem to find plugins installed in the /usr/local prefix).
Assuming it works out well enough for you guys, I'll probably give it over to
the GStreamer devs to see if it can be included in the official packages.
More information about the Openal-devel
mailing list