Commit dd23afb6 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

sys: remove sunaudio plugin

Even though hooked up to the build system, it's clear that no one
has ever built or used this with GStreamer 1.x. It wants to link
against libgstinterfaces, which no longer exists. And uses 0.10-style
raw audio caps. And the last meaningful change was done in 2009.
Let's just remove it.
parent 2271fee7
......@@ -138,7 +138,7 @@ PLATFORMS
- Linux is of course fully supported
- FreeBSD is reported to work; other BSDs should work too
- Solaris is reported to work; a specific sunaudiosink plugin has been written
- Solaris is reported to work
- MacOSX works, binary 1.x packages can be built using the cerbero build tool
- Windows works; binary 1.x packages can be built using the cerbero build tool
- MSys/MinGW builds
......
......@@ -454,12 +454,6 @@ AG_GST_CHECK_FEATURE(OSS4, [Open Sound System 4], oss4, [
[OSS4_MISSING_HEADER="yes";HAVE_OSS4="no"])
])
dnl *** Sun Audio ***
translit(dnm, m, l) AM_CONDITIONAL(USE_SUNAUDIO, true)
AG_GST_CHECK_FEATURE(SUNAUDIO, [Sun Audio], sunaudio, [
AC_CHECK_HEADER(sys/audioio.h, HAVE_SUNAUDIO="yes", HAVE_SUNAUDIO="no")
])
dnl *** OSX Audio ***
translit(dnm, m, l) AM_CONDITIONAL(USE_OSX_AUDIO, true)
HAVE_IOS="no"
......@@ -888,7 +882,6 @@ AM_CONDITIONAL(USE_PULSE, false)
AM_CONDITIONAL(USE_SHOUT2, false)
AM_CONDITIONAL(USE_SOUP, false)
AM_CONDITIONAL(USE_SPEEX, false)
AM_CONDITIONAL(USE_SUNAUDIO, false)
AM_CONDITIONAL(USE_TAGLIB, false)
AM_CONDITIONAL(USE_VPX, false)
AM_CONDITIONAL(USE_WAVEFORM, false)
......@@ -1035,7 +1028,6 @@ sys/oss/Makefile
sys/oss4/Makefile
sys/osxaudio/Makefile
sys/osxvideo/Makefile
sys/sunaudio/Makefile
sys/v4l2/Makefile
sys/waveform/Makefile
sys/ximage/Makefile
......
......@@ -100,16 +100,10 @@ check_functions = [
['HAVE_ISINF', 'isinf', '#include<math.h>'],
# check token HAVE_LIBV4L2
['HAVE_MMAP', 'mmap', '#include<sys/mman.h>'],
# check token HAVE_OSS
# check token HAVE_OSS4
# check token HAVE_OSS_INCLUDE_IN_MACHINE
# check token HAVE_OSS_INCLUDE_IN_ROOT
# check token HAVE_OSS_INCLUDE_IN_SYS
# check token HAVE_OSX_AUDIO
# check token HAVE_OSX_VIDEO
# check token HAVE_RDTSC
['HAVE_SINH', 'sinh', '#include<math.h>'],
# check token HAVE_SUNAUDIO
# check token HAVE_WAVEFORM
]
......
......@@ -18,8 +18,6 @@ sys/oss4/oss4-source.c
sys/oss/gstosssink.c
sys/oss/gstosssrc.c
sys/osxaudio/gstosxaudioringbuffer.c
sys/sunaudio/gstsunaudiomixeroptions.c
sys/sunaudio/gstsunaudiomixertrack.c
sys/v4l2/gstv4l2bufferpool.c
sys/v4l2/gstv4l2object.c
sys/v4l2/gstv4l2radio.c
......
# if USE_DXR3
# DXR3_DIR=dxr3
# else
# DXR3_DIR=
# endif
if USE_OSS
OSS_DIR=oss
else
......@@ -16,7 +10,6 @@ else
OSS4_DIR=
endif
if USE_DIRECTSOUND
DIRECTSOUND_DIR=directsound
else
......@@ -29,12 +22,6 @@ else
WAVEFORM_DIR=
endif
if USE_SUNAUDIO
SUNAUDIO_DIR=sunaudio
else
SUNAUDIO_DIR=
endif
if USE_OSX_AUDIO
OSX_AUDIO_DIR=osxaudio
else
......@@ -47,44 +34,20 @@ else
OSX_VIDEO_DIR=
endif
# if USE_QCAM
# QCAM_DIR=qcam
# else
# QCAM_DIR=
# endif
if USE_GST_V4L2
V4L2_DIR=v4l2
else
V4L2_DIR=
endif
# if USE_VCD
# VCD_DIR=vcd
# else
# VCD_DIR=
# endif
# if USE_CDROM
# CDROM_DIR=cdrom
# else
# CDROM_DIR=
# endif
# if USE_OPENGL
# GL_DIR=glsink
# else
# GL_DIR=
# endif
if USE_X
XIMAGE_DIR=ximage
else
XIMAGE_DIR=
endif
SUBDIRS=$(DIRECTSOUND_DIR) $(WAVEFORM_DIR) $(OSS_DIR) $(OSS4_DIR) $(OSX_AUDIO_DIR) $(OSX_VIDEO_DIR) $(SUNAUDIO_DIR) $(V4L2_DIR) $(XIMAGE_DIR)
SUBDIRS=$(DIRECTSOUND_DIR) $(WAVEFORM_DIR) $(OSS_DIR) $(OSS4_DIR) $(OSX_AUDIO_DIR) $(OSX_VIDEO_DIR) $(V4L2_DIR) $(XIMAGE_DIR)
DIST_SUBDIRS=directsound oss oss4 osxaudio osxvideo sunaudio v4l2 waveform ximage
DIST_SUBDIRS=directsound oss oss4 osxaudio osxvideo v4l2 waveform ximage
include $(top_srcdir)/common/parallel-subdirs.mak
......@@ -7,5 +7,4 @@ subdir('ximage')
# FIXME: Implement these
#subdir('osxaudio')
#subdir('osxvideo')
#subdir('sunaudio')
#subdir('waveform')
plugin_LTLIBRARIES = libgstsunaudio.la
libgstsunaudio_la_SOURCES = gstsunaudio.c \
gstsunaudiosink.c \
gstsunaudiomixerctrl.c \
gstsunaudiomixer.c \
gstsunaudiomixertrack.c \
gstsunaudiomixeroptions.c \
gstsunaudiosrc.c
libgstsunaudio_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
libgstsunaudio_la_LIBADD = \
-lgstinterfaces-@GST_API_VERSION@ \
-lgstaudio-@GST_API_VERSION@ \
$(GST_PLUGINS_BASE_LIBS) \
$(GST_LIBS)
libgstsunaudio_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstsunaudiosink.h \
gstsunaudiomixer.h \
gstsunaudiomixerctrl.h \
gstsunaudiomixertrack.h \
gstsunaudiomixeroptions.h \
gstsunaudiosrc.h
/*
* GStreamer - SunAudio plugin
* Copyright (C) 2005,2006 Sun Microsystems, Inc.,
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gst/gst-i18n-plugin.h"
#include "gstsunaudiomixer.h"
#include "gstsunaudiosink.h"
#include "gstsunaudiosrc.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) ||
!gst_element_register (plugin, "sunaudiosink", GST_RANK_SECONDARY,
GST_TYPE_SUNAUDIO_SINK) ||
!gst_element_register (plugin, "sunaudiosrc", GST_RANK_SECONDARY,
GST_TYPE_SUNAUDIO_SRC)) {
return FALSE;
}
GST_DEBUG_CATEGORY_INIT (sunaudio_debug, "sunaudio", 0, "sunaudio elements");
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
#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_NAME, GST_PACKAGE_ORIGIN)
/*
* GStreamer - SunAudio mixer
* Copyright (C) 2005,2006 Sun Microsystems, Inc.,
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
/**
* SECTION:element-sunaudiomixer
*
* sunaudiomixer is an mixer that controls the sound input and output
* levels with the Sun Audio interface available in Solaris.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstsunaudiomixer.h"
GST_BOILERPLATE_WITH_INTERFACE (GstSunAudioMixer, gst_sunaudiomixer,
GstElement, GST_TYPE_ELEMENT, GstMixer, GST_TYPE_MIXER, gst_sunaudiomixer);
GST_IMPLEMENT_SUNAUDIO_MIXER_CTRL_METHODS (GstSunAudioMixer, gst_sunaudiomixer);
static GstStateChangeReturn gst_sunaudiomixer_change_state (GstElement *
element, GstStateChange transition);
static void
gst_sunaudiomixer_base_init (gpointer klass)
{
gst_element_class_set_static_metadata (GST_ELEMENT_CLASS (klass),
"Sun Audio Mixer", "Generic/Audio",
"Control sound input and output levels with Sun Audio",
"Brian Cameron <brian.cameron@sun.com>");
}
static void
gst_sunaudiomixer_class_init (GstSunAudioMixerClass * klass)
{
GstElementClass *element_class;
element_class = (GstElementClass *) klass;
element_class->change_state = gst_sunaudiomixer_change_state;
}
static void
gst_sunaudiomixer_init (GstSunAudioMixer * this,
GstSunAudioMixerClass * g_class)
{
this->mixer = NULL;
}
static GstStateChangeReturn
gst_sunaudiomixer_change_state (GstElement * element, GstStateChange transition)
{
GstSunAudioMixer *this = GST_SUNAUDIO_MIXER (element);
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
if (!this->mixer) {
const char *audiodev;
audiodev = g_getenv ("AUDIODEV");
if (audiodev == NULL) {
this->mixer = gst_sunaudiomixer_ctrl_new ("/dev/audioctl");
} else {
gchar *device = g_strdup_printf ("%sctl", audiodev);
this->mixer = gst_sunaudiomixer_ctrl_new (device);
g_free (device);
}
}
break;
case GST_STATE_CHANGE_READY_TO_NULL:
if (this->mixer) {
gst_sunaudiomixer_ctrl_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;
}
/*
* GStreamer - SunAudio mixer
* Copyright (C) 2005,2006 Sun Microsystems, Inc.,
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __GST_SUNAUDIO_MIXER_H__
#define __GST_SUNAUDIO_MIXER_H__
#include "gstsunaudiomixerctrl.h"
G_BEGIN_DECLS
#define GST_SUNAUDIO_MIXER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SUNAUDIO_MIXER,GstSunAudioMixer))
#define GST_SUNAUDIO_MIXER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SUNAUDIO_MIXER,GstSunAudioMixerClass))
#define GST_IS_SUNAUDIO_MIXER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SUNAUDIO_MIXER))
#define GST_IS_SUNAUDIO_MIXER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SUNAUDIO_MIXER))
#define GST_TYPE_SUNAUDIO_MIXER (gst_sunaudiomixer_get_type())
typedef struct _GstSunAudioMixer GstSunAudioMixer;
typedef struct _GstSunAudioMixerClass GstSunAudioMixerClass;
struct _GstSunAudioMixer {
GstElement parent;
GstSunAudioMixerCtrl *mixer;
};
struct _GstSunAudioMixerClass {
GstElementClass parent;
};
GType gst_sunaudiomixer_get_type (void);
G_END_DECLS
#endif /* __GST_SUNAUDIO_MIXER_H__ */
This diff is collapsed.
This diff is collapsed.
/*
* GStreamer SunAudio mixer track implementation
* Copyright (C) 2009 Sun Microsystems, Inc.,
* Brian Cameron <brian.cameron@sun.com>
* Garrett D'Amore <garrett.damore@sun.com>
*
* gstsunaudiomixeroptions.c: Sun Audio mixer options object
*
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, 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 <sys/audio.h>
#include <sys/mixer.h>
#include <gst/gst-i18n-plugin.h>
#include "gstsunaudiomixeroptions.h"
#include "gstsunaudiomixertrack.h"
GST_DEBUG_CATEGORY_EXTERN (sunaudio_debug);
#define GST_CAT_DEFAULT sunaudio_debug
static void gst_sunaudiomixer_options_init (GstSunAudioMixerOptions * sun_opts);
static void gst_sunaudiomixer_options_class_init (gpointer g_class,
gpointer class_data);
static GstMixerOptionsClass *parent_class = NULL;
GType
gst_sunaudiomixer_options_get_type (void)
{
static GType opts_type = 0;
if (!opts_type) {
static const GTypeInfo opts_info = {
sizeof (GstSunAudioMixerOptionsClass),
NULL,
NULL,
gst_sunaudiomixer_options_class_init,
NULL,
NULL,
sizeof (GstSunAudioMixerOptions),
0,
(GInstanceInitFunc) gst_sunaudiomixer_options_init,
};
opts_type =
g_type_register_static (GST_TYPE_MIXER_OPTIONS,
"GstSunAudioMixerOptions", &opts_info, 0);
}
return opts_type;
}
static void
gst_sunaudiomixer_options_class_init (gpointer g_class, gpointer class_data)
{
parent_class = g_type_class_peek_parent (g_class);
}
static void
gst_sunaudiomixer_options_init (GstSunAudioMixerOptions * sun_opts)
{
}
GstMixerOptions *
gst_sunaudiomixer_options_new (GstSunAudioMixerCtrl * mixer, gint track_num)
{
GstMixerOptions *opts;
GstSunAudioMixerOptions *sun_opts;
GstMixerTrack *track;
const gchar *label;
gint i;
struct audio_info audioinfo;
if ((mixer == NULL) || (mixer->mixer_fd == -1)) {
g_warning ("mixer not initialized");
return NULL;
}
if (track_num != GST_SUNAUDIO_TRACK_RECSRC) {
g_warning ("invalid options track");
return (NULL);
}
label = N_("Record Source");
opts = g_object_new (GST_TYPE_SUNAUDIO_MIXER_OPTIONS,
"untranslated-label", label, NULL);
sun_opts = GST_SUNAUDIO_MIXER_OPTIONS (opts);
track = GST_MIXER_TRACK (opts);
GST_DEBUG_OBJECT (opts, "New mixer options, track %d: %s",
track_num, GST_STR_NULL (label));
/* save off names for the record sources */
sun_opts->names[0] = g_quark_from_string (_("Microphone"));
sun_opts->names[1] = g_quark_from_string (_("Line In"));
sun_opts->names[2] = g_quark_from_string (_("Internal CD"));
sun_opts->names[3] = g_quark_from_string (_("SPDIF In"));
sun_opts->names[4] = g_quark_from_string (_("AUX 1 In"));
sun_opts->names[5] = g_quark_from_string (_("AUX 2 In"));
sun_opts->names[6] = g_quark_from_string (_("Codec Loopback"));
sun_opts->names[7] = g_quark_from_string (_("SunVTS Loopback"));
/* set basic information */
track->label = g_strdup (_(label));
track->num_channels = 0;
track->min_volume = 0;
track->max_volume = 0;
track->flags =
GST_MIXER_TRACK_INPUT | GST_MIXER_TRACK_WHITELIST |
GST_MIXER_TRACK_NO_RECORD;
if (ioctl (mixer->mixer_fd, AUDIO_GETINFO, &audioinfo) < 0) {
g_warning ("Error getting audio device settings");
g_object_unref (G_OBJECT (sun_opts));
return NULL;
}
sun_opts->avail = audioinfo.record.avail_ports;
sun_opts->track_num = track_num;
for (i = 0; i < 8; i++) {
if ((1 << i) & audioinfo.record.avail_ports) {
const char *s = g_quark_to_string (sun_opts->names[i]);
opts->values = g_list_append (opts->values, g_strdup (s));
GST_DEBUG_OBJECT (opts, "option for track %d: %s",
track_num, GST_STR_NULL (s));
}
}
return opts;
}
/*
* GStreamer SunAudio mixer track implementation
* Copyright (C) 2009 Sun Microsystems, Inc.,
* Brian Cameron <brian.cameron@sun.com>
* Garrett D'Amore <garrett.damore@sun.com>
*
* gstsunaudiomixeroptions.h: Sun Audio mixer options object
*
* 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., 51 Franklin St, Fifth Floor,
*/
#ifndef __GST_SUNAUDIO_MIXER_OPTIONS_H__
#define __GST_SUNAUDIO_MIXER_OPTIONS_H__
#include "gstsunaudiomixer.h"
#include <gst/interfaces/mixeroptions.h>
G_BEGIN_DECLS
#define GST_SUNAUDIO_MIXER_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_SUNAUDIO_MIXER_OPTIONS, GstSunAudioMixerOptions))
#define GST_SUNAUDIO_MIXER_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_SUNAUDIO_MIXER_OPTIONS, GstSunAudioMixerOptionsClass))
#define GST_IS_SUNAUDIO_MIXER_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_SUNAUDIO_MIXER_OPTIONS))
#define GST_IS_SUNAUDIO_MIXER_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_SUNAUDIO_MIXER_OPTIONS))
#define GST_TYPE_SUNAUDIO_MIXER_OPTIONS (gst_sunaudiomixer_options_get_type())
typedef struct _GstSunAudioMixerOptions GstSunAudioMixerOptions;
typedef struct _GstSunAudioMixerOptionsClass GstSunAudioMixerOptionsClass;
struct _GstSunAudioMixerOptions {
GstMixerOptions parent;
gint track_num;
GQuark names[8]; /* only 8 possible */
gint avail; /* mask of avail */
};
struct _GstSunAudioMixerOptionsClass {
GstMixerOptionsClass parent;
};
GType gst_sunaudiomixer_options_get_type (void);
GstMixerOptions *gst_sunaudiomixer_options_new (GstSunAudioMixerCtrl *mixer, gint track_num);
G_END_DECLS
#endif /* __GST_SUNAUDIO_MIXER_OPTIONS_H__ */
/*
* GStreamer
* Copyright (C) 2005,2008, 2009 Sun Microsystems, Inc.,
* Brian Cameron <brian.cameron@sun.com>
* Copyright (C) 2009 Sun Microsystems, Inc.,
* Garrett D'Amore <garrett.damore@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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, 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 <sys/audioio.h>
#include <gst/gst-i18n-plugin.h>
#include "gstsunaudiomixertrack.h"
GST_DEBUG_CATEGORY_EXTERN (sunaudio_debug);
#define GST_CAT_DEFAULT sunaudio_debug
#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->gain = 0;
track->balance = AUDIO_MID_BALANCE;
track->track_num = 0;
}
GstMixerTrack *
gst_sunaudiomixer_track_new (GstSunAudioTrackType track_num)
{
const gchar *labels[] = { N_("Volume"),
N_("Gain"),
N_("Monitor"),
N_("Built-in Speaker"),
N_("Headphone"),
N_("Line Out"),
N_("SPDIF Out"),
N_("AUX 1 Out"),
N_("AUX 2 Out"),
};
GstSunAudioMixerTrack *sunaudiotrack;
GstMixerTrack *track;
const gchar *untranslated_label;
if ((guint) track_num < G_N_ELEMENTS (labels))
untranslated_label = labels[track_num];
else
untranslated_label = NULL;
sunaudiotrack = g_object_new (GST_TYPE_SUNAUDIO_MIXER_TRACK,
"untranslated-label", untranslated_label, NULL);
GST_DEBUG_OBJECT (sunaudiotrack, "Creating new mixer track of type %d: %s",
track_num, GST_STR_NULL (untranslated_label));
switch (track_num) {
case GST_SUNAUDIO_TRACK_OUTPUT:
/* these are sliders */
track = GST_MIXER_TRACK (sunaudiotrack);
track->label = g_strdup (_(untranslated_label));
track->num_channels = 2;
track->flags = GST_MIXER_TRACK_OUTPUT | GST_MIXER_TRACK_WHITELIST |
GST_MIXER_TRACK_MASTER;
track->min_volume = 0;
track->max_volume = 255;
sunaudiotrack->track_num = track_num;
sunaudiotrack->gain = (0 & 0xff);
sunaudiotrack->balance = AUDIO_MID_BALANCE;
break;
case GST_SUNAUDIO_TRACK_RECORD:
/* these are sliders */
track = GST_MIXER_TRACK (sunaudiotrack);
track->label = g_strdup (_(untranslated_label));
track->num_channels = 2;
track->flags = GST_MIXER_TRACK_INPUT | GST_MIXER_TRACK_NO_RECORD |
GST_MIXER_TRACK_WHITELIST;
track->min_volume = 0;
track->max_volume = 255;
sunaudiotrack->track_num = track_num;
sunaudiotrack->gain = (0 & 0xff);
sunaudiotrack->balance = AUDIO_MID_BALANCE;
break;
case GST_SUNAUDIO_TRACK_MONITOR:
/* these are sliders */
track = GST_MIXER_TRACK (sunaudiotrack);
track->label = g_strdup (_(untranslated_label));
track->num_channels = 2;
track-></