summaryrefslogtreecommitdiffstats
path: root/ext/esd
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2006-07-24 14:37:36 +0000
committerTim-Philipp Müller <tim@centricular.net>2006-07-24 14:37:36 +0000
commit458fdc84286b0740aefc6a42aa7301a15149d558 (patch)
tree72945ff110edfd28bde4f05d92b1e01ce4aafcfa /ext/esd
parent4304e0f4388e94e0bc26a71d995afbdc276f064c (diff)
ext/esd/README: Remove, it contains nothing useful anyway.
Original commit message from CVS: * ext/esd/README: Remove, it contains nothing useful anyway. * ext/esd/esdsink.c: (gst_esdsink_init), (gst_esdsink_prepare), (gst_esdsink_delay): Some small clean-ups; use GST_BOILERPLATE etc.
Diffstat (limited to 'ext/esd')
-rw-r--r--ext/esd/README12
-rw-r--r--ext/esd/esdsink.c39
2 files changed, 7 insertions, 44 deletions
diff --git a/ext/esd/README b/ext/esd/README
deleted file mode 100644
index d5ebcf0e..00000000
--- a/ext/esd/README
+++ /dev/null
@@ -1,12 +0,0 @@
-The esdsink plugin
-==================
-
-The esdsink plugin is for outputting an audio stream to an esd soundserver, whether local or on a remote machine
-
-esdsink has 2 arguments that it accepts:
- - 'mute' (boolean value)
- - 'depth' (sample depth in bits- defaults to 16)
- - 'host' (used only if you want to connect to a remote esd soundserver)
- - 'frequency' (integer value in Hz)
- - 'channels' (number of channels - 2 for stereo)
-
diff --git a/ext/esd/esdsink.c b/ext/esd/esdsink.c
index ae51ea77..de82d34f 100644
--- a/ext/esd/esdsink.c
+++ b/ext/esd/esdsink.c
@@ -58,7 +58,7 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/x-raw-int, "
- "endianness = (int) " G_STRINGIFY (G_BYTE_ORDER) ", "
+ "endianness = (int) BYTE_ORDER, "
"signed = (boolean) TRUE, "
"width = (int) 16, "
"depth = (int) 16, "
@@ -71,9 +71,6 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 2 ]")
);
-static void gst_esdsink_base_init (gpointer g_class);
-static void gst_esdsink_class_init (GstEsdSinkClass * klass);
-static void gst_esdsink_init (GstEsdSink * esdsink);
static void gst_esdsink_finalize (GObject * object);
static GstCaps *gst_esdsink_getcaps (GstBaseSink * bsink);
@@ -93,32 +90,7 @@ static void gst_esdsink_set_property (GObject * object, guint prop_id,
static void gst_esdsink_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
-static GstElementClass *parent_class = NULL;
-
-GType
-gst_esdsink_get_type (void)
-{
- static GType esdsink_type = 0;
-
- if (!esdsink_type) {
- static const GTypeInfo esdsink_info = {
- sizeof (GstEsdSinkClass),
- gst_esdsink_base_init,
- NULL,
- (GClassInitFunc) gst_esdsink_class_init,
- NULL,
- NULL,
- sizeof (GstEsdSink),
- 0,
- (GInstanceInitFunc) gst_esdsink_init,
- };
-
- esdsink_type =
- g_type_register_static (GST_TYPE_AUDIO_SINK, "GstEsdSink",
- &esdsink_info, 0);
- }
- return esdsink_type;
-}
+GST_BOILERPLATE (GstEsdSink, gst_esdsink, GstAudioSink, GST_TYPE_AUDIO_SINK);
static void
gst_esdsink_base_init (gpointer g_class)
@@ -167,7 +139,7 @@ gst_esdsink_class_init (GstEsdSinkClass * klass)
}
static void
-gst_esdsink_init (GstEsdSink * esdsink)
+gst_esdsink_init (GstEsdSink * esdsink, GstEsdSinkClass * klass)
{
esdsink->fd = -1;
esdsink->ctrl_fd = -1;
@@ -322,6 +294,9 @@ gst_esdsink_prepare (GstAudioSink * asink, GstRingBufferSpec * spec)
spec->segsize = ESD_BUF_SIZE;
spec->segtotal = (ESD_MAX_WRITE_SIZE / spec->segsize);
+
+ /* FIXME: this is wrong for signed ints (and the
+ * audioringbuffers should do it for us anyway) */
spec->silence_sample[0] = 0;
spec->silence_sample[1] = 0;
spec->silence_sample[2] = 0;
@@ -411,7 +386,7 @@ gst_esdsink_delay (GstAudioSink * asink)
/* latency is measured in samples at a rate of 44100, this
* cannot overflow. */
- latency = latency * 44100LL / esdsink->rate;
+ latency = latency * G_GINT64_CONSTANT (44100) / esdsink->rate;
GST_DEBUG_OBJECT (asink, "got latency: %u", latency);