--- gst-plugins-good-0.9.4/configure.ac-orig	2005-11-11 16:12:24.517615000 -0600
+++ gst-plugins-good-0.9.4/configure.ac	2005-11-10 11:04:52.138137000 -0600
@@ -335,6 +335,12 @@ dnl Some old BSD versions :
  ])
 ])
 
+dnl *** Sun Audio ***
+translit(dnm, m, l) AM_CONDITIONAL(USE_SUNAUDIO, true)
+GST_CHECK_FEATURE(SUNAUDIO, [Sun Audio], sunaudiosink, [
+  AC_CHECK_HEADER(sys/audioio.h, HAVE_SUNAUDIO="yes", HAVE_SUNAUDIO="no")
+])
+
 dnl ###########################
 dnl # Configure external libs #
 dnl ###########################
@@ -623,6 +629,7 @@ ext/shout2/Makefile
 ext/speex/Makefile
 sys/Makefile
 sys/oss/Makefile
+sys/sunaudio/Makefile
 po/Makefile.in
 gconf/Makefile
 gconf/gstreamer.schemas
--- gst-plugins-good-0.9.4/sys/Makefile.am-orig	2005-11-11 16:12:02.718775000 -0600
+++ gst-plugins-good-0.9.4/sys/Makefile.am	2005-11-10 11:05:08.046720000 -0600
@@ -10,6 +10,12 @@ else
 OSS_DIR=
 endif
 
+if USE_SUNAUDIO
+SUNAUDIO_DIR=sunaudio
+else
+SUNAUDIO_DIR=
+endif
+
 # if USE_OSX_AUDIO
 # OSX_AUDIO_DIR=osxaudio
 # else
@@ -58,6 +64,6 @@ endif
 # GL_DIR=
 # endif
 
