openal: improved port to 1.0

https://bugzilla.gnome.org/show_bug.cgi?id=698013
This commit is contained in:
Juan Manuel Borges Caño 2013-04-17 02:18:58 +02:00 committed by Tim-Philipp Müller
parent 16ed8840ea
commit 30d7908df2
6 changed files with 1172 additions and 782 deletions

View file

@ -346,7 +346,7 @@ GST_PLUGINS_NONPORTED=" cdxaparse \
linsys vcd \ linsys vcd \
apexsink cdaudio dc1394 directfb \ apexsink cdaudio dc1394 directfb \
gsettings \ gsettings \
musepack nas openal sdl sndfile timidity \ musepack nas sdl sndfile timidity \
directdraw direct3d9 acm wininet \ directdraw direct3d9 acm wininet \
xvid lv2 teletextdec sndio osx_video quicktime" xvid lv2 teletextdec sndio osx_video quicktime"
AC_SUBST(GST_PLUGINS_NONPORTED) AC_SUBST(GST_PLUGINS_NONPORTED)

View file

@ -1,8 +1,10 @@
/* /*
* GStreamer * GStreamer openal plugin
*
* Copyright (C) 2005 Wim Taymans <wim@fluendo.com> * Copyright (C) 2005 Wim Taymans <wim@fluendo.com>
* Copyright (C) 2006 Tim-Philipp Müller <tim centricular net> * Copyright (C) 2006 Tim-Philipp Müller <tim centricular net>
* Copyright (C) 2009-2010 Chris Robinson <chris.kcat@gmail.com> * Copyright (C) 2009-2010 Chris Robinson <chris.kcat@gmail.com>
* Copyright (C) 2013 Juan Manuel Borges Caño <juanmabcmail@gmail.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -24,18 +26,21 @@
#include "config.h" #include "config.h"
#endif #endif
#include <gst/gst.h>
#include <gst/gst-i18n-plugin.h>
#include "gstopenalsink.h" #include "gstopenalsink.h"
#include "gstopenalsrc.h" #include "gstopenalsrc.h"
#include <gst/gst-i18n-plugin.h>
GST_DEBUG_CATEGORY (openal_debug);
static gboolean static gboolean
plugin_init (GstPlugin * plugin) plugin_init (GstPlugin * plugin)
{ {
if (!gst_element_register (plugin, "openalsink", GST_RANK_SECONDARY, if (!gst_element_register (plugin, "openalsink", GST_RANK_SECONDARY,
GST_TYPE_OPENAL_SINK) || GST_TYPE_OPENAL_SINK))
!gst_element_register (plugin, "openalsrc", GST_RANK_SECONDARY, return FALSE;
if (!gst_element_register (plugin, "openalsrc", GST_RANK_SECONDARY,
GST_TYPE_OPENAL_SRC)) GST_TYPE_OPENAL_SRC))
return FALSE; return FALSE;
@ -44,12 +49,14 @@ plugin_init (GstPlugin * plugin)
LOCALEDIR); LOCALEDIR);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#endif /* ENABLE_NLS */ #endif
GST_DEBUG_CATEGORY_INIT (openal_debug, "openal", 0, "openal plugins");
return TRUE; return TRUE;
} }
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
GST_VERSION_MINOR,
openal, openal,
"OpenAL support for GStreamer", "OpenAL plugin library",
plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,11 @@
/* /*
* GStreamer * GStreamer
*
* Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org> * Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> * Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* Copyright (C) 2009-2010 Chris Robinson <chris.kcat@gmail.com> * Copyright (C) 2009-2010 Chris Robinson <chris.kcat@gmail.com>
* * Copyright (C) 2013 Juan Manuel Borges Caño <juanmabcmail@gmail.com>
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -24,8 +26,7 @@
#define __GST_OPENALSINK_H__ #define __GST_OPENALSINK_H__
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/audio/gstaudiosink.h> #include <gst/audio/audio.h>
#include <gst/audio/multichannel.h>
#ifdef _WIN32 #ifdef _WIN32
#include <al.h> #include <al.h>
@ -43,7 +44,8 @@
G_BEGIN_DECLS G_BEGIN_DECLS
#define GST_TYPE_OPENAL_SINK (gst_openal_sink_get_type()) #define GST_TYPE_OPENAL_SINK \
(gst_openal_sink_get_type())
#define GST_OPENAL_SINK(obj) \ #define GST_OPENAL_SINK(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENAL_SINK,GstOpenALSink)) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENAL_SINK,GstOpenALSink))
#define GST_OPENAL_SINK_CLASS(klass) \ #define GST_OPENAL_SINK_CLASS(klass) \
@ -52,6 +54,8 @@ G_BEGIN_DECLS
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENAL_SINK)) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENAL_SINK))
#define GST_IS_OPENAL_SINK_CLASS(klass) \ #define GST_IS_OPENAL_SINK_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENAL_SINK)) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENAL_SINK))
#define GST_OPENAL_SINK_CAST(obj) \
((GstOpenALSink*)obj)
#if 1 #if 1
#define GST_ALC_ERROR(Device) ("ALC error: %s", alcGetString((Device), alcGetError((Device)))) #define GST_ALC_ERROR(Device) ("ALC error: %s", alcGetString((Device), alcGetError((Device))))
@ -62,61 +66,51 @@ G_BEGIN_DECLS
typedef struct _GstOpenALSink GstOpenALSink; typedef struct _GstOpenALSink GstOpenALSink;
typedef struct _GstOpenALSinkClass GstOpenALSinkClass; typedef struct _GstOpenALSinkClass GstOpenALSinkClass;
#define GST_OPENAL_SINK_CAST(obj) ((GstOpenALSink*)obj) #define GST_OPENAL_SINK_GET_LOCK(obj) (&GST_OPENAL_SINK_CAST(obj)->openal_lock)
#define GST_OPENAL_SINK_GET_LOCK(obj) (GST_OPENAL_SINK_CAST(obj)->openal_lock)
#define GST_OPENAL_SINK_LOCK(obj) (g_mutex_lock(GST_OPENAL_SINK_GET_LOCK(obj))) #define GST_OPENAL_SINK_LOCK(obj) (g_mutex_lock(GST_OPENAL_SINK_GET_LOCK(obj)))
#define GST_OPENAL_SINK_UNLOCK(obj) (g_mutex_unlock(GST_OPENAL_SINK_GET_LOCK(obj))) #define GST_OPENAL_SINK_UNLOCK(obj) (g_mutex_unlock(GST_OPENAL_SINK_GET_LOCK(obj)))
struct _GstOpenALSink { struct _GstOpenALSink
GstAudioSink sink; {
GstAudioSink sink;
gchar *devname; gchar *device_name;
/* When set, we don't own device */ ALCdevice *default_device;
ALCdevice *custom_dev; /* When set, device is not owned */
/* When set, we don't own device or context */ ALCdevice *user_device;
ALCcontext *custom_ctx;
/* When set, we don't own sID */
ALuint custom_sID;
ALCdevice *device; ALCcontext *default_context;
ALCcontext *context; /* When set, device or context is not owned */
ALuint sID; ALCcontext *user_context;
ALuint bID_idx; ALuint default_source;
ALuint bID_count; /* When set, source is not owned */
ALuint *bIDs; ALuint user_source;
ALuint bID_length;
ALenum format; ALuint buffer_idx;
ALuint srate; ALuint buffer_count;
ALuint bytes_per_sample; ALuint *buffers;
ALuint buffer_length;
ALboolean write_reset; ALenum format;
ALuint rate;
ALuint channels;
ALuint bytes_per_sample;
GstCaps *probed_caps; ALboolean write_reset;
GMutex *openal_lock; GstCaps *probed_caps;
GMutex openal_lock;
}; };
struct _GstOpenALSinkClass { struct _GstOpenALSinkClass
GstAudioSinkClass parent_class; {
GstAudioSinkClass parent_class;
}; };
GType gst_openal_sink_get_type(void); GType gst_openal_sink_get_type (void);
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
#define GST_S16_NE GST_S16_LE
#define GST_FLOAT32_NE GST_FLOAT32_LE
#define GST_FLOAT64_NE GST_FLOAT64_LE
#else
#define GST_S16_NE GST_S16_BE
#define GST_FLOAT32_NE GST_FLOAT32_BE
#define GST_FLOAT64_NE GST_FLOAT64_BE
#endif
#define OPENAL_MIN_RATE 8000
#define OPENAL_MAX_RATE 192000
G_END_DECLS G_END_DECLS

