Commit 490ac45d authored by Brian Cameron's avatar Brian Cameron Committed by Wim Taymans
Browse files

sys/sunaudio/: Add a SunAudio source plugin.

Original commit message from CVS:
Patch by: Brian Cameron <brian dot cameron at sun dot com>
* sys/sunaudio/Makefile.am:
* sys/sunaudio/gstsunaudio.c: (plugin_init):
* sys/sunaudio/gstsunaudiomixerctrl.c:
(gst_sunaudiomixer_ctrl_build_list), (gst_sunaudiomixer_ctrl_new),
(gst_sunaudiomixer_ctrl_list_tracks),
(gst_sunaudiomixer_ctrl_get_volume),
(gst_sunaudiomixer_ctrl_set_volume),
(gst_sunaudiomixer_ctrl_set_mute),
(gst_sunaudiomixer_ctrl_set_record):
* sys/sunaudio/gstsunaudiomixerctrl.h:
* sys/sunaudio/gstsunaudiomixertrack.c:
(gst_sunaudiomixer_track_init), (gst_sunaudiomixer_track_new):
* sys/sunaudio/gstsunaudiomixertrack.h:
* sys/sunaudio/gstsunaudiosrc.c: (gst_sunaudiosrc_dispose),
(gst_sunaudiosrc_base_init), (gst_sunaudiosrc_class_init),
(gst_sunaudiosrc_init), (gst_sunaudiosrc_set_property),
(gst_sunaudiosrc_get_property), (gst_sunaudiosrc_getcaps),
(gst_sunaudiosrc_open), (gst_sunaudiosrc_close),
(gst_sunaudiosrc_prepare), (gst_sunaudiosrc_unprepare),
(gst_sunaudiosrc_read), (gst_sunaudiosrc_delay),
(gst_sunaudiosrc_reset):
* sys/sunaudio/gstsunaudiosrc.h:
Add a SunAudio source plugin.
Support stereo and right/left channel gain in the mixer plugin.
Support the RECORD flag so that you can switch between line-input and
microphone in gnome-volume-control.
Code cleanups like using an enumerator for track number instead of an
integer. Fixes #344923.
parent 7b405d88
2006-06-20 Wim Taymans <wim@fluendo.com>
Patch by: Brian Cameron <brian dot cameron at sun dot com>
* sys/sunaudio/Makefile.am:
* sys/sunaudio/gstsunaudio.c: (plugin_init):
* sys/sunaudio/gstsunaudiomixerctrl.c:
(gst_sunaudiomixer_ctrl_build_list), (gst_sunaudiomixer_ctrl_new),
(gst_sunaudiomixer_ctrl_list_tracks),
(gst_sunaudiomixer_ctrl_get_volume),
(gst_sunaudiomixer_ctrl_set_volume),
(gst_sunaudiomixer_ctrl_set_mute),
(gst_sunaudiomixer_ctrl_set_record):
* sys/sunaudio/gstsunaudiomixerctrl.h:
* sys/sunaudio/gstsunaudiomixertrack.c:
(gst_sunaudiomixer_track_init), (gst_sunaudiomixer_track_new):
* sys/sunaudio/gstsunaudiomixertrack.h:
* sys/sunaudio/gstsunaudiosrc.c: (gst_sunaudiosrc_dispose),
(gst_sunaudiosrc_base_init), (gst_sunaudiosrc_class_init),
(gst_sunaudiosrc_init), (gst_sunaudiosrc_set_property),
(gst_sunaudiosrc_get_property), (gst_sunaudiosrc_getcaps),
(gst_sunaudiosrc_open), (gst_sunaudiosrc_close),
(gst_sunaudiosrc_prepare), (gst_sunaudiosrc_unprepare),
(gst_sunaudiosrc_read), (gst_sunaudiosrc_delay),
(gst_sunaudiosrc_reset):
* sys/sunaudio/gstsunaudiosrc.h:
Add a SunAudio source plugin.
Support stereo and right/left channel gain in the mixer plugin.
Support the RECORD flag so that you can switch between line-input and
microphone in gnome-volume-control.
Code cleanups like using an enumerator for track number instead of an
integer. Fixes #344923.
2006-06-20 Wim Taymans <wim@fluendo.com>
Patch by: Joni Valtanen <joni dot valtanen at movial dot fi>
......
......@@ -4,18 +4,20 @@ libgstsunaudio_la_SOURCES = gstsunaudio.c \
gstsunaudiosink.c \
gstsunaudiomixerctrl.c \
gstsunaudiomixer.c \
gstsunaudiomixertrack.c
gstsunaudiomixertrack.c \
gstsunaudiosrc.c
libgstsunaudio_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstsunaudio_la_LIBADD = \
-lgstinterfaces-@GST_MAJORMINOR@ \
-lgstaudio-@GST_MAJORMINOR@ \
$(GST_PLUGINS_BASE_LIBS) \
-lgstinterfaces-$(GST_MAJORMINOR) \
-lgstaudio-(GST_MAJORMINOR) \
$(GST_LIBS)
libgstsunaudio_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstsunaudiosink.h \
gstsunaudiomixer.h \
gstsunaudiomixerctrl.h \
gstsunaudiomixertrack.h
gstsunaudiomixertrack.h \
gstsunaudiosrc.h
......@@ -26,6 +26,7 @@
#include "gstsunaudiomixer.h"
#include "gstsunaudiosink.h"
#include "gstsunaudiosrc.h"
extern gchar *__gst_oss_plugin_dir;
......@@ -37,7 +38,9 @@ plugin_init (GstPlugin * plugin)
if (!gst_element_register (plugin, "sunaudiomixer", GST_RANK_NONE,
GST_TYPE_SUNAUDIO_MIXER) ||
!gst_element_register (plugin, "sunaudiosink", GST_RANK_SECONDARY,
GST_TYPE_SUNAUDIO_SINK)) {
GST_TYPE_SUNAUDIO_SINK) ||
!gst_element_register (plugin, "sunaudiosrc", GST_RANK_SECONDARY,
GST_TYPE_SUNAUDIO_SRC)) {
return FALSE;
}
......
......@@ -66,18 +66,42 @@ void
gst_sunaudiomixer_ctrl_build_list (GstSunAudioMixerCtrl * mixer)
{
GstMixerTrack *track;
g_return_if_fail (mixer->mixer_fd != -1);
struct audio_info audioinfo;
/*
* Do not continue appending the same 3 static tracks onto the list
*/
if (mixer->tracklist == NULL) {
track = gst_sunaudiomixer_track_new (0, 1, GST_MIXER_TRACK_OUTPUT);
g_return_if_fail (mixer->mixer_fd != -1);
/* Output */
track = gst_sunaudiomixer_track_new (GST_SUNAUDIO_TRACK_OUTPUT,
2, GST_MIXER_TRACK_OUTPUT);
mixer->tracklist = g_list_append (mixer->tracklist, track);
track = gst_sunaudiomixer_track_new (1, 1, GST_MIXER_TRACK_INPUT);
/* Input */
track = gst_sunaudiomixer_track_new (GST_SUNAUDIO_TRACK_LINE_IN,
2, GST_MIXER_TRACK_INPUT);
/* Set whether we are recording from microphone or from line-in */
if (ioctl (mixer->mixer_fd, AUDIO_GETINFO, &audioinfo) < 0) {
g_warning ("Error getting audio device volume");
return;
}
/* Set initial RECORD status */
if (audioinfo.record.port == AUDIO_MICROPHONE) {
mixer->recdevs |= (1 << GST_SUNAUDIO_TRACK_LINE_IN);
track->flags |= GST_MIXER_TRACK_RECORD;
} else {
mixer->recdevs &= ~(1 << GST_SUNAUDIO_TRACK_LINE_IN);
track->flags &= ~GST_MIXER_TRACK_RECORD;
}
/* Monitor */
mixer->tracklist = g_list_append (mixer->tracklist, track);
track = gst_sunaudiomixer_track_new (2, 1, GST_MIXER_TRACK_OUTPUT);
track = gst_sunaudiomixer_track_new (GST_SUNAUDIO_TRACK_MONITOR,
2, GST_MIXER_TRACK_OUTPUT);
mixer->tracklist = g_list_append (mixer->tracklist, track);
}
}
......@@ -135,6 +159,7 @@ const GList *
gst_sunaudiomixer_ctrl_list_tracks (GstSunAudioMixerCtrl * mixer)
{
gst_sunaudiomixer_ctrl_build_list (mixer);
return (const GList *) mixer->tracklist;
}
......@@ -142,6 +167,8 @@ void
gst_sunaudiomixer_ctrl_get_volume (GstSunAudioMixerCtrl * mixer,
GstMixerTrack * track, gint * volumes)
{
gint gain, balance;
float ratio;
struct audio_info audioinfo;
GstSunAudioMixerTrack *sunaudiotrack = GST_SUNAUDIO_MIXER_TRACK (track);
......@@ -153,57 +180,136 @@ gst_sunaudiomixer_ctrl_get_volume (GstSunAudioMixerCtrl * mixer,
}
switch (sunaudiotrack->track_num) {
case 0:
sunaudiotrack->vol = volumes[0] =
(audioinfo.play.gain / SCALE_FACTOR) + 0.5;
case GST_SUNAUDIO_TRACK_OUTPUT:
gain = (int) ((float) audioinfo.play.gain / (float) SCALE_FACTOR + 0.5);
balance = audioinfo.play.balance;
break;
case 1:
sunaudiotrack->vol = volumes[0] =
(audioinfo.record.gain / SCALE_FACTOR) + 0.5;
case GST_SUNAUDIO_TRACK_LINE_IN:
gain = (int) ((float) audioinfo.record.gain / (float) SCALE_FACTOR + 0.5);
balance = audioinfo.record.balance;
break;
case 2:
sunaudiotrack->vol = volumes[0] =
(audioinfo.monitor_gain / SCALE_FACTOR) + 0.5;
case GST_SUNAUDIO_TRACK_MONITOR:
gain =
(int) ((float) audioinfo.monitor_gain / (float) SCALE_FACTOR + 0.5);
balance = audioinfo.record.balance;
break;
}
if (balance == AUDIO_MID_BALANCE) {
volumes[0] = gain;
volumes[1] = gain;
} else if (balance < AUDIO_MID_BALANCE) {
volumes[0] = gain;
ratio = 1 - (float) (AUDIO_MID_BALANCE - balance) /
(float) AUDIO_MID_BALANCE;
volumes[1] = (int) ((float) gain * ratio + 0.5);
} else {
volumes[1] = gain;
ratio = 1 - (float) (balance - AUDIO_MID_BALANCE) /
(float) AUDIO_MID_BALANCE;
volumes[0] = (int) ((float) gain * ratio + 0.5);
}
/*
* Reset whether we are recording from microphone or from line-in.
* This can change if another program resets the value (such as
* sdtaudiocontrol), so it is good to update the flag when we
* get the volume. The gnome-volume-control program calls this
* function in a loop so the value will update properly when
* changed.
*/
if ((audioinfo.record.port == AUDIO_MICROPHONE &&
!GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_RECORD)) ||
(audioinfo.record.port == AUDIO_LINE_IN &&
GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_RECORD))) {
if (audioinfo.record.port == AUDIO_MICROPHONE) {
mixer->recdevs |= (1 << GST_SUNAUDIO_TRACK_LINE_IN);
track->flags |= GST_MIXER_TRACK_RECORD;
} else {
mixer->recdevs &= ~(1 << GST_SUNAUDIO_TRACK_LINE_IN);
track->flags &= ~GST_MIXER_TRACK_RECORD;
}
}
/* Likewise reset MUTE */
if ((sunaudiotrack->track_num == GST_SUNAUDIO_TRACK_OUTPUT &&
audioinfo.output_muted == 1) ||
(sunaudiotrack->track_num != GST_SUNAUDIO_TRACK_OUTPUT && gain == 0)) {
track->flags |= GST_MIXER_TRACK_MUTE;
} else {
/*
* If MUTE is set, then gain is always 0, so don't bother
* resetting our internal value.
*/
sunaudiotrack->gain = gain;
sunaudiotrack->balance = balance;
track->flags &= ~GST_MIXER_TRACK_MUTE;
}
}
void
gst_sunaudiomixer_ctrl_set_volume (GstSunAudioMixerCtrl * mixer,
GstMixerTrack * track, gint * volumes)
{
gint volume;
gint gain;
gint balance;
gint l_real_gain;
gint r_real_gain;
float ratio;
gchar buf[100];
struct audio_info audioinfo;
GstSunAudioMixerTrack *sunaudiotrack = GST_SUNAUDIO_MIXER_TRACK (track);
gint temp[2];
l_real_gain = volumes[0];
r_real_gain = volumes[1];
if (l_real_gain == r_real_gain) {
gain = (int) ((float) l_real_gain * (float) SCALE_FACTOR + 0.5);
balance = AUDIO_MID_BALANCE;
} else if (l_real_gain < r_real_gain) {
gain = (int) ((float) r_real_gain * (float) SCALE_FACTOR + 0.5);
ratio = (float) l_real_gain / (float) r_real_gain;
balance =
AUDIO_RIGHT_BALANCE - (int) (ratio * (float) AUDIO_MID_BALANCE + 0.5);
} else {
gain = (int) ((float) l_real_gain * (float) SCALE_FACTOR + 0.5);
ratio = (float) r_real_gain / (float) l_real_gain;
balance =
AUDIO_LEFT_BALANCE + (int) (ratio * (float) AUDIO_MID_BALANCE + 0.5);
}
g_return_if_fail (mixer->mixer_fd != -1);
if (volume < 0)
volume = 0;
sunaudiotrack->gain = gain;
sunaudiotrack->balance = balance;
volume = volumes[0] * SCALE_FACTOR;
if (GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_MUTE))
return;
/* Set the volume */
AUDIO_INITINFO (&audioinfo);
switch (sunaudiotrack->track_num) {
case 0:
audioinfo.play.gain = volume;
case GST_SUNAUDIO_TRACK_OUTPUT:
audioinfo.play.gain = gain;
audioinfo.play.balance = balance;
break;
case 1:
audioinfo.record.gain = volume;
case GST_SUNAUDIO_TRACK_LINE_IN:
audioinfo.record.gain = gain;
audioinfo.record.balance = balance;
break;
case 2:
audioinfo.monitor_gain = volume;
case GST_SUNAUDIO_TRACK_MONITOR:
audioinfo.monitor_gain = gain;
audioinfo.record.balance = balance;
break;
}
g_return_if_fail (mixer->mixer_fd != -1);
if (ioctl (mixer->mixer_fd, AUDIO_SETINFO, &audioinfo) < 0) {
g_warning ("Error setting audio device volume");
return;
}
sunaudiotrack->vol = volume;
}
void
......@@ -212,9 +318,7 @@ gst_sunaudiomixer_ctrl_set_mute (GstSunAudioMixerCtrl * mixer,
{
struct audio_info audioinfo;
GstSunAudioMixerTrack *sunaudiotrack = GST_SUNAUDIO_MIXER_TRACK (track);
gint volume;
g_return_if_fail (mixer->mixer_fd != -1);
gint volume, balance;
AUDIO_INITINFO (&audioinfo);
......@@ -222,12 +326,14 @@ gst_sunaudiomixer_ctrl_set_mute (GstSunAudioMixerCtrl * mixer,
volume = 0;
track->flags |= GST_MIXER_TRACK_MUTE;
} else {
volume = sunaudiotrack->vol;
volume = sunaudiotrack->gain;
track->flags &= ~GST_MIXER_TRACK_MUTE;
}
balance = sunaudiotrack->balance;
switch (sunaudiotrack->track_num) {
case 0:
case GST_SUNAUDIO_TRACK_OUTPUT:
if (mute)
audioinfo.output_muted = 1;
......@@ -235,15 +341,20 @@ gst_sunaudiomixer_ctrl_set_mute (GstSunAudioMixerCtrl * mixer,
audioinfo.output_muted = 0;
audioinfo.play.gain = volume;
audioinfo.play.balance = balance;
break;
case 1:
case GST_SUNAUDIO_TRACK_LINE_IN:
audioinfo.record.gain = volume;
audioinfo.record.balance = balance;
break;
case 2:
case GST_SUNAUDIO_TRACK_MONITOR:
audioinfo.monitor_gain = volume;
audioinfo.record.balance = balance;
break;
}
g_return_if_fail (mixer->mixer_fd != -1);
if (ioctl (mixer->mixer_fd, AUDIO_SETINFO, &audioinfo) < 0) {
g_warning ("Error setting audio device volume");
return;
......@@ -254,5 +365,43 @@ void
gst_sunaudiomixer_ctrl_set_record (GstSunAudioMixerCtrl * mixer,
GstMixerTrack * track, gboolean record)
{
/* Implementation Pending */
GstSunAudioMixerTrack *sunaudiotrack = GST_SUNAUDIO_MIXER_TRACK (track);
struct audio_info audioinfo;
GList *trk;
/* Don't change the setting */
if ((record && GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_RECORD)) ||
(!record && !GST_MIXER_TRACK_HAS_FLAG (track, GST_MIXER_TRACK_RECORD)))
return;
/*
* So there is probably no need to look for others, but reset them all
* to being off.
*/
for (trk = mixer->tracklist; trk != NULL; trk = trk->next) {
GstMixerTrack *turn = (GstMixerTrack *) trk->data;
turn->flags &= ~GST_MIXER_TRACK_RECORD;
}
mixer->recdevs = 0;
/* Set the port */
AUDIO_INITINFO (&audioinfo);
if (record) {
audioinfo.record.port = AUDIO_MICROPHONE;
mixer->recdevs |= (1 << sunaudiotrack->track_num);
track->flags |= GST_MIXER_TRACK_RECORD;
} else {
audioinfo.record.port = AUDIO_LINE_IN;
mixer->recdevs &= ~(1 << sunaudiotrack->track_num);
track->flags &= ~GST_MIXER_TRACK_RECORD;
}
g_return_if_fail (mixer->mixer_fd != -1);
if (ioctl (mixer->mixer_fd, AUDIO_SETINFO, &audioinfo) < 0) {
g_warning ("Error setting audio device volume");
return;
}
}
......@@ -37,6 +37,7 @@ struct _GstSunAudioMixerCtrl {
gint mixer_fd;
gchar * device;
gint recdevs;
};
GstSunAudioMixerCtrl* gst_sunaudiomixer_ctrl_new (const gchar *device);
......
......@@ -31,20 +31,20 @@
#include <string.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/audioio.h>
#include <gst/gst-i18n-plugin.h>
#include "gstsunaudiomixertrack.h"
#define MIXER_DEVICES 3
#define MASK_BIT_IS_SET(mask, bit) \
(mask & (1 << bit))
G_DEFINE_TYPE (GstSunAudioMixerTrack, gst_sunaudiomixer_track,
GST_TYPE_MIXER_TRACK);
GST_TYPE_MIXER_TRACK)
static void
gst_sunaudiomixer_track_class_init (GstSunAudioMixerTrackClass * klass)
static void
gst_sunaudiomixer_track_class_init (GstSunAudioMixerTrackClass * klass)
{
/* nop */
}
......@@ -52,7 +52,8 @@ gst_sunaudiomixer_track_class_init (GstSunAudioMixerTrackClass * klass)
static void
gst_sunaudiomixer_track_init (GstSunAudioMixerTrack * track)
{
track->vol = 0;
track->gain = 0;
track->balance = AUDIO_MID_BALANCE;
track->track_num = 0;
}
......@@ -85,10 +86,12 @@ fill_labels (void)
}
GstMixerTrack *
gst_sunaudiomixer_track_new (gint track_num, gint max_chans, gint flags)
gst_sunaudiomixer_track_new (GstSunAudioTrackType track_num,
gint max_chans, gint flags)
{
GstSunAudioMixerTrack *sunaudiotrack;
GstMixerTrack *track;
gint volume;
if (!labels)
fill_labels ();
......@@ -101,8 +104,8 @@ gst_sunaudiomixer_track_new (gint track_num, gint max_chans, gint flags)
track->min_volume = 0;
track->max_volume = 100;
sunaudiotrack->track_num = track_num;
sunaudiotrack->vol = (0 & 0xff);
sunaudiotrack->gain = (0 & 0xff);
sunaudiotrack->balance = AUDIO_MID_BALANCE;
return track;
}
......@@ -27,6 +27,15 @@
G_BEGIN_DECLS
typedef enum
{
GST_SUNAUDIO_TRACK_OUTPUT = 0,
GST_SUNAUDIO_TRACK_LINE_IN = 1,
GST_SUNAUDIO_TRACK_MONITOR = 2,
} GstSunAudioTrackType;
#define MIXER_DEVICES 3
#define GST_TYPE_SUNAUDIO_MIXER_TRACK \
(gst_sunaudiomixer_track_get_type ())
#define GST_SUNAUDIO_MIXER_TRACK(obj) \
......@@ -43,8 +52,9 @@ G_BEGIN_DECLS
typedef struct _GstSunAudioMixerTrack {
GstMixerTrack parent;
gint vol;
gint track_num;
gint gain;
gint balance;
GstSunAudioTrackType track_num;
} GstSunAudioMixerTrack;
typedef struct _GstSunAudioMixerTrackClass {
......
/* GStreamer
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
* 2000,2005 Wim Taymans <wim@fluendo.com>
*
* gstsunaudiosrc.c:
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* 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., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* SECTION:element-sunaudiosrc
*
* <refsect2>
* <para>
* sunaudiosrc is an audio source designed to work with the Sun Audio
* interface available in Solaris.
* </para>
* <title>Example launch line</title>
* <para>
* <programlisting>
*
* gst-launch sunaudiosrc ! filesink location=outfile
* </programlisting>
* </para>
* </refsect2>
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <stropts.h>
#include "gstsunaudiosrc.h"
static GstElementDetails plugin_details =
GST_ELEMENT_DETAILS ("Sun Audio Source",
"Source/Audio",
"Audio source for Sun Audio devices",
"Brian Cameron <brian.cameron@sun.com>");
static void gst_sunaudiosrc_base_init (gpointer g_class);
static void gst_sunaudiosrc_class_init (GstSunAudioSrcClass * klass);
static void gst_sunaudiosrc_init (GstSunAudioSrc * sunaudiosrc,
GstSunAudioSrcClass * g_class);
static void gst_sunaudiosrc_dispose (GObject * object);
static void gst_sunaudiosrc_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_sunaudiosrc_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
static GstCaps *gst_sunaudiosrc_getcaps (GstBaseSrc * bsrc);
static gboolean gst_sunaudiosrc_open (GstAudioSrc * asrc);
static gboolean gst_sunaudiosrc_close (GstAudioSrc * asrc);
static gboolean gst_sunaudiosrc_prepare (GstAudioSrc * asrc,
GstRingBufferSpec * spec);
static gboolean gst_sunaudiosrc_unprepare (GstAudioSrc * asrc);
static guint gst_sunaudiosrc_read (GstAudioSrc * asrc, gpointer data,
guint length);
static guint gst_sunaudiosrc_delay (GstAudioSrc * asrc);
static void gst_sunaudiosrc_reset (GstAudioSrc * asrc);
#define DEFAULT_DEVICE "/dev/audio"
#define DEFAULT_DEVICE_NAME ""
enum
{
PROP_0,
PROP_DEVICE,
PROP_DEVICE_NAME,
};
GST_BOILERPLATE_WITH_INTERFACE (GstSunAudioSrc, gst_sunaudiosrc,
GstAudioSrc, GST_TYPE_AUDIO_SRC, GstMixer, GST_TYPE_MIXER, gst_sunaudiosrc)
GST_IMPLEMENT_SUNAUDIO_MIXER_CTRL_METHODS (GstSunAudioSrc, gst_sunaudiosrc)
static GstStaticPadTemplate gst_sunaudiosrc_factory =
GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, "
"endianness = (int) BYTE_ORDER, "
"signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, "
/* [5510,48000] seems to be a Solaris limit */
"rate = (int) [ 5510, 48000 ], " "channels = (int) [ 1, 2 ]")
);
static void gst_sunaudiosrc_dispose (GObject * object)
{
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gst_sunaudiosrc_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get (&gst_sunaudiosrc_factory));
gst_element_class_set_details (element_class, &plugin_details);