Commit f3b328da authored by Leif Johnson's avatar Leif Johnson
Browse files

splitting ALSA code into separate source files

Original commit message from CVS:
splitting ALSA code into separate source files
parent cf2a8745
plugin_LTLIBRARIES = libgstalsa.la
libgstalsa_la_SOURCES = gstalsa.c
libgstalsa_la_SOURCES = gstalsaplugin.c \
gstalsa.c gstalsaclock.c gstalsasink.c gstalsasrc.c
libgstalsa_la_CFLAGS = $(GST_CFLAGS) $(ALSA_CFLAGS)
libgstalsa_la_LIBADD = $(ALSA_LIBS)
libgstalsa_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
noinst_HEADERS = gstalsa.h
noinst_HEADERS = \
gstalsa.h gstalsaclock.h gstalsasink.h gstalsasrc.h
EXTRA_DIST = README
......@@ -6,9 +6,13 @@ pipeline ! \fBalsasink\fR
\fBalsasrc\fR ! pipeline
.SH "DESCRIPTION"
.LP
\fIgstalsa\fP is a plugin to be used with the \fIGStreamer\fP media framework. It consists of elements which can either be used to recieve sound (\fBalsasrc\fR) aquired through alsa or probably the most common use; to output sound generated by a GStreamer pipeline to the ALSA sound architecture(\fBalsasink\fR).
.LP
\fIgstalsa\fP is a plugin to be used with the \fIGStreamer\fP media framework.
The plugin contains several elements that can be used in to interface with an
ALSA sound device. \fIgstalsa\fP contains an element to recieve sound
(\fBalsasrc\fR) aquired through ALSA. Probably the most common use, however, is
to output sound generated by a GStreamer pipeline to an ALSA device
(\fBalsasink\fR).
.SH "SEE ALSO"
.BR gstoss (1),
......
This diff is collapsed.
......@@ -28,53 +28,67 @@
#include <alsa/asoundlib.h>
#include <gst/gst.h>
#define GST_ALSA_MAX_CHANNELS 64 /* we don't support more than 64 channels */
#define GST_ALSA_MIN_RATE 8000
#define GST_ALSA_MAX_RATE 192000
/* max allowed discontinuity in time units between timestamp and playback pointer
before killing/inserting samples
should be big enough to allow smoothing errors on different video formats */
#define GST_ALSA_DEFAULT_DISCONT (GST_SECOND / 10)
#define GST_ALSA(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_ALSA, GstAlsa))
#define GST_ALSA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_ALSA, GstAlsaClass))
#define GST_ALSA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ALSA, GstAlsaClass))
#define GST_IS_ALSA(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_ALSA))
#define GST_IS_ALSA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_ALSA))
#define GST_TYPE_ALSA (gst_alsa_get_type())
GST_DEBUG_CATEGORY_STATIC (alsa_debug);
#define GST_CAT_DEFAULT alsa_debug
#define GST_ALSA_SINK(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_ALSA_SINK, GstAlsaSink))
#define GST_ALSA_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_ALSA_SINK, GstAlsaSinkClass))
#define GST_IS_ALSA_SINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_ALSA_SINK))
#define GST_IS_ALSA_SINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_ALSA_SINK))
#define GST_TYPE_ALSA_SINK (gst_alsa_sink_get_type())
#define GST_ALSA_SRC(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_ALSA_SRC, GstAlsaSrc))
#define GST_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_ALSA_SRC, GstAlsaSrcClass))
#define GST_IS_ALSA_SRC(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_ALSA_SRC))
#define GST_IS_ALSA_SRC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_ALSA_SRC))
#define GST_TYPE_ALSA_SRC (gst_alsa_src_get_type())
/* error checking for standard alsa functions */
#define SIMPLE_ERROR_CHECK(value) G_STMT_START{ \
int err = (value); if (err < 0) { return FALSE; } \
}G_STMT_END
#define GST_ALSA_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALSA_CLOCK,GstAlsaClock))
#define GST_ALSA_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALSA_CLOCK,GstAlsaClockClass))
#define GST_IS_ALSA_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALSA_CLOCK))
#define GST_IS_ALSA_CLOCK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_CLOCK))
#define GST_TYPE_ALSA_CLOCK (gst_alsa_clock_get_type())
/* I would have preferred to avoid this variety of trickery, but without it i
* can't tell whether I'm a source or a sink upon creation. */
#ifdef G_HAVE_ISO_VARARGS
#define ERROR_CHECK(value, ...) G_STMT_START{ \
int err = (value); \
if (err < 0) { \
g_warning ( __VA_ARGS__, snd_strerror (err)); \
return FALSE; \
} \
}G_STMT_END
typedef struct _GstAlsa GstAlsa;
typedef struct _GstAlsaClass GstAlsaClass;
typedef struct _GstAlsaSink GstAlsaSink;
typedef struct _GstAlsaSinkClass GstAlsaSinkClass;
typedef struct _GstAlsaSrc GstAlsaSrc;
typedef struct _GstAlsaSrcClass GstAlsaSrcClass;
#elif defined(G_HAVE_GNUC_VARARGS)
#define ERROR_CHECK(value, args...) G_STMT_START{ \
int err = (value); \
if (err < 0) { \
g_warning ( ## args, snd_strerror (err)); \
return FALSE; \
} \
}G_STMT_END
#else
#define ERROR_CHECK(value, args...) G_STMT_START{ \
int err = (value); \
if (err < 0) { \
g_warning (snd_strerror (err)); \
return FALSE; \
} \
}G_STMT_END
#endif
#define GST_ALSA_MIN_RATE 8000
#define GST_ALSA_MAX_RATE 192000
#define GST_ALSA_MAX_TRACKS 64 /* we don't support more than 64 tracks */
#define GST_ALSA_MAX_CHANNELS 32 /* tracks can have up to 32 channels */
typedef struct _GstAlsaClock GstAlsaClock;
typedef struct _GstAlsaClockClass GstAlsaClockClass;
/* Mono is 1 channel ; the 5.1 standard is 6 channels. The value for
GST_ALSA_MAX_CHANNELS comes from alsa/mixer.h. */
typedef GstClockTime (*GstAlsaClockGetTimeFunc) (GstAlsa *owner);
/* Max allowed discontinuity in time units between timestamp and playback
pointer before killing/inserting samples. This should be big enough to allow
smoothing errors on different video formats. */
#define GST_ALSA_DEFAULT_DISCONT (GST_SECOND / 10)
G_BEGIN_DECLS
#define GST_ALSA(obj) (G_TYPE_CHECK_INSTANCE_CAST(obj, GST_TYPE_ALSA, GstAlsa))
#define GST_ALSA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST(klass, GST_TYPE_ALSA, GstAlsaClass))
#define GST_ALSA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_ALSA, GstAlsaClass))
#define GST_IS_ALSA(obj) (G_TYPE_CHECK_INSTANCE_TYPE(obj, GST_TYPE_ALSA))
#define GST_IS_ALSA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE(klass, GST_TYPE_ALSA))
#define GST_TYPE_ALSA (gst_alsa_get_type())
enum {
GST_ALSA_OPEN = GST_ELEMENT_FLAG_LAST,
......@@ -82,34 +96,36 @@ enum {
GST_ALSA_CAPS_NEGO,
GST_ALSA_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 3,
};
typedef enum {
GST_ALSA_CAPS_PAUSE = 0,
GST_ALSA_CAPS_RESUME,
GST_ALSA_CAPS_SYNC_START
/* add more */
} GstAlsaPcmCaps;
#define GST_ALSA_CAPS_IS_SET(obj, flag) (GST_ALSA (obj)->pcm_caps & (1<<(flag)))
#define GST_ALSA_CAPS_SET(obj, flag, set) G_STMT_START{ \
if (set) { \
(GST_ALSA (obj)->pcm_caps |= (1<<(flag))); \
} else { \
(GST_ALSA (obj)->pcm_caps &= ~(1<<(flag))); \
} \
#define GST_ALSA_CAPS_IS_SET(obj, flag) (GST_ALSA (obj)->pcm_caps & (1<<(flag)))
#define GST_ALSA_CAPS_SET(obj, flag, set) G_STMT_START{ \
if (set) { (GST_ALSA (obj)->pcm_caps |= (1<<(flag))); } \
else { (GST_ALSA (obj)->pcm_caps &= ~(1<<(flag))); } \
}G_STMT_END
typedef struct _GstAlsa GstAlsa;
typedef struct _GstAlsaClass GstAlsaClass;
typedef int (*GstAlsaTransmitFunction) (GstAlsa *this, snd_pcm_sframes_t *avail);
typedef struct {
snd_pcm_format_t format;
guint rate;
gint channels;
gint channels;
} GstAlsaFormat;
struct _GstAlsa {
GstElement parent;
/* array of GstAlsaPads */
GstPad * pad[GST_ALSA_MAX_CHANNELS];
GstPad * pad[GST_ALSA_MAX_TRACKS];
gchar * device;
snd_pcm_t * handle;
......@@ -127,7 +143,7 @@ struct _GstAlsa {
gboolean autorecover;
/* clocking */
GstAlsaClock * clock; /* our provided clock */
GstSystemClock * clock; /* our provided clock */
snd_pcm_uframes_t transmitted; /* samples transmitted since last sync
This thing actually is our master clock.
We will event insert silent samples or
......@@ -136,7 +152,11 @@ struct _GstAlsa {
GstClockTime max_discont; /* max difference between current
playback timestamp and buffers timestamps
*/
/* mixer */
GList *tracklist; /* list of available tracks */
snd_mixer_t * mixer_handle;
};
struct _GstAlsaClass {
GstElementClass parent_class;
......@@ -146,48 +166,38 @@ struct _GstAlsaClass {
GstAlsaTransmitFunction transmit_mmap;
GstAlsaTransmitFunction transmit_rw;
};
struct _GstAlsaSink {
GstAlsa parent;
/* array of the data on the channels */
guint8 * data[GST_ALSA_MAX_CHANNELS]; /* pointer into buffer */
guint size[GST_ALSA_MAX_CHANNELS]; /* sink: bytes left in buffer */
GstBuffer * buf[GST_ALSA_MAX_CHANNELS]; /* current buffer */
guint behaviour[GST_ALSA_MAX_CHANNELS]; /* 0 = data points into buffer (so unref when size == 0),
1 = data should be freed, use buffer after that */
};
struct _GstAlsaSinkClass {
GstAlsaClass parent_class;
};
struct _GstAlsaSrc {
GstAlsa parent;
GstBuffer * buf[GST_ALSA_MAX_CHANNELS];
GstBufferPool * pool;
};
struct _GstAlsaSrcClass {
GstAlsaClass parent_class;
};
struct _GstAlsaClock {
GstSystemClock parent;
GstAlsaClockGetTimeFunc get_time;
GstAlsa * owner;
GstClockTimeDiff adjust; /* adjustment to real clock (recalculated when stopping) */
GstClockTime start_time; /* time when the stream started (NONE when stopped) */
GstClockTime last_unlock; /* time of last unlock request */
};
struct _GstAlsaClockClass {
GstSystemClockClass parent_class;
};
GType gst_alsa_get_type (void);
GType gst_alsa_sink_get_type (void);
GType gst_alsa_src_get_type (void);
GType gst_alsa_clock_get_type (void);
#endif /* __ALSA_H__ */
GType gst_alsa_get_type (void);
void gst_alsa_set_eos (GstAlsa * this);
GstPadLinkReturn gst_alsa_link (GstPad * pad,
GstCaps * caps);
GstCaps * gst_alsa_get_caps (GstPad * pad,
GstCaps *caps);
GstCaps * gst_alsa_caps (snd_pcm_format_t format,
gint rate,
gint channels);
/* audio processing functions */
inline snd_pcm_sframes_t gst_alsa_update_avail (GstAlsa * this);
inline gboolean gst_alsa_pcm_wait (GstAlsa * this);
inline gboolean gst_alsa_start (GstAlsa * this);
void gst_alsa_xrun_recovery (GstAlsa * this);
/* format conversions */
inline snd_pcm_uframes_t gst_alsa_timestamp_to_samples (GstAlsa * this,
GstClockTime time);
inline GstClockTime gst_alsa_samples_to_timestamp (GstAlsa * this,
snd_pcm_uframes_t samples);
inline snd_pcm_uframes_t gst_alsa_bytes_to_samples (GstAlsa * this,
guint bytes);
inline guint gst_alsa_samples_to_bytes (GstAlsa * this,
snd_pcm_uframes_t samples);
inline GstClockTime gst_alsa_bytes_to_timestamp (GstAlsa * this,
guint bytes);
inline guint gst_alsa_timestamp_to_bytes (GstAlsa * this,
GstClockTime time);
G_END_DECLS
#endif /* __GST_ALSA_H__ */
/*
* Copyright (C) 2001 CodeFactory AB
* Copyright (C) 2001 Thomas Nyberg <thomas@codefactory.se>
* Copyright (C) 2001-2002 Andy Wingo <apwingo@eos.ncsu.edu>
* Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstalsaclock.h"
/* clock functions */
static void gst_alsa_clock_class_init (gpointer g_class,
gpointer class_data);
static void gst_alsa_clock_init (GstAlsaClock * clock);
static GstClockTime gst_alsa_clock_get_internal_time (GstClock * clock);
static guint64 gst_alsa_clock_get_resolution (GstClock * clock);
static GstClockEntryStatus gst_alsa_clock_wait (GstClock * clock,
GstClockEntry * entry);
static void gst_alsa_clock_unlock (GstClock * clock,
GstClockEntry * entry);
static GstClockClass * clock_parent_class = NULL;
/* static guint gst_alsa_clock_signals[LAST_SIGNAL] = { 0 }; */
GType
gst_alsa_clock_get_type (void)
{
static GType clock_type = 0;
if (!clock_type) {
static const GTypeInfo clock_info = {
sizeof (GstAlsaClockClass),
NULL,
NULL,
gst_alsa_clock_class_init,
NULL,
NULL,
sizeof (GstAlsaClock),
4,
(GInstanceInitFunc) gst_alsa_clock_init,
NULL
};
clock_type = g_type_register_static (GST_TYPE_CLOCK, "GstAlsaClock",
&clock_info, 0);
}
return clock_type;
}
static void
gst_alsa_clock_class_init (gpointer g_class, gpointer class_data)
{
GObjectClass *gobject_class;
GstObjectClass *gstobject_class;
GstClockClass *gstclock_class;
GstAlsaClockClass *klass;
klass = (GstAlsaClockClass *) g_class;
gobject_class = (GObjectClass*) klass;
gstobject_class = (GstObjectClass*) klass;
gstclock_class = (GstClockClass*) klass;
clock_parent_class = g_type_class_ref (GST_TYPE_CLOCK);
gstclock_class->get_internal_time = gst_alsa_clock_get_internal_time;
gstclock_class->get_resolution = gst_alsa_clock_get_resolution;
gstclock_class->wait = gst_alsa_clock_wait;
gstclock_class->unlock = gst_alsa_clock_unlock;
}
static void
gst_alsa_clock_init (GstAlsaClock *clock)
{
gst_object_set_name (GST_OBJECT (clock), "GstAlsaClock");
clock->start_time = GST_CLOCK_TIME_NONE;
}
GstAlsaClock*
gst_alsa_clock_new (gchar *name, GstAlsaClockGetTimeFunc get_time, GstAlsa *owner)
{
GstAlsaClock *alsa_clock = GST_ALSA_CLOCK (g_object_new (GST_TYPE_ALSA_CLOCK, NULL));
g_assert (alsa_clock);
alsa_clock->get_time = get_time;
alsa_clock->owner = owner;
alsa_clock->adjust = 0;
gst_object_set_name (GST_OBJECT (alsa_clock), name);
gst_object_set_parent (GST_OBJECT (alsa_clock), GST_OBJECT (owner));
return alsa_clock;
}
void
gst_alsa_clock_start (GstAlsaClock *clock)
{
GTimeVal timeval;
g_get_current_time (&timeval);
g_assert (!GST_CLOCK_TIME_IS_VALID (clock->start_time));
if (clock->owner->format) {
clock->start_time = GST_TIMEVAL_TO_TIME (timeval) + clock->adjust - clock->get_time (clock->owner);
} else {
clock->start_time = GST_TIMEVAL_TO_TIME (timeval) + clock->adjust;
}
}
void
gst_alsa_clock_stop (GstAlsaClock *clock)
{
GTimeVal timeval;
g_get_current_time (&timeval);
g_assert (GST_CLOCK_TIME_IS_VALID (clock->start_time));
clock->adjust += GST_TIMEVAL_TO_TIME (timeval) - clock->start_time - clock->get_time (clock->owner);
clock->start_time = GST_CLOCK_TIME_NONE;
}
static GstClockTime
gst_alsa_clock_get_internal_time (GstClock *clock)
{
GstAlsaClock *alsa_clock = GST_ALSA_CLOCK (clock);
if (GST_CLOCK_TIME_IS_VALID (alsa_clock->start_time)) {
return alsa_clock->get_time (alsa_clock->owner) + alsa_clock->start_time;
} else {
GTimeVal timeval;
g_get_current_time (&timeval);
return GST_TIMEVAL_TO_TIME (timeval) + alsa_clock->adjust;
}
}
static guint64
gst_alsa_clock_get_resolution (GstClock *clock)
{
GstAlsaClock *this = GST_ALSA_CLOCK (clock);
if (this->owner->format) {
return GST_SECOND / this->owner->format->rate;
} else {
/* FIXME: is there an "unknown" value? We just return the sysclock's time by default */
return 1 * GST_USECOND;
}
}
static GstClockEntryStatus
gst_alsa_clock_wait (GstClock *clock, GstClockEntry *entry)
{
GstClockTime target, entry_time;
GstClockTimeDiff diff;
GstAlsaClock *this = GST_ALSA_CLOCK (clock);
entry_time = gst_alsa_clock_get_internal_time (clock);
diff = GST_CLOCK_ENTRY_TIME (entry) - gst_clock_get_time (clock);
if (diff < 0)
return GST_CLOCK_ENTRY_EARLY;
if (diff > clock->max_diff) {
GST_INFO_OBJECT (this, "GstAlsaClock: abnormal clock request diff: %" G_GINT64_FORMAT") >"
" %"G_GINT64_FORMAT, diff, clock->max_diff);
return GST_CLOCK_ENTRY_EARLY;
}
target = entry_time + diff;
GST_DEBUG_OBJECT (this, "real_target %" G_GUINT64_FORMAT
" target %" G_GUINT64_FORMAT
" now %" G_GUINT64_FORMAT,
target, GST_CLOCK_ENTRY_TIME (entry), entry_time);
while (gst_alsa_clock_get_internal_time (clock) < target &&
this->last_unlock < entry_time) {
g_usleep (gst_alsa_clock_get_resolution (clock) * G_USEC_PER_SEC / GST_SECOND);
}
return entry->status;
}
static void
gst_alsa_clock_unlock (GstClock *clock, GstClockEntry *entry)
{
GstAlsaClock *this = GST_ALSA_CLOCK (clock);
this->last_unlock = this->get_time (this->owner);
}
/*
* Copyright (C) 2001 CodeFactory AB
* Copyright (C) 2001 Thomas Nyberg <thomas@codefactory.se>
* Copyright (C) 2001-2002 Andy Wingo <apwingo@eos.ncsu.edu>
* Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
*
* 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_ALSA_CLOCK_H__
#define __GST_ALSA_CLOCK_H__
#include "gstalsa.h"
G_BEGIN_DECLS
#define GST_ALSA_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_ALSA_CLOCK,GstAlsaClock))
#define GST_ALSA_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_ALSA_CLOCK,GstAlsaClockClass))
#define GST_IS_ALSA_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_ALSA_CLOCK))
#define GST_IS_ALSA_CLOCK_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_ALSA_CLOCK))
#define GST_TYPE_ALSA_CLOCK (gst_alsa_clock_get_type())
typedef struct _GstAlsaClock GstAlsaClock;
typedef struct _GstAlsaClockClass GstAlsaClockClass;
typedef GstClockTime (*GstAlsaClockGetTimeFunc) (GstAlsa *);
struct _GstAlsaClock {
GstSystemClock parent;
GstAlsaClockGetTimeFunc get_time;
GstAlsa * owner;
GstClockTimeDiff adjust; /* adjustment to real clock (recalculated when stopping) */
GstClockTime start_time; /* time when the stream started (NONE when stopped) */
GstClockTime last_unlock; /* time of last unlock request */
};
struct _GstAlsaClockClass {
GstSystemClockClass parent_class;
};
GType gst_alsa_clock_get_type (void);
GstAlsaClock * gst_alsa_clock_new (gchar * name,
GstAlsaClockGetTimeFunc func,
GstAlsa * owner);
void gst_alsa_clock_start (GstAlsaClock * clock);
void gst_alsa_clock_stop (GstAlsaClock * clock);
G_END_DECLS
#endif /* __GST_ALSA_CLOCK_H__ */
/*
* Copyright (C) 2001 CodeFactory AB
* Copyright (C) 2001 Thomas Nyberg <thomas@codefactory.se>
* Copyright (C) 2001-2002 Andy Wingo <apwingo@eos.ncsu.edu>
* Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
*
* 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.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "gstalsa.h"
#include "gstalsasink.h"
#include "gstalsasrc.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
GST_DEBUG_CATEGORY_INIT (alsa_debug, "alsa", 0, "alsa plugins");
if (!gst_element_register (plugin, "alsasrc", GST_RANK_NONE, GST_TYPE_ALSA_SRC))
return FALSE;
if (!gst_element_register (plugin, "alsasink", GST_RANK_NONE, GST_TYPE_ALSA_SINK))
return FALSE;
return TRUE;
}
GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"alsa",
"ALSA plugin library",
plugin_init,
VERSION,
"LGPL",
GST_COPYRIGHT,
GST_PACKAGE,
GST_ORIGIN
)
/*
* Copyright (C) 2001 CodeFactory AB
* Copyright (C) 2001 Thomas Nyberg <thomas@codefactory.se>
* Copyright (C) 2001-2002 Andy Wingo <apwingo@eos.ncsu.edu>
* Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
*
* 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.
*/