View file

@ -1,8 +1,10 @@
/* /*
* GStreamer * GStreamer
*
* Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org> * Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> * Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* Copyright (C) 2008 Victor Lin <bornstub@gmail.com> * Copyright (C) 2008 Victor Lin <bornstub@gmail.com>
* Copyright (C) 2013 Juan Manuel Borges Caño <juanmabcmail@gmail.com>
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"), * copy of this software and associated documentation files (the "Software"),
@ -27,6 +29,8 @@
* which case the following provisions apply instead of the ones * which case the following provisions apply instead of the ones
* mentioned above: * mentioned above:
* *
* Copyright (C) 2013 Juan Manuel Borges Caño <juanmabcmail@gmail.com>
*
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either * License as published by the Free Software Foundation; either
@ -45,51 +49,63 @@
/** /**
* SECTION:element-openalsrc * SECTION:element-openalsrc
* @short_description: record sound from your sound card using OpenAL * @see_also: openalsink
* @short_description: capture raw audio samples through OpenAL
*
* This element captures raw audio samples through OpenAL.
* *
* <refsect2> * <refsect2>
* <para>
* This element lets you record sound using the OpenAL
* </para>
* <title>Example pipelines</title> * <title>Example pipelines</title>
* <para> * |[
* <programlisting> * gst-launch -v openalsrc ! audioconvert ! wavenc ! filesink location=stream.wav
* gst-launch -v openalsrc ! audioconvert ! vorbisenc ! oggmux ! filesink location=mymusic.ogg * ]| * will capture sound through OpenAL and encode it to a wav file.
* </programlisting> * |[
* will record sound from your sound card using OpenAL and encode it to an Ogg/Vorbis file * gst-launch openalsrc ! "audio/x-raw,format=S16LE,rate=44100" ! audioconvert ! volume volume=0.25 ! openalsink
* </para> * ]| will capture and play audio through OpenAL.
* </refsect2> * </refsect2>
*/ */
/*
* DEV:
* To get better timing/delay information you may also be interested in this:
* http://kcat.strangesoft.net/openal-extensions/SOFT_source_latency.txt
*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include <config.h> #include <config.h>
#endif #endif
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/gsterror.h> #include <gst/gsterror.h>
GST_DEBUG_CATEGORY_EXTERN (openal_debug);
#define GST_CAT_DEFAULT openal_debug
#include "gstopenalsrc.h" #include "gstopenalsrc.h"
GST_DEBUG_CATEGORY_STATIC (openalsrc_debug); static void gst_openal_src_dispose (GObject * object);
static void gst_openal_src_finalize (GObject * object);
static void gst_openal_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_openal_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstCaps *gst_openal_src_getcaps (GstBaseSrc * basesrc, GstCaps * filter);
static gboolean gst_openal_src_open (GstAudioSrc * audiosrc);
static gboolean gst_openal_src_prepare (GstAudioSrc * audiosrc,
GstAudioRingBufferSpec * spec);
static gboolean gst_openal_src_unprepare (GstAudioSrc * audiosrc);
static gboolean gst_openal_src_close (GstAudioSrc * audiosrc);
static guint gst_openal_src_read (GstAudioSrc * audiosrc, gpointer data,
guint length, GstClockTime * timestamp);
static guint gst_openal_src_delay (GstAudioSrc * audiosrc);
static void gst_openal_src_reset (GstAudioSrc * audiosrc);
#define GST_CAT_DEFAULT openalsrc_debug #define OPENAL_DEFAULT_DEVICE_NAME NULL
#define OPENAL_DEFAULT_DEVICE NULL
#define DEFAULT_DEVICE NULL #define OPENAL_MIN_RATE 8000
#define DEFAULT_DEVICE_NAME NULL #define OPENAL_MAX_RATE 192000
/**
Filter signals and args
**/
enum
{
/* FILL ME */
LAST_SIGNAL
};
/**
Properties
**/
enum enum
{ {
PROP_0, PROP_0,
@ -97,116 +113,137 @@ enum
PROP_DEVICE_NAME PROP_DEVICE_NAME
}; };
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", static GstStaticPadTemplate openalsrc_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC, GST_PAD_SRC,
GST_PAD_ALWAYS, GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, " GST_STATIC_CAPS (
"endianness = (int) BYTE_ORDER, " /* These caps do not work on my card */
"signed = (boolean) TRUE, " // "audio/x-adpcm, " "layout = (string) ima, "
"width = (int) 16, " // "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]; "
"depth = (int) 16, " // "audio/x-alaw, " "rate = (int) [ 1, MAX ], "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]; " // "channels = (int) 1; "
"audio/x-raw-int, " // "audio/x-mulaw, " "rate = (int) [ 1, MAX ], "
"signed = (boolean) TRUE, " // "channels = (int) 1; "
"width = (int) 8, " // "audio/x-raw, " "format = (string) " GST_AUDIO_NE (F64) ", "
"depth = (int) 8, " // "rate = (int) [ 1, MAX ], " "channels = (int) 1; "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]") // "audio/x-raw, " "format = (string) " GST_AUDIO_NE (F32) ", "
// "rate = (int) [ 1, MAX ], " "channels = (int) 1; "
"audio/x-raw, " "format = (string) " GST_AUDIO_NE (S16) ", "
"rate = (int) [ 1, MAX ], " "channels = (int) 1; "
/* These caps work wrongly on my card */
// "audio/x-raw, " "format = (string) " GST_AUDIO_NE (U16) ", "
// "rate = (int) [ 1, MAX ], " "channels = (int) 1; "
// "audio/x-raw, " "format = (string) " G_STRINGIFY (S8) ", "
// "rate = (int) [ 1, MAX ], " "channels = (int) 1"));
"audio/x-raw, " "format = (string) " G_STRINGIFY (U8) ", "
"rate = (int) [ 1, MAX ], " "channels = (int) 1")
); );
GST_BOILERPLATE (GstOpenalSrc, gst_openal_src, GstAudioSrc, GST_TYPE_AUDIO_SRC); static inline ALenum
checkALError (const char *fname, unsigned int fline)
{
ALenum err = alGetError ();
if (err != AL_NO_ERROR)
g_warning ("%s:%u: context error: %s", fname, fline, alGetString (err));
return err;
}
static void gst_openal_src_set_property (GObject * object, guint prop_id, #define checkALError() checkALError(__FILE__, __LINE__)
const GValue * value, GParamSpec * pspec);
static void gst_openal_src_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static gboolean gst_openal_src_open (GstAudioSrc * src);
static gboolean
gst_openal_src_prepare (GstAudioSrc * src, GstRingBufferSpec * spec);
static gboolean gst_openal_src_unprepare (GstAudioSrc * src);
static gboolean gst_openal_src_close (GstAudioSrc * src);
static guint
gst_openal_src_read (GstAudioSrc * src, gpointer data, guint length);
static guint gst_openal_src_delay (GstAudioSrc * src);
static void gst_openal_src_reset (GstAudioSrc * src);
static void gst_openal_src_finalize (GObject * object); G_DEFINE_TYPE (GstOpenalSrc, gst_openal_src, GST_TYPE_AUDIO_SRC);
static void static void
gst_openal_src_base_init (gpointer gclass) gst_openal_src_dispose (GObject * object)
{ {
GstOpenalSrc *openalsrc = GST_OPENAL_SRC (object);
GstElementClass *element_class = GST_ELEMENT_CLASS (gclass); if (openalsrc->probed_caps)
gst_caps_unref (openalsrc->probed_caps);
openalsrc->probed_caps = NULL;
gst_element_class_set_static_metadata (element_class, "OpenAL src", G_OBJECT_CLASS (gst_openal_src_parent_class)->dispose (object);
"Source/Audio",
"OpenAL source capture audio from device",
"Victor Lin <bornstub@gmail.com>");
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&src_factory)
);
} }
static void static void
gst_openal_src_class_init (GstOpenalSrcClass * klass) gst_openal_src_class_init (GstOpenalSrcClass * klass)
{ {
GObjectClass *gobject_class; GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GstAudioSrcClass *gstaudio_src_class; GstElementClass *gstelement_class = (GstElementClass *) klass;
GstBaseSrcClass *gstbasesrc_class = (GstBaseSrcClass *) klass;
GstAudioSrcClass *gstaudiosrc_class = (GstAudioSrcClass *) (klass);
gobject_class = G_OBJECT_CLASS (klass); gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_openal_src_dispose);
gstaudio_src_class = GST_AUDIO_SRC_CLASS (klass); gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_openal_src_finalize);
gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_openal_src_set_property);
gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_openal_src_get_property);
GST_DEBUG_CATEGORY_INIT (openalsrc_debug, "openalsrc", gst_openal_src_parent_class = g_type_class_peek_parent (klass);
0, "OpenAL source capture audio from device");
gobject_class->set_property = gst_openal_src_set_property; gstbasesrc_class->get_caps = GST_DEBUG_FUNCPTR (gst_openal_src_getcaps);
gobject_class->get_property = gst_openal_src_get_property;
gobject_class->finalize = gst_openal_src_finalize;
gstaudio_src_class->open = GST_DEBUG_FUNCPTR (gst_openal_src_open); gstaudiosrc_class->open = GST_DEBUG_FUNCPTR (gst_openal_src_open);
gstaudio_src_class->prepare = GST_DEBUG_FUNCPTR (gst_openal_src_prepare); gstaudiosrc_class->prepare = GST_DEBUG_FUNCPTR (gst_openal_src_prepare);
gstaudio_src_class->unprepare = GST_DEBUG_FUNCPTR (gst_openal_src_unprepare); gstaudiosrc_class->unprepare = GST_DEBUG_FUNCPTR (gst_openal_src_unprepare);
gstaudio_src_class->close = GST_DEBUG_FUNCPTR (gst_openal_src_close); gstaudiosrc_class->close = GST_DEBUG_FUNCPTR (gst_openal_src_close);
gstaudio_src_class->read = GST_DEBUG_FUNCPTR (gst_openal_src_read); gstaudiosrc_class->read = GST_DEBUG_FUNCPTR (gst_openal_src_read);
gstaudio_src_class->delay = GST_DEBUG_FUNCPTR (gst_openal_src_delay); gstaudiosrc_class->delay = GST_DEBUG_FUNCPTR (gst_openal_src_delay);
gstaudio_src_class->reset = GST_DEBUG_FUNCPTR (gst_openal_src_reset); gstaudiosrc_class->reset = GST_DEBUG_FUNCPTR (gst_openal_src_reset);
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class, PROP_DEVICE,
PROP_DEVICE, g_param_spec_string ("device", "ALCdevice",
g_param_spec_string ("device", "User device, default device if NULL", OPENAL_DEFAULT_DEVICE,
"Device", G_PARAM_READWRITE));
"Specific capture device to open, NULL indicate default device",
DEFAULT_DEVICE, G_PARAM_READWRITE)
);
g_object_class_install_property (gobject_class, g_object_class_install_property (gobject_class, PROP_DEVICE_NAME,
PROP_DEVICE_NAME, g_param_spec_string ("device-name", "Device name",
g_param_spec_string ("device-name", "Human-readable name of the device", OPENAL_DEFAULT_DEVICE_NAME,
"Device name", G_PARAM_READABLE));
"Readable name of device", DEFAULT_DEVICE_NAME, G_PARAM_READABLE)
); gst_element_class_set_static_metadata (gstelement_class,
"OpenAL Audio Source", "Source/Audio", "Input audio through OpenAL",
"Juan Manuel Borges Caño <juanmabcmail@gmail.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&openalsrc_factory));
} }
static void static void
gst_openal_src_init (GstOpenalSrc * osrc, GstOpenalSrcClass * gclass) gst_openal_src_init (GstOpenalSrc * openalsrc)
{ {
osrc->deviceName = g_strdup (DEFAULT_DEVICE_NAME); GST_DEBUG_OBJECT (openalsrc, "initializing");
osrc->device = DEFAULT_DEVICE;
osrc->deviceHandle = NULL; openalsrc->default_device_name = g_strdup (OPENAL_DEFAULT_DEVICE_NAME);
openalsrc->default_device = OPENAL_DEFAULT_DEVICE;
openalsrc->device = NULL;
openalsrc->buffer_length = 0;
openalsrc->probed_caps = NULL;
}
static void
gst_openal_src_finalize (GObject * object)
{
GstOpenalSrc *openalsrc = GST_OPENAL_SRC (object);
g_free (openalsrc->default_device_name);
g_free (openalsrc->default_device);
G_OBJECT_CLASS (gst_openal_src_parent_class)->finalize (object);
} }
static void static void
gst_openal_src_set_property (GObject * object, guint prop_id, gst_openal_src_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)
{ {
GstOpenalSrc *osrc = GST_OPENAL_SRC (object); GstOpenalSrc *openalsrc = GST_OPENAL_SRC (object);
switch (prop_id) { switch (prop_id) {
case PROP_DEVICE: case PROP_DEVICE:
osrc->device = g_value_dup_string (value); openalsrc->default_device = g_value_dup_string (value);
break; break;
case PROP_DEVICE_NAME: case PROP_DEVICE_NAME:
osrc->deviceName = g_value_dup_string (value); openalsrc->default_device_name = g_value_dup_string (value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -218,14 +255,14 @@ static void
gst_openal_src_get_property (GObject * object, guint prop_id, GValue * value, gst_openal_src_get_property (GObject * object, guint prop_id, GValue * value,
GParamSpec * pspec) GParamSpec * pspec)
{ {
GstOpenalSrc *osrc = GST_OPENAL_SRC (object); GstOpenalSrc *openalsrc = GST_OPENAL_SRC (object);
switch (prop_id) { switch (prop_id) {
case PROP_DEVICE: case PROP_DEVICE:
g_value_set_string (value, osrc->device); g_value_set_string (value, openalsrc->default_device);
break; break;
case PROP_DEVICE_NAME: case PROP_DEVICE_NAME:
g_value_set_string (value, osrc->deviceName); g_value_set_string (value, openalsrc->default_device_name);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -233,127 +270,324 @@ gst_openal_src_get_property (GObject * object, guint prop_id, GValue * value,
} }
} }
static gboolean static GstCaps *
gst_openal_src_open (GstAudioSrc * asrc) gst_openal_helper_probe_caps (ALCcontext * context)
{
GstStructure *structure;
GstCaps *caps;
// ALCcontext *old;
// old = pushContext(context);
caps = gst_caps_new_empty ();
if (alIsExtensionPresent ("AL_EXT_DOUBLE")) {
structure =
gst_structure_new ("audio/x-raw", "format", G_TYPE_STRING,
GST_AUDIO_NE (F64), "rate", GST_TYPE_INT_RANGE, OPENAL_MIN_RATE,
OPENAL_MAX_RATE, "channels", G_TYPE_INT, 1, NULL);
gst_caps_append_structure (caps, structure);
}
if (alIsExtensionPresent ("AL_EXT_FLOAT32")) {
structure =
gst_structure_new ("audio/x-raw", "format", G_TYPE_STRING,
GST_AUDIO_NE (F32), "rate", GST_TYPE_INT_RANGE, OPENAL_MIN_RATE,
OPENAL_MAX_RATE, "channels", G_TYPE_INT, 1, NULL);
gst_caps_append_structure (caps, structure);
}
structure =
gst_structure_new ("audio/x-raw", "format", G_TYPE_STRING,
GST_AUDIO_NE (S16), "rate", GST_TYPE_INT_RANGE, OPENAL_MIN_RATE,
OPENAL_MAX_RATE, "channels", G_TYPE_INT, 1, NULL);
gst_caps_append_structure (caps, structure);
structure =
gst_structure_new ("audio/x-raw", "format", G_TYPE_STRING,
G_STRINGIFY (U8), "rate", GST_TYPE_INT_RANGE, OPENAL_MIN_RATE,
OPENAL_MAX_RATE, "channels", G_TYPE_INT, 1, NULL);
gst_caps_append_structure (caps, structure);
if (alIsExtensionPresent ("AL_EXT_IMA4")) {
structure =
gst_structure_new ("audio/x-adpcm", "layout", G_TYPE_STRING, "ima",
"rate", GST_TYPE_INT_RANGE, OPENAL_MIN_RATE, OPENAL_MAX_RATE,
"channels", G_TYPE_INT, 1, NULL);
gst_caps_append_structure (caps, structure);
}
if (alIsExtensionPresent ("AL_EXT_ALAW")) {
structure =
gst_structure_new ("audio/x-alaw", "rate", GST_TYPE_INT_RANGE,
OPENAL_MIN_RATE, OPENAL_MAX_RATE, "channels", G_TYPE_INT, 1, NULL);
gst_caps_append_structure (caps, structure);
}
if (alIsExtensionPresent ("AL_EXT_MULAW")) {
structure =
gst_structure_new ("audio/x-mulaw", "rate", GST_TYPE_INT_RANGE,
OPENAL_MIN_RATE, OPENAL_MAX_RATE, "channels", G_TYPE_INT, 1, NULL);
gst_caps_append_structure (caps, structure);
}
// popContext(old, context);
return caps;
}
static GstCaps *
gst_openal_src_getcaps (GstBaseSrc * basesrc, GstCaps * filter)
{
GstOpenalSrc *openalsrc = GST_OPENAL_SRC (basesrc);
GstCaps *caps;
ALCdevice *device;
device = alcOpenDevice (NULL);
if (device == NULL) {
GstPad *pad = GST_BASE_SRC_PAD (basesrc);
GST_ELEMENT_WARNING (openalsrc, RESOURCE, OPEN_WRITE,
("Could not open temporary device."), GST_ALC_ERROR (device));
caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
} else if (openalsrc->probed_caps)
caps = gst_caps_copy (openalsrc->probed_caps);
else {
ALCcontext *context = alcCreateContext (device, NULL);
if (context) {
caps = gst_openal_helper_probe_caps (context);
alcDestroyContext (context);
} else {
GST_ELEMENT_WARNING (openalsrc, RESOURCE, FAILED,
("Could not create temporary context."), GST_ALC_ERROR (device));
caps = NULL;
}
if (caps && !gst_caps_is_empty (caps))
openalsrc->probed_caps = gst_caps_copy (caps);
}
if (device != NULL) {
if (alcCloseDevice (device) == ALC_FALSE) {
GST_ELEMENT_WARNING (openalsrc, RESOURCE, CLOSE,
("Could not close temporary device."), GST_ALC_ERROR (device));
}
}
if (filter) {
GstCaps *intersection;
intersection =
gst_caps_intersect_full (filter, caps, GST_CAPS_INTERSECT_FIRST);
return intersection;
} else {
return caps;
}
}
static gboolean
gst_openal_src_open (GstAudioSrc * audiosrc)
{ {
/* We don't do anything here */
return TRUE; return TRUE;
} }
static gboolean static void
gst_openal_src_prepare (GstAudioSrc * asrc, GstRingBufferSpec * spec) gst_openal_src_parse_spec (GstOpenalSrc * openalsrc,
const GstAudioRingBufferSpec * spec)
{ {
ALuint format = AL_NONE;
GstOpenalSrc *osrc = GST_OPENAL_SRC (asrc); GST_DEBUG_OBJECT (openalsrc,
ALenum format; "looking up format for type %d, gst-format %d, and %d channels",
guint64 bufferSize; spec->type, GST_AUDIO_INFO_FORMAT (&spec->info),
GST_AUDIO_INFO_CHANNELS (&spec->info));
switch (spec->width) { switch (spec->type) {
case 8: case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_RAW:
format = AL_FORMAT_STEREO8; switch (GST_AUDIO_INFO_FORMAT (&spec->info)) {
case GST_AUDIO_FORMAT_U8:
switch (GST_AUDIO_INFO_CHANNELS (&spec->info)) {
case 1:
format = AL_FORMAT_MONO8;
break;
default:
break;
}
break;
case GST_AUDIO_FORMAT_U16:
case GST_AUDIO_FORMAT_S16:
switch (GST_AUDIO_INFO_CHANNELS (&spec->info)) {
case 1:
format = AL_FORMAT_MONO16;
break;
default:
break;
}
break;
case GST_AUDIO_FORMAT_F32:
switch (GST_AUDIO_INFO_CHANNELS (&spec->info)) {
case 1:
format = AL_FORMAT_MONO_FLOAT32;
break;
default:
break;
}
break;
case GST_AUDIO_FORMAT_F64:
switch (GST_AUDIO_INFO_CHANNELS (&spec->info)) {
case 1:
format = AL_FORMAT_MONO_DOUBLE_EXT;
break;
default:
break;
}
break;
default:
break;
}
break; break;
case 16:
format = AL_FORMAT_STEREO16; case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_IMA_ADPCM:
switch (GST_AUDIO_INFO_CHANNELS (&spec->info)) {
case 1:
format = AL_FORMAT_MONO_IMA4;
break;
default:
break;
}
break; break;
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_A_LAW:
switch (GST_AUDIO_INFO_CHANNELS (&spec->info)) {
case 1:
format = AL_FORMAT_MONO_ALAW_EXT;
break;
default:
break;
}
break;
case GST_AUDIO_RING_BUFFER_FORMAT_TYPE_MU_LAW:
switch (GST_AUDIO_INFO_CHANNELS (&spec->info)) {
case 1:
format = AL_FORMAT_MONO_MULAW;
break;
default:
break;
}
break;
default: default:
g_assert_not_reached (); break;
} }
bufferSize = openalsrc->bytes_per_sample = GST_AUDIO_INFO_BPS (&spec->info);
spec->buffer_time * spec->rate * spec->bytes_per_sample / 1000000; openalsrc->rate = GST_AUDIO_INFO_RATE (&spec->info);
openalsrc->buffer_length = spec->segsize;
openalsrc->format = format;
}
GST_INFO_OBJECT (osrc, "Open device : %s", osrc->deviceName); static gboolean
osrc->deviceHandle = gst_openal_src_prepare (GstAudioSrc * audiosrc, GstAudioRingBufferSpec * spec)
alcCaptureOpenDevice (osrc->device, spec->rate, format, bufferSize); {
GstOpenalSrc *openalsrc = GST_OPENAL_SRC (audiosrc);
if (!osrc->deviceHandle) { gst_openal_src_parse_spec (openalsrc, spec);
GST_ELEMENT_ERROR (osrc, if (openalsrc->format == AL_NONE) {
RESOURCE, GST_ELEMENT_ERROR (openalsrc, RESOURCE, SETTINGS, (NULL),
FAILED, ("Unable to get type %d, format %d, and %d channels", spec->type,
("Can't open device \"%s\"", osrc->device), GST_AUDIO_INFO_FORMAT (&spec->info),
("Can't open device \"%s\"", osrc->device) GST_AUDIO_INFO_CHANNELS (&spec->info)));
);
return FALSE; return FALSE;
} }
osrc->deviceName = openalsrc->device =
g_strdup (alcGetString (osrc->deviceHandle, ALC_DEVICE_SPECIFIER)); alcCaptureOpenDevice (openalsrc->default_device, openalsrc->rate,
osrc->bytes_per_sample = spec->bytes_per_sample; openalsrc->format, openalsrc->buffer_length);
GST_INFO_OBJECT (osrc, "Start capture"); if (!openalsrc->device) {
alcCaptureStart (osrc->deviceHandle); GST_ELEMENT_ERROR (openalsrc, RESOURCE, OPEN_READ,
("Could not open device."), GST_ALC_ERROR (openalsrc->device));
return FALSE;
}
openalsrc->default_device_name =
g_strdup (alcGetString (openalsrc->device, ALC_DEVICE_SPECIFIER));
alcCaptureStart (openalsrc->device);
return TRUE; return TRUE;
} }
static gboolean static gboolean
gst_openal_src_unprepare (GstAudioSrc * asrc) gst_openal_src_unprepare (GstAudioSrc * audiosrc)
{ {
GstOpenalSrc *openalsrc = GST_OPENAL_SRC (audiosrc);
GstOpenalSrc *osrc = GST_OPENAL_SRC (asrc); if (openalsrc->device) {
alcCaptureStop (openalsrc->device);
GST_INFO_OBJECT (osrc, "Close device : %s", osrc->deviceName); if (alcCaptureCloseDevice (openalsrc->device) == ALC_FALSE) {
if (osrc->deviceHandle) { GST_ELEMENT_ERROR (openalsrc, RESOURCE, CLOSE,
alcCaptureStop (osrc->deviceHandle); ("Could not close device."), GST_ALC_ERROR (openalsrc->device));
alcCaptureCloseDevice (osrc->deviceHandle); return FALSE;
}
} }
return TRUE; return TRUE;
} }
static gboolean static gboolean
gst_openal_src_close (GstAudioSrc * asrc) gst_openal_src_close (GstAudioSrc * audiosrc)
{ {
/* We don't do anything here */
return TRUE; return TRUE;
} }
static guint static guint
gst_openal_src_read (GstAudioSrc * asrc, gpointer data, guint length) gst_openal_src_read (GstAudioSrc * audiosrc, gpointer data, guint length,
GstClockTime * timestamp)
{ {
GstOpenalSrc *osrc = GST_OPENAL_SRC (asrc); GstOpenalSrc *openalsrc = GST_OPENAL_SRC (audiosrc);
gint samples; gint samples;
alcGetIntegerv (osrc->deviceHandle, ALC_CAPTURE_SAMPLES, sizeof (samples), alcGetIntegerv (openalsrc->device, ALC_CAPTURE_SAMPLES, sizeof (samples),
&samples); &samples);
if (samples * osrc->bytes_per_sample > length) { if (samples * openalsrc->bytes_per_sample > length) {
samples = length / osrc->bytes_per_sample; samples = length / openalsrc->bytes_per_sample;
} }
if (samples) { if (samples) {
GST_DEBUG_OBJECT (osrc, "Read samples : %d", samples); GST_DEBUG_OBJECT (openalsrc, "read samples : %d", samples);
alcCaptureSamples (osrc->deviceHandle, data, samples); alcCaptureSamples (openalsrc->device, data, samples);
} }
return samples * osrc->bytes_per_sample; return samples * openalsrc->bytes_per_sample;
} }
static guint static guint
gst_openal_src_delay (GstAudioSrc * asrc) gst_openal_src_delay (GstAudioSrc * audiosrc)
{ {
GstOpenalSrc *osrc = GST_OPENAL_SRC (asrc); GstOpenalSrc *openalsrc = GST_OPENAL_SRC (audiosrc);
gint samples; ALint samples;
alcGetIntegerv (osrc->deviceHandle, ALC_CAPTURE_SAMPLES, sizeof (samples), alcGetIntegerv (openalsrc->device, ALC_CAPTURE_SAMPLES, sizeof (samples),
&samples); &samples);
if (G_UNLIKELY (samples < 0)) {
/* make sure we never return a negative delay */
GST_WARNING_OBJECT (openal_debug, "negative delay");
samples = 0;
}
return samples; return samples;
} }
static void static void
gst_openal_src_reset (GstAudioSrc * asrc) gst_openal_src_reset (GstAudioSrc * audiosrc)
{ {
/* We don't do anything here */
}
static void
gst_openal_src_finalize (GObject * object)
{
GstOpenalSrc *osrc = GST_OPENAL_SRC (object);
g_free (osrc->deviceName);
g_free (osrc->device);
G_OBJECT_CLASS (parent_class)->finalize (object);
} }

View file

@ -1,105 +1,122 @@
/* /*
* GStreamer * GStreamer
* Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org> *
* Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net> * Copyright (C) 2005 Thomas Vander Stichele <thomas@apestaart.org>
* Copyright (C) 2008 Victor Lin <bornstub@gmail.com> * Copyright (C) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* * Copyright (C) 2008 Victor Lin <bornstub@gmail.com>
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the "Software"), * Permission is hereby granted, free of charge, to any person obtaining a
* to deal in the Software without restriction, including without limitation * copy of this software and associated documentation files (the "Software"),
* the rights to use, copy, modify, merge, publish, distribute, sublicense, * to deal in the Software without restriction, including without limitation
* and/or sell copies of the Software, and to permit persons to whom the * the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions: * and/or sell copies of the Software, and to permit persons to whom the
* * Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. * The above copyright notice and this permission notice shall be included in
* * all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* DEALINGS IN THE SOFTWARE. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* * DEALINGS IN THE SOFTWARE.
* Alternatively, the contents of this file may be used under the *
* GNU Lesser General Public License Version 2.1 (the "LGPL"), in * Alternatively, the contents of this file may be used under the
* which case the following provisions apply instead of the ones * GNU Lesser General Public License Version 2.1 (the "LGPL"), in
* mentioned above: * which case the following provisions apply instead of the ones
* * mentioned above:
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public * Copyright (C) 2013 Juan Manuel Borges Caño <juanmabcmail@gmail.com>
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. * This library is free software; you can redistribute it and/or
* * modify it under the terms of the GNU Library General Public
* This library is distributed in the hope that it will be useful, * License as published by the Free Software Foundation; either
* but WITHOUT ANY WARRANTY; without even the implied warranty of * version 2 of the License, or (at your option) any later version.
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Library General Public License for more details. * This library is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* You should have received a copy of the GNU Library General Public * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* License along with this library; if not, write to the * Library General Public License for more details.
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, *
* Boston, MA 02110-1301, USA. * You should have received a copy of the GNU Library General Public
*/ * License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
#ifndef __GST_OPENAL_SRC_H__ * Boston, MA 02110-1301, USA.
#define __GST_OPENAL_SRC_H__ */
#include <gst/gst.h> #ifndef __GST_OPENAL_SRC_H__
#include <gst/audio/gstaudiosrc.h> #define __GST_OPENAL_SRC_H__
#ifdef _WIN32 #include <gst/gst.h>
#include <al.h> #include <gst/audio/audio.h>
#include <alc.h>
#include <alext.h> #ifdef _WIN32
#elif defined(__APPLE__) #include <al.h>
#include <OpenAL/al.h> #include <alc.h>
#include <OpenAL/alc.h> #include <alext.h>
#include <OpenAL/alext.h> #elif defined(__APPLE__)
#else #include <OpenAL/al.h>
#include <AL/al.h> #include <OpenAL/alc.h>
#include <AL/alc.h> #include <OpenAL/alext.h>
#include <AL/alext.h> #else
#endif #include <AL/al.h>
#include <AL/alc.h>
G_BEGIN_DECLS #include <AL/alext.h>
#endif
#define GST_TYPE_OPENAL_SRC \
(gst_openal_src_get_type()) G_BEGIN_DECLS
#define GST_OPENAL_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENAL_SRC,GstOpenalSrc)) #define GST_TYPE_OPENAL_SRC \
#define GST_OPENAL_SRC_CLASS(klass) \ (gst_openal_src_get_type())
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPENAL_SRC,GstOpenalSrcClass)) #define GST_OPENAL_SRC(obj) \
#define GST_IS_OPENAL_SRC(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_OPENAL_SRC, GstOpenalSrc))
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENAL_SRC)) #define GST_OPENAL_SRC_CLASS(klass) \
#define GST_IS_OPENAL_SRC_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_OPENAL_SRC, GstOpenalSrcClass))
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENAL_SRC)) #define GST_IS_OPENAL_SRC(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_OPENAL_SRC))
typedef struct _GstOpenalSrc GstOpenalSrc; #define GST_IS_OPENAL_SRC_CLASS(klass) \
typedef struct _GstOpenalSrcClass GstOpenalSrcClass; (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_OPENAL_SRC))
struct _GstOpenalSrc { #if 1
GstAudioSrc element; #define GST_ALC_ERROR(Device) ("ALC error: %s", alcGetString((Device), alcGetError((Device))))
GstPad *srcpad; #else
gboolean silent; #define GST_ALC_ERROR(Device) ("ALC error: 0x%x", alcGetError((Device)))
#endif
/* readable name of device */
gchar *deviceName; typedef struct _GstOpenalSrc GstOpenalSrc;
/* name of device to open, default is a NULL pointer to get default device */ typedef struct _GstOpenalSrcClass GstOpenalSrcClass;
gchar *device;
/* OpenAL device handle */ struct _GstOpenalSrc
ALCdevice *deviceHandle; {
GstAudioSrc element;
guint bytes_per_sample; GstPad *srcpad;
}; gboolean silent;
struct _GstOpenalSrcClass { /* readable name of device */
GstAudioSrcClass parent_class; gchar *default_device_name;
}; /* name of device to open, default is a NULL pointer to get default device */
gchar *default_device;
GType gst_openal_src_get_type (void); /* OpenAL device handle */
ALCdevice *device;
G_END_DECLS
guint64 buffer_length;
#endif /* __GST_OPENAL_SRC_H__ */
ALenum format;
ALuint rate;
ALuint bytes_per_sample;
GstCaps *probed_caps;
};
struct _GstOpenalSrcClass
{
GstAudioSrcClass parent_class;
};
GType gst_openal_src_get_type (void);
G_END_DECLS
#endif /* __GST_OPENAL_SRC_H__ */