-SUBDIRS=$(OSS_DIR) 
+SUBDIRS=$(OSS_DIR) $(SUNAUDIO_DIR)
 
 DIST_SUBDIRS=oss
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/Makefile.am	2005-11-09 17:31:21.000000000 -0600
@@ -0,0 +1,21 @@
+plugin_LTLIBRARIES = libgstsunaudio.la
+
+libgstsunaudio_la_SOURCES = gstsunaudio.c \
+                            gstsunaudiosink.c \
+                            gstsunaudiomixer.c \
+                            gstsunaudiomixerelement.c \
+                            gstsunaudiomixertrack.c
+
+libgstsunaudio_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
+libgstsunaudio_la_LIBADD = \
+        -lgstinterfaces-@GST_MAJORMINOR@ \
+        -lgstaudio-@GST_MAJORMINOR@ \
+        $(GST_PLUGINS_BASE_LIBS) \
+        $(GST_LIBS)
+libgstsunaudio_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+
+noinst_HEADERS = gstsunaudiosink.h \
+                 gstsunaudiomixer.h \
+                 gstsunaudiomixerelement.h \
+                 gstsunaudiomixertrack.h
+
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudio.c	2005-11-11 16:12:39.541960000 -0600
@@ -0,0 +1,57 @@
+/* GStreamer
+ * Copyright (C) <2005> Brian Cameron <brian.cameron@sun.com>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gst/gst-i18n-plugin.h"
+
+#include "gstsunaudiomixerelement.h"
+#include "gstsunaudiosink.h"
+
+extern gchar *__gst_oss_plugin_dir;
+
+GST_DEBUG_CATEGORY (sunaudio_debug);
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+  if (!gst_element_register (plugin, "sunaudiomixer", GST_RANK_NONE,
+          GST_TYPE_SUNAUDIO_MIXER_ELEMENT) ||
+      !gst_element_register (plugin, "sunaudiosink", GST_RANK_SECONDARY,
+          GST_TYPE_SUNAUDIO_SINK)) {
+    return FALSE;
+  }
+
+  GST_DEBUG_CATEGORY_INIT (sunaudio_debug, "sunaudio", 0, "sunaudio elements");
+
+#ifdef ENABLE_NLS
+  setlocale (LC_ALL, "");
+  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+#endif /* ENABLE_NLS */
+
+  return TRUE;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+    GST_VERSION_MINOR,
+    "sunaudio",
+    "Sun Audio support for GStreamer",
+    plugin_init, VERSION, GST_LICENSE, GST_PACKAGE, GST_ORIGIN)
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudiomixer.c	2005-11-11 16:12:39.542008000 -0600
@@ -0,0 +1,230 @@
+/*
+ * GStreamer
+ * Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/ioctl.h>
+
+#include <gst/gst-i18n-plugin.h>
+
+#include "gstsunaudiomixer.h"
+#include "gstsunaudiomixertrack.h"
+
+#define SCALE_FACTOR 2.55       /* 255/100 */
+
+static gboolean
+gst_sunaudiomixer_open (GstSunAudioMixer * sunaudio)
+{
+  int fd;
+
+  /* First try to open non-blocking */
+  fd = open (sunaudio->device, O_RDWR | O_NONBLOCK);
+
+  if (fd >= 0) {
+     close (fd);
+     fd = open (sunaudio->device, O_WRONLY);
+  }
+
+  if (fd == -1) {
+    GST_DEBUG ("Failed to open mixer device %s, mixing disabled: %s",
+        sunaudio->device, strerror (errno));
+
+    return FALSE;
+  }
+
+  sunaudio->mixer_fd = fd;
+  return TRUE;
+}
+
+void
+gst_sunaudiomixer_build_list (GstSunAudioMixer * sunaudio)
+{
+  GstMixerTrack *track;
+
+  g_return_if_fail (sunaudio->mixer_fd != -1);
+
+  track = gst_sunaudiomixer_track_new (0, 1, GST_MIXER_TRACK_OUTPUT);
+  sunaudio->tracklist = g_list_append (sunaudio->tracklist, track);
+  track = gst_sunaudiomixer_track_new (1, 1, 0);
+  sunaudio->tracklist = g_list_append (sunaudio->tracklist, track);
+  track = gst_sunaudiomixer_track_new (2, 1, 0);
+  sunaudio->tracklist = g_list_append (sunaudio->tracklist, track);
+}
+
+GstSunAudioMixer *
+gst_sunaudiomixer_new (const char *device)
+{
+  GstSunAudioMixer *ret = NULL;
+
+  g_return_val_if_fail (device != NULL, NULL);
+
+  ret = g_new0 (GstSunAudioMixer, 1);
+
+  ret->device = g_strdup (device);
+  ret->mixer_fd = -1;
+
+  if (!gst_sunaudiomixer_open (ret))
+    goto error;
+
+  return ret;
+
+error:
+  if (ret)
+    gst_sunaudiomixer_free (ret);
+
+  return NULL;
+}
+
+void
+gst_sunaudiomixer_free (GstSunAudioMixer * mixer)
+{
+  g_return_if_fail (mixer != NULL);
+
+  if (mixer->device) {
+    g_free (mixer->device);
+    mixer->device = NULL;
+  }
+
+  if (mixer->tracklist) {
+    g_list_foreach (mixer->tracklist, (GFunc) g_object_unref, NULL);
+    g_list_free (mixer->tracklist);
+    mixer->tracklist = NULL;
+  }
+
+  if (mixer->mixer_fd != -1) {
+    close (mixer->mixer_fd);
+    mixer->mixer_fd = -1;
+  }
+
+  g_free (mixer);
+}
+
+const GList *
+gst_sunaudiomixer_list_tracks (GstSunAudioMixer * mixer)
+{
+  gst_sunaudiomixer_build_list (mixer);
+  return (const GList *) mixer->tracklist;
+}
+
+static void
+gst_sunaudiomixer_get_volume (GstSunAudioMixer * mixer,
+    GstMixerTrack * track, gint * volumes)
+{
+  gint volume;
+  struct audio_info audioinfo;
+  GstSunAudioMixerTrack *sunaudiotrack = GST_SUNAUDIO_MIXER_TRACK (track);
+
+  g_return_if_fail (mixer->mixer_fd != -1);
+
+  if (ioctl (mixer->mixer_fd, AUDIO_GETINFO, &audioinfo) < 0) {
+    g_warning ("Error setting volume device");
+    return;
+  }
+
+  switch (sunaudiotrack->track_num) {
+    case 0:
+      sunaudiotrack->lvol = volumes[0] =
+          (audioinfo.play.gain / SCALE_FACTOR) + 0.5;
+      break;
+    case 1:
+      sunaudiotrack->lvol = volumes[0] =
+          (audioinfo.record.gain / SCALE_FACTOR) + 0.5;
+      break;
+    case 2:
+      sunaudiotrack->lvol = volumes[0] =
+          (audioinfo.monitor_gain / SCALE_FACTOR) + 0.5;
+      break;
+  }
+}
+
+void
+gst_sunaudiomixer_set_volume (GstSunAudioMixer * mixer,
+    GstMixerTrack * track, gint * volumes)
+{
+  gint volume;
+  gchar buf[100];
+  struct audio_info audioinfo;
+  GstSunAudioMixerTrack *sunaudiotrack = GST_SUNAUDIO_MIXER_TRACK (track);
+
+  g_return_if_fail (mixer->mixer_fd != -1);
+
+  volume = volumes[0] * SCALE_FACTOR + 0.5;
+
+  /* Set the volume */
+  AUDIO_INITINFO (&audioinfo);
+
+  switch (sunaudiotrack->track_num) {
+    case 0:
+      audioinfo.play.gain = volume;
+      break;
+    case 1:
+      audioinfo.record.gain = volume;
+      break;
+    case 2:
+      audioinfo.monitor_gain = volume;
+      break;
+  }
+
+  if (ioctl (mixer->mixer_fd, AUDIO_SETINFO, &audioinfo) < 0) {
+    g_warning ("Error setting volume");
+    return;
+  }
+}
+
+static void
+gst_sunaudiomixer_set_mute (GstSunAudioMixer * sunaudio,
+    GstMixerTrack * track, gboolean mute)
+{
+  struct audio_info audioinfo;
+  GstSunAudioMixerTrack *sunaudiotrack = GST_SUNAUDIO_MIXER_TRACK (track);
+
+  g_return_if_fail (sunaudio->mixer_fd != -1);
+  if (sunaudiotrack->track_num != 0)
+    return;
+
+  AUDIO_INITINFO (&audioinfo);
+
+  if (mute) {
+    audioinfo.output_muted = 1;
+  } else {
+    audioinfo.output_muted = 0;
+  }
+
+  if (ioctl (sunaudio->mixer_fd, AUDIO_SETINFO, &audioinfo) < 0) {
+    g_warning ("Error setting volume device");
+    return;
+  }
+}
+
+static void
+gst_sunaudiomixer_set_record (GstSunAudioMixer * mixer,
+    GstMixerTrack * track, gboolean record)
+{
+  /* Implementation Pending */
+}
+
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudiomixer.h	2005-11-11 16:12:39.541733000 -0600
@@ -0,0 +1,142 @@
+/* SunAudio mixer interface element.
+ * Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __GST_SUNAUDIO_MIXER_H
+#define __GST_SUNAUDIO_MIXER_H
+
+#include <sys/audioio.h>
+
+#include <gst/gst.h>
+#include <gst/interfaces/mixer.h>
+
+G_BEGIN_DECLS
+
+#define GST_SUNAUDIO_MIXER(obj)                   ((GstSunAudioMixer*)(obj))
+
+typedef struct _GstSunAudioMixer GstSunAudioMixer;
+
+struct _GstSunAudioMixer {
+  GList *               tracklist;      /* list of available tracks */
+
+  gint                  fd;
+  gint                  mixer_fd;
+
+  gchar *               device;
+};
+
+GstSunAudioMixer* gst_sunaudiomixer_new          (const gchar *device);
+void              gst_sunaudiomixer_free         (GstSunAudioMixer *mixer);
+
+const GList*      gst_sunaudiomixer_list_tracks  (GstSunAudioMixer * mixer);
+void              gst_sunaudiomixer_set_volume   (GstSunAudioMixer * mixer,
+                                                  GstMixerTrack * track,
+                                                  gint * volumes);
+void              gst_sunaudiomixer_get_volume   (GstSunAudioMixer * mixer,
+                                                  GstMixerTrack * track,
+                                                  gint * volumes);
+void              gst_sunaudiomixer_set_record   (GstSunAudioMixer * mixer,
+                                                  GstMixerTrack * track,
+                                                  gboolean record);
+void              gst_sunaudiomixer_set_mute     (GstSunAudioMixer * mixer,
+                                                  GstMixerTrack * track,
+                                                  gboolean mute);
+
+#define GST_IMPLEMENT_SUNAUDIO_MIXER_METHODS(Type, interface_as_function)       \
+static gboolean                                                                 \
+interface_as_function ## _supported (Type *this, GType iface_type)              \
+{                                                                               \
+  g_assert (iface_type == GST_TYPE_MIXER);                                      \
+                                                                                \
+  return (this->mixer != NULL);                                                 \
+}                                                                               \
+                                                                                \
+static const GList*                                                             \
+interface_as_function ## _list_tracks (GstMixer * mixer)                        \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_val_if_fail (this != NULL, NULL);                                    \
+  g_return_val_if_fail (this->mixer != NULL, NULL);                             \
+                                                                                \
+  return gst_sunaudiomixer_list_tracks (this->mixer);                           \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _set_volume (GstMixer * mixer, GstMixerTrack * track,  \
+    gint * volumes)                                                             \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_if_fail (this != NULL);                                              \
+  g_return_if_fail (this->mixer != NULL);                                       \
+                                                                                \
+  gst_sunaudiomixer_set_volume (this->mixer, track, volumes);                   \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _get_volume (GstMixer * mixer, GstMixerTrack * track,  \
+    gint * volumes)                                                             \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_if_fail (this != NULL);                                              \
+  g_return_if_fail (this->mixer != NULL);                                       \
+                                                                                \
+  gst_sunaudiomixer_get_volume (this->mixer, track, volumes);                   \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _set_record (GstMixer * mixer, GstMixerTrack * track,  \
+    gboolean record)                                                            \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_if_fail (this != NULL);                                              \
+  g_return_if_fail (this->mixer != NULL);                                       \
+                                                                                \
+  gst_sunaudiomixer_set_record (this->mixer, track, record);                    \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _set_mute (GstMixer * mixer, GstMixerTrack * track,    \
+    gboolean mute)                                                              \
+{                                                                               \
+  Type *this = (Type*) mixer;                                                   \
+                                                                                \
+  g_return_if_fail (this != NULL);                                              \
+  g_return_if_fail (this->mixer != NULL);                                       \
+                                                                                \
+  gst_sunaudiomixer_set_mute (this->mixer, track, mute);                        \
+}                                                                               \
+                                                                                \
+static void                                                                     \
+interface_as_function ## _interface_init (GstMixerClass * klass)                \
+{                                                                               \
+  GST_MIXER_TYPE (klass) = GST_MIXER_HARDWARE;                                  \
+                                                                                \
+  /* set up the interface hooks */                                              \
+  klass->list_tracks = interface_as_function ## _list_tracks;                   \
+  klass->set_volume = interface_as_function ## _set_volume;                     \
+  klass->get_volume = interface_as_function ## _get_volume;                     \
+  klass->set_mute = interface_as_function ## _set_mute;                         \
+  klass->set_record = interface_as_function ## _set_record;                     \
+}
+
+G_END_DECLS
+
+#endif
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudiomixerelement.c	2005-11-11 16:12:39.542057000 -0600
@@ -0,0 +1,92 @@
+/* SunAudio mixer interface element.
+ * Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstsunaudiomixerelement.h"
+
+static GstElementDetails gst_sunaudio_mixer_element_details =
+GST_ELEMENT_DETAILS ("Sun Audio Mixer",
+    "Generic/Audio",
+    "Control sound input and output levels with sunaudio",
+    "Brian Cameron <brian.cameron@sun.com>");
+
+GST_BOILERPLATE_WITH_INTERFACE (GstSunAudioMixerElement, gst_sunaudio_mixer_element,
+    GstElement, GST_TYPE_ELEMENT, GstMixer, GST_TYPE_MIXER,
+    gst_sunaudio_mixer_element);
+
+GST_IMPLEMENT_SUNAUDIO_MIXER_METHODS (GstSunAudioMixerElement, gst_sunaudio_mixer_element);
+
+static GstStateChangeReturn gst_sunaudio_mixer_element_change_state (GstElement *
+    element, GstStateChange transition);
+
+static void
+gst_sunaudio_mixer_element_base_init (gpointer klass)
+{
+  gst_element_class_set_details (GST_ELEMENT_CLASS (klass),
+      &gst_sunaudio_mixer_element_details);
+}
+
+static void
+gst_sunaudio_mixer_element_class_init (GstSunAudioMixerElementClass * klass)
+{
+  GstElementClass *element_class;
+
+  element_class = (GstElementClass *) klass;
+
+  element_class->change_state = gst_sunaudio_mixer_element_change_state;
+}
+
+static void
+gst_sunaudio_mixer_element_init (GstSunAudioMixerElement * this,
+    GstSunAudioMixerElementClass * g_class)
+{
+  this->mixer = NULL;
+}
+
+static GstStateChangeReturn
+gst_sunaudio_mixer_element_change_state (GstElement * element,
+    GstStateChange transition)
+{
+  GstSunAudioMixerElement *this = GST_SUNAUDIO_MIXER_ELEMENT (element);
+
+  switch (transition) {
+    case GST_STATE_CHANGE_NULL_TO_READY:
+      if (!this->mixer) {
+        this->mixer = gst_sunaudiomixer_new ("/dev/audioctl");
+      }
+      break;
+    case GST_STATE_CHANGE_READY_TO_NULL:
+      if (this->mixer) {
+        gst_sunaudiomixer_free (this->mixer);
+        this->mixer = NULL;
+      }
+      break;
+    default:
+      break;
+  }
+
+  if (GST_ELEMENT_CLASS (parent_class)->change_state)
+    return GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
+
+  return GST_STATE_CHANGE_SUCCESS;
+}
+
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudiomixerelement.h	2005-11-11 16:12:39.541808000 -0600
@@ -0,0 +1,49 @@
+/* SunAudio mixer interface element.
+ * Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __GST_SUNAUDIO_MIXER_ELEMENT_H__
+#define __GST_SUNAUDIO_MIXER_ELEMENT_H__
+
+#include "gstsunaudiomixer.h"
+
+G_BEGIN_DECLS
+
+#define GST_SUNAUDIO_MIXER_ELEMENT(obj)		(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SUNAUDIO_MIXER_ELEMENT,GstSunAudioMixerElement))
+#define GST_SUNAUDIO_MIXER_ELEMENT_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SUNAUDIO_MIXER_ELEMENT,GstSunAudioMixerElementClass))
+#define GST_IS_SUNAUDIO_MIXER_ELEMENT(obj)	(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SUNAUDIO_MIXER_ELEMENT))
+#define GST_IS_SUNAUDIO_MIXER_ELEMENT_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SUNAUDIO_MIXER_ELEMENT))
+#define GST_TYPE_SUNAUDIO_MIXER_ELEMENT		(gst_sunaudio_mixer_element_get_type())
+
+typedef struct _GstSunAudioMixerElement GstSunAudioMixerElement;
+typedef struct _GstSunAudioMixerElementClass GstSunAudioMixerElementClass;
+
+struct _GstSunAudioMixerElement {
+  GstElement		parent;
+
+  GstSunAudioMixer	*mixer;
+};
+
+struct _GstSunAudioMixerElementClass {
+  GstElementClass	parent;
+};
+
+GType		gst_sunaudio_mixer_element_get_type		(void);
+
+G_END_DECLS
+
+#endif /* __GST_SUNAUDIO_MIXER_ELEMENT_H__ */
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudiomixertrack.c	2005-11-11 16:12:39.542109000 -0600
@@ -0,0 +1,107 @@
+/* GStreamer OSS Mixer implementation
+ * Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
+ *
+ * gstsunaudiomixer.c: mixer interface implementation for OSS
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/ioctl.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);
+
+static void
+gst_sunaudiomixer_track_class_init (GstSunAudioMixerTrackClass * klass)
+{
+  /* nop */
+}
+
+static void
+gst_sunaudiomixer_track_init (GstSunAudioMixerTrack * track)
+{
+  track->lvol = track->rvol = 0;
+  track->track_num = 0;
+}
+
+static const gchar **labels = NULL;
+
+static void
+fill_labels (void)
+{
+  int i;
+  struct
+  {
+    gchar *given, *wanted;
+  }
+  cases[] = {
+    {
+    "Vol  ", N_("Volume")}
+    , {
+    "Gain ", N_("Gain")}
+    , {
+    "Mon  ", N_("Monitor")}
+    , {
+    NULL, NULL}
+  };
+
+  labels = g_malloc (sizeof (gchar *) * MIXER_DEVICES);
+
+  for (i = 0; i < MIXER_DEVICES; i++) {
+    labels[i] = g_strdup (cases[i].wanted);
+  }
+}
+
+GstMixerTrack *
+gst_sunaudiomixer_track_new (gint track_num, gint max_chans, gint flags)
+{
+  GstSunAudioMixerTrack *sunaudiotrack;
+  GstMixerTrack *track;
+  gint volume;
+
+  if (!labels)
+    fill_labels ();
+
+  sunaudiotrack = g_object_new (GST_TYPE_SUNAUDIO_MIXER_TRACK, NULL);
+  track = GST_MIXER_TRACK (sunaudiotrack);
+  track->label = g_strdup (labels[track_num]);
+  track->num_channels = max_chans;
+  track->flags = flags;
+  track->min_volume = 0;
+  track->max_volume = 100;
+  sunaudiotrack->track_num = track_num;
+
+  sunaudiotrack->lvol = (0 & 0xff);
+
+  return track;
+}
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudiomixertrack.h	2005-11-11 16:12:39.541862000 -0600
@@ -0,0 +1,59 @@
+/* GStreamer SunAudio Mixer implementation
+ * Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
+ *
+ * gstsunaudiomixertrack.h: SunAudio mixer tracks
+ *
+ * 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.
+ */
+
+#ifndef __GST_SUNAUDIO_MIXER_TRACK_H__
+#define __GST_SUNAUDIO_MIXER_TRACK_H__
+
+#include <gst/gst.h>
+#include <gst/interfaces/mixer.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_SUNAUDIO_MIXER_TRACK \
+  (gst_sunaudiomixer_track_get_type ())
+#define GST_SUNAUDIO_MIXER_TRACK(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SUNAUDIO_MIXER_TRACK, \
+			       GstSunAudioMixerTrack))
+#define GST_SUNAUDIO_MIXER_TRACK_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SUNAUDIO_MIXER_TRACK, \
+			    GstSunAudioMixerTrackClass))
+#define GST_IS_SUNAUDIO_MIXER_TRACK(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SUNAUDIO_MIXER_TRACK))
+#define GST_IS_SUNAUDIO_MIXER_TRACK_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SUNAUDIO_MIXER_TRACK))
+
+typedef struct _GstSunAudioMixerTrack {
+  GstMixerTrack parent;
+
+  gint          lvol, rvol;
+  gint          track_num;
+} GstSunAudioMixerTrack;
+
+typedef struct _GstSunAudioMixerTrackClass {
+  GstMixerTrackClass parent;
+} GstSunAudioMixerTrackClass;
+
+GType		gst_sunaudiomixer_track_get_type	(void);
+GstMixerTrack*	gst_sunaudiomixer_track_new		(gint track_num, gint max_chans, gint flags);
+
+G_END_DECLS
+
+#endif /* __GST_SUNAUDIO_MIXER_TRACK_H__ */
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudiosink.c	2005-11-11 16:12:39.542160000 -0600
@@ -0,0 +1,407 @@
+/*
+ * GStreamer
+ * Copyright (C) 2004 David A. Schleef <ds@schleef.org>
+ * Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/mman.h>
+
+#include "gstsunaudiosink.h"
+
+/* elementfactory information */
+static GstElementDetails plugin_details = 
+GST_ELEMENT_DETAILS ("Sun Audio Sink",
+  "Sink/Audio",
+  "Audio sink for Sun Audio devices",
+  "David A. Schleef <ds@schleef.org>, "
+  "Brian Cameron <brian.cameron@sun.com>");
+
+static void gst_sunaudiosink_base_init (gpointer g_class);
+static void gst_sunaudiosink_class_init (GstSunAudioSinkClass * klass);
+static void gst_sunaudiosink_init (GstSunAudioSink * filter);
+static void gst_sunaudiosink_dispose (GObject *object);
+
+static void gst_sunaudiosink_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec);
+static void gst_sunaudiosink_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec);
+
+static GstCaps *gst_sunaudiosink_getcaps (GstBaseSink * bsink);
+
+static gboolean gst_sunaudiosink_open (GstAudioSink * asink);
+static gboolean gst_sunaudiosink_close (GstAudioSink * asink);
+static gboolean gst_sunaudiosink_prepare (GstAudioSink * asink,
+    GstRingBufferSpec * spec);
+static gboolean gst_sunaudiosink_unprepare (GstAudioSink * asink);
+static guint gst_sunaudiosink_write (GstAudioSink * asink, gpointer data,
+    guint length);
+static guint gst_sunaudiosink_delay (GstAudioSink * asink);
+static void gst_sunaudiosink_reset (GstAudioSink * asink);
+
+#define DEFAULT_DEVICE  "/dev/audio"
+enum
+{
+  PROP_0,
+  PROP_DEVICE,
+};
+
+static GstStaticPadTemplate gst_sunaudiosink_factory =
+GST_STATIC_PAD_TEMPLATE ("sink",
+    GST_PAD_SINK,
+    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, 44100 ], "
+        "channels = (int) [ 1, 2 ]")
+    );
+
+static GstElementClass *parent_class = NULL;
+
+GType
+gst_sunaudiosink_get_type (void)
+{
+  static GType plugin_type = 0;
+
+  if (!plugin_type) {
+    static const GTypeInfo plugin_info = {
+      sizeof (GstSunAudioSinkClass),
+      gst_sunaudiosink_base_init,
+      NULL,
+      (GClassInitFunc) gst_sunaudiosink_class_init,
+      NULL,
+      NULL,
+      sizeof (GstSunAudioSink),
+      0,
+      (GInstanceInitFunc) gst_sunaudiosink_init,
+    };
+
+    plugin_type = g_type_register_static (GST_TYPE_AUDIO_SINK,
+        "GstSunAudioSink", &plugin_info, 0);
+  }
+  return plugin_type;
+}
+
+static void
+gst_sunaudiosink_dispose (GObject * object)
+{
+  G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+static void
+gst_sunaudiosink_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_sunaudiosink_factory));
+  gst_element_class_set_details (element_class, &plugin_details);
+}
+
+static void
+gst_sunaudiosink_class_init (GstSunAudioSinkClass * klass)
+{
+  GObjectClass *gobject_class;
+  GstElementClass *gstelement_class;
+  GstBaseSinkClass *gstbasesink_class;
+  GstBaseAudioSinkClass *gstbaseaudiosink_class;
+  GstAudioSinkClass *gstaudiosink_class;
+
+  gobject_class = (GObjectClass *) klass;
+  gstelement_class = (GstElementClass *) klass;
+  gstbasesink_class = (GstBaseSinkClass *) klass;
+  gstbaseaudiosink_class = (GstBaseAudioSinkClass *) klass;
+  gstaudiosink_class = (GstAudioSinkClass *) klass;
+
+  parent_class = g_type_class_ref (GST_TYPE_BASE_AUDIO_SINK);
+
+  gobject_class->dispose = gst_sunaudiosink_dispose;
+  gobject_class->set_property = GST_DEBUG_FUNCPTR (gst_sunaudiosink_set_property);
+  gobject_class->get_property = GST_DEBUG_FUNCPTR (gst_sunaudiosink_get_property);
+
+  g_object_class_install_property (gobject_class, PROP_DEVICE,
+      g_param_spec_string ("device", "Device", "Audio Device (/dev/audio)",
+          DEFAULT_DEVICE, G_PARAM_READWRITE));
+
+  gstbasesink_class->get_caps = GST_DEBUG_FUNCPTR (gst_sunaudiosink_getcaps);
+
+  gstaudiosink_class->open = GST_DEBUG_FUNCPTR (gst_sunaudiosink_open);
+  gstaudiosink_class->close = GST_DEBUG_FUNCPTR (gst_sunaudiosink_close);
+  gstaudiosink_class->prepare = GST_DEBUG_FUNCPTR (gst_sunaudiosink_prepare);
+  gstaudiosink_class->unprepare = GST_DEBUG_FUNCPTR (gst_sunaudiosink_unprepare);
+  gstaudiosink_class->write = GST_DEBUG_FUNCPTR (gst_sunaudiosink_write);
+  gstaudiosink_class->delay = GST_DEBUG_FUNCPTR (gst_sunaudiosink_delay);
+  gstaudiosink_class->reset = GST_DEBUG_FUNCPTR (gst_sunaudiosink_reset);
+}
+
+static void
+gst_sunaudiosink_init (GstSunAudioSink * sunaudiosink)
+{
+  const char *audiodev;
+  GstClockTime buffer_time;
+  GValue gvalue = {0, };
+
+  GST_DEBUG ("initializing sunaudiosink");
+
+ /*
+  * According to the Sun audio man page, this value can't be set and
+  * will be ignored for playback, but setting it the same way that
+  * esound does.  Probably not necessary, but doesn't hurt.
+  */
+  sunaudiosink->buffer_size = 8180;
+
+ /*
+  * Reset the buffer-time to 3ms instead of the normal default of 500us
+  * (6 times larger, in other words).  
+  *
+  * Setting a larger buffer causes the sinesrc to not stutter with this
+  * sink.  The fact that SunAudio requires a larger buffer should be
+  * investigated further to see if this is needed due to limitations of
+  * SunAudio itself or because of a more serious problem with the
+  * GStreamer engine on Solaris.
+  */ 
+  g_value_init (&gvalue, G_TYPE_INT64);
+  g_object_get_property (G_OBJECT (sunaudiosink), "buffer-time", &gvalue); 
+  buffer_time = g_value_get_int64 (&gvalue);
+  if (buffer_time < 3000000) {
+     g_value_set_int64 (&gvalue, 3000000);
+     g_object_set_property (G_OBJECT (sunaudiosink), "buffer-time", &gvalue);
+  }
+
+  audiodev = g_getenv ("AUDIODEV");
+  if (audiodev == NULL)
+    audiodev = DEFAULT_DEVICE;
+  sunaudiosink->device = g_strdup (audiodev);
+}
+
+static void
+gst_sunaudiosink_set_property (GObject * object, guint prop_id,
+    const GValue * value, GParamSpec * pspec)
+{
+  GstSunAudioSink *sunaudiosink;
+
+  sunaudiosink = GST_SUNAUDIO_SINK (object);
+
+  switch (prop_id) {
+    case PROP_DEVICE:
+      g_free (sunaudiosink->device);
+      sunaudiosink->device = g_strdup (g_value_get_string (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
+static void
+gst_sunaudiosink_get_property (GObject * object, guint prop_id,
+    GValue * value, GParamSpec * pspec)
+{
+  GstSunAudioSink *sunaudiosink;
+
+  sunaudiosink = GST_SUNAUDIO_SINK (object);
+
+  switch (prop_id) {
+    case PROP_DEVICE:
+      g_value_set_string (value, sunaudiosink->device);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+  }
+}
+
+static GstCaps *
+gst_sunaudiosink_getcaps (GstBaseSink * bsink)
+{
+  GstPadTemplate *pad_template;
+  GstCaps *caps = NULL;
+  GstSunAudioSink *sunaudiosink = GST_SUNAUDIO_SINK (bsink);
+
+  GST_DEBUG ("getcaps called");
+
+  pad_template = gst_static_pad_template_get (&gst_sunaudiosink_factory);
+  caps = gst_caps_copy (gst_pad_template_get_caps (pad_template));
+
+  return caps;
+}
+
+static gboolean
+gst_sunaudiosink_open (GstAudioSink * asink)
+{
+  GstSunAudioSink *sunaudiosink = GST_SUNAUDIO_SINK (asink);
+  int fd, ret;
+
+  /* First try to open non-blocking */
+  fd = open (sunaudiosink->device, O_WRONLY | O_NONBLOCK);
+
+  if (fd >= 0) {
+     close (fd);
+     fd = open (sunaudiosink->device, O_WRONLY);
+  }
+
+  if (fd == -1) {
+     GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, OPEN_WRITE, (NULL),
+        ("can't open connection to Sun Audio device %s", sunaudiosink->device));
+
+    return FALSE;
+  }
+
+  sunaudiosink->fd = fd;
+
+  ret = ioctl (fd, AUDIO_GETDEV, &sunaudiosink->dev);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+    return FALSE;
+  }
+
+  GST_DEBUG ("name %s", sunaudiosink->dev.name);
+  GST_DEBUG ("version %s", sunaudiosink->dev.version);
+  GST_DEBUG ("config %s", sunaudiosink->dev.config);
+
+  ret = ioctl (fd, AUDIO_GETINFO, &sunaudiosink->info);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+    return FALSE;
+  }
+
+  GST_DEBUG ("monitor_gain %d", sunaudiosink->info.monitor_gain);
+  GST_DEBUG ("output_muted %d", sunaudiosink->info.output_muted);
+  GST_DEBUG ("hw_features %08x", sunaudiosink->info.hw_features);
+  GST_DEBUG ("sw_features %08x", sunaudiosink->info.sw_features);
+  GST_DEBUG ("sw_features_enabled %08x", sunaudiosink->info.sw_features_enabled);
+
+  return TRUE;
+}
+
+static gboolean
+gst_sunaudiosink_close (GstAudioSink * asink)
+{
+  GstSunAudioSink *sunaudiosink = GST_SUNAUDIO_SINK (asink);
+  close (sunaudiosink->fd);
+  sunaudiosink->fd = -1;
+  return TRUE;
+}
+
+static gboolean
+gst_sunaudiosink_prepare (GstAudioSink *asink, GstRingBufferSpec *spec)
+{
+  GstSunAudioSink *sunaudiosink = GST_SUNAUDIO_SINK (asink);
+  audio_info_t ainfo;
+  int ret;
+  int ports;
+
+  ret = ioctl (sunaudiosink->fd, AUDIO_GETINFO, &ainfo);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+    return FALSE;
+  }
+
+  if (spec->width != 16)
+    return FALSE;
+
+  ports = ainfo.play.port;
+  if (!(ports & AUDIO_SPEAKER) && (ainfo.play.avail_ports & AUDIO_SPEAKER)) {
+    ports = ports | AUDIO_SPEAKER;
+  }
+
+  AUDIO_INITINFO (&ainfo);
+
+  ainfo.play.sample_rate = spec->rate;
+  ainfo.play.channels = spec->channels;
+  ainfo.play.precision = spec->width;
+  ainfo.play.encoding = AUDIO_ENCODING_LINEAR;
+  ainfo.play.port = ports;
+  ainfo.play.buffer_size = sunaudiosink->buffer_size;
+  ainfo.output_muted = 0;
+
+  ret = ioctl (sunaudiosink->fd, AUDIO_SETINFO, &ainfo);
+  if (ret == -1) {
+    GST_ELEMENT_ERROR (sunaudiosink, RESOURCE, SETTINGS, (NULL), ("%s",
+            strerror (errno)));
+    return FALSE;
+  }
+
+  return TRUE;
+}
+
+static gboolean
+gst_sunaudiosink_unprepare (GstAudioSink * asink)
+{
+  if (!gst_sunaudiosink_close (asink))
+    goto couldnt_close;
+
+  if (!gst_sunaudiosink_open (asink))
+    goto couldnt_reopen;
+
+  return TRUE;
+
+couldnt_close:
+  {
+    GST_DEBUG ("Could not close the audio device");
+    return FALSE;
+  }
+couldnt_reopen:
+  {
+    GST_DEBUG ("Could not reopen the audio device");
+    return FALSE;
+  }
+}
+
+static guint
+gst_sunaudiosink_write (GstAudioSink * asink, gpointer data, guint length)
+{
+  GstSunAudioSink *sunaudiosink = GST_SUNAUDIO_SINK (asink);
+
+  if (length > sunaudiosink->buffer_size)
+     return write (sunaudiosink->fd, data, sunaudiosink->buffer_size);
+  else
+     return write (sunaudiosink->fd, data, length);
+}
+
+/*
+ * Should provide the current delay between writing a sample to the
+ * audio device and that sample being actually played.  Returning 0 for
+ * now, but this isn't good for synchronization
+ */
+static guint
+gst_sunaudiosink_delay (GstAudioSink * asink)
+{
+   return 0;
+}
+
+static void
+gst_sunaudiosink_reset (GstAudioSink * asink)
+{
+   ioctl (GST_SUNAUDIO_SINK (asink)->fd, AUDIO_DRAIN, 0);
+   gst_sunaudiosink_close (asink);
+}
+
--- /dev/null	2005-11-11 16:13:21.000000000 -0600
+++ gst-plugins-good-0.9.4/sys/sunaudio/gstsunaudiosink.h	2005-11-11 16:12:39.541910000 -0600
@@ -0,0 +1,64 @@
+/* GStreamer
+ * Copyright (C) 2004 David A. Schleef <ds@schleef.org>
+ * Copyright (C) 2005 Brian Cameron <brian.cameron@sun.com>
+ *
+ * gstsunaudiosink.h:
+ *
+ * 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.
+ */
+
+
+#ifndef __GST_SUNAUDIO_SINK_H__
+#define __GST_SUNAUDIO_SINK_H__
+
+#include <sys/audioio.h>
+#include <gst/gst.h>
+#include <gst/audio/gstaudiosink.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_SUNAUDIO_SINK     (gst_sunaudiosink_get_type())
+#define GST_SUNAUDIO_SINK(obj)     (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SUNAUDIO_SINK,GstSunAudioSink))
+#define GST_SUNAUDIO_SINK_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SUNAUDIO_SINK,GstSunAudioSinkClass))
+#define GST_IS_SUNAUDIO_SINK(obj)       (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SUNAUDIO_SINK))
+#define GST_IS_SUNAUDIO_SINK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SUNAUDIO_SINK))
+
+typedef struct _GstSunAudioSink GstSunAudioSink;
+typedef struct _GstSunAudioSinkClass GstSunAudioSinkClass;
+
+struct _GstSunAudioSink {
+  GstAudioSink    sink;
+
+  gchar *device;
+  gint   fd;
+
+  audio_device_t dev;
+  audio_info_t info;
+
+  gint   bytes_per_sample;
+  gint   buffer_size;
+};
+
+struct _GstSunAudioSinkClass {
+  GstAudioSinkClass parent_class;
+};
+
+GType gst_sunaudiosink_get_type(void);
+
+G_END_DECLS
+
+#endif /* __GST_SUNAUDIO_SINK_H__ */
+
