summaryrefslogtreecommitdiffstats
path: root/gst/auparse
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2002-02-17 02:06:04 +0000
committerAndy Wingo <wingo@pobox.com>2002-02-17 02:06:04 +0000
commit6f2a22eb93ce68abf25a6c5845d6ac5322a09557 (patch)
tree134f8f1d01786d668dd17be3b60358a7428e6b94 /gst/auparse
parentf194a20c0ba29568abbe1bfc53780e612de46338 (diff)
better capsnego in osssink s/parseau/auparse/ update volume, mulawdecode, auparse to new capsnego
Original commit message from CVS: * better capsnego in osssink * s/parseau/auparse/ * update volume, mulawdecode, auparse to new capsnego
Diffstat (limited to 'gst/auparse')
-rw-r--r--gst/auparse/Makefile.am12
-rw-r--r--gst/auparse/gstauparse.c (renamed from gst/auparse/gstparseau.c)132
-rw-r--r--gst/auparse/gstauparse.h (renamed from gst/auparse/gstparseau.h)36
3 files changed, 90 insertions, 90 deletions
diff --git a/gst/auparse/Makefile.am b/gst/auparse/Makefile.am
index 0ea4918a..b6e0c2a6 100644
--- a/gst/auparse/Makefile.am
+++ b/gst/auparse/Makefile.am
@@ -1,10 +1,10 @@
plugindir = $(libdir)/gst
-plugin_LTLIBRARIES = libgstparseau.la
+plugin_LTLIBRARIES = libgstauparse.la
-libgstparseau_la_SOURCES = gstparseau.c
-libgstparseau_la_CFLAGS = $(GST_CFLAGS)
-libgstparseau_la_LIBADD = $(GST_LIBS)
-libgstparseau_la_LDFLAGS = @GST_PLUGIN_LDFLAGS@
+libgstauparse_la_SOURCES = gstauparse.c
+libgstauparse_la_CFLAGS = $(GST_CFLAGS)
+libgstauparse_la_LIBADD = $(GST_LIBS)
+libgstauparse_la_LDFLAGS = @GST_PLUGIN_LDFLAGS@
-noinst_HEADERS = gstparseau.h
+noinst_HEADERS = gstauparse.h
diff --git a/gst/auparse/gstparseau.c b/gst/auparse/gstauparse.c
index 92466582..9c1c6c7d 100644
--- a/gst/auparse/gstparseau.c
+++ b/gst/auparse/gstauparse.c
@@ -24,11 +24,11 @@
#include <stdlib.h>
#include <string.h>
-#include <gstparseau.h>
+#include <gstauparse.h>
/* elementfactory information */
-static GstElementDetails gst_parseau_details = {
+static GstElementDetails gst_auparse_details = {
".au parser",
"Parser/Audio",
"Parse an .au file into raw audio",
@@ -51,7 +51,7 @@ au_typefind (GstBuffer *buf, gpointer private)
/* typefactory for 'au' */
static GstTypeDefinition audefinition = {
- "parseau_audio/au",
+ "auparse_audio/au",
"audio/au",
".au",
au_typefind,
@@ -96,7 +96,7 @@ GST_PADTEMPLATE_FACTORY (src_factory_templ,
)
)
-/* ParseAu signals and args */
+/* AuParse signals and args */
enum {
/* FILL ME */
LAST_SIGNAL
@@ -107,37 +107,37 @@ enum {
/* FILL ME */
};
-static void gst_parseau_class_init (GstParseAuClass *klass);
-static void gst_parseau_init (GstParseAu *parseau);
+static void gst_auparse_class_init (GstAuParseClass *klass);
+static void gst_auparse_init (GstAuParse *auparse);
-static void gst_parseau_chain (GstPad *pad,GstBuffer *buf);
+static void gst_auparse_chain (GstPad *pad,GstBuffer *buf);
static GstElementClass *parent_class = NULL;
-//static guint gst_parseau_signals[LAST_SIGNAL] = { 0 };
+//static guint gst_auparse_signals[LAST_SIGNAL] = { 0 };
GType
-gst_parseau_get_type (void)
+gst_auparse_get_type (void)
{
- static GType parseau_type = 0;
+ static GType auparse_type = 0;
- if (!parseau_type) {
- static const GTypeInfo parseau_info = {
- sizeof(GstParseAuClass), NULL,
+ if (!auparse_type) {
+ static const GTypeInfo auparse_info = {
+ sizeof(GstAuParseClass), NULL,
NULL,
- (GClassInitFunc) gst_parseau_class_init,
+ (GClassInitFunc) gst_auparse_class_init,
NULL,
NULL,
- sizeof(GstParseAu),
+ sizeof(GstAuParse),
0,
- (GInstanceInitFunc) gst_parseau_init,
+ (GInstanceInitFunc) gst_auparse_init,
};
- parseau_type = g_type_register_static (GST_TYPE_ELEMENT, "GstParseAu", &parseau_info, 0);
+ auparse_type = g_type_register_static (GST_TYPE_ELEMENT, "GstAuParse", &auparse_info, 0);
}
- return parseau_type;
+ return auparse_type;
}
static void
-gst_parseau_class_init (GstParseAuClass *klass)
+gst_auparse_class_init (GstAuParseClass *klass)
{
GstElementClass *gstelement_class;
@@ -147,28 +147,28 @@ gst_parseau_class_init (GstParseAuClass *klass)
}
static void
-gst_parseau_init (GstParseAu *parseau)
+gst_auparse_init (GstAuParse *auparse)
{
- parseau->sinkpad = gst_pad_new_from_template (
+ auparse->sinkpad = gst_pad_new_from_template (
GST_PADTEMPLATE_GET (sink_factory_templ), "sink");
- gst_element_add_pad (GST_ELEMENT (parseau), parseau->sinkpad);
- gst_pad_set_chain_function (parseau->sinkpad, gst_parseau_chain);
+ gst_element_add_pad (GST_ELEMENT (auparse), auparse->sinkpad);
+ gst_pad_set_chain_function (auparse->sinkpad, gst_auparse_chain);
- parseau->srcpad = gst_pad_new_from_template (
+ auparse->srcpad = gst_pad_new_from_template (
GST_PADTEMPLATE_GET (src_factory_templ), "src");
- gst_element_add_pad (GST_ELEMENT (parseau), parseau->srcpad);
+ gst_element_add_pad (GST_ELEMENT (auparse), auparse->srcpad);
- parseau->offset = 0;
- parseau->size = 0;
- parseau->encoding = 0;
- parseau->frequency = 0;
- parseau->channels = 0;
+ auparse->offset = 0;
+ auparse->size = 0;
+ auparse->encoding = 0;
+ auparse->frequency = 0;
+ auparse->channels = 0;
}
static void
-gst_parseau_chain (GstPad *pad, GstBuffer *buf)
+gst_auparse_chain (GstPad *pad, GstBuffer *buf)
{
- GstParseAu *parseau;
+ GstAuParse *auparse;
gchar *data;
glong size;
GstCaps* tempcaps;
@@ -179,36 +179,36 @@ gst_parseau_chain (GstPad *pad, GstBuffer *buf)
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (buf != NULL);
- parseau = GST_PARSEAU (gst_pad_get_parent (pad));
+ auparse = GST_AUPARSE (gst_pad_get_parent (pad));
- GST_DEBUG (0, "gst_parseau_chain: got buffer in '%s'\n",
- gst_element_get_name (GST_ELEMENT (parseau)));
+ GST_DEBUG (0, "gst_auparse_chain: got buffer in '%s'\n",
+ gst_element_get_name (GST_ELEMENT (auparse)));
data = GST_BUFFER_DATA (buf);
size = GST_BUFFER_SIZE (buf);
/* if we haven't seen any data yet... */
- if (parseau->size == 0) {
+ if (auparse->size == 0) {
GstBuffer *newbuf;
gulong *head = (gulong *)data;
/* normal format is big endian (au is a Sparc format) */
if (GULONG_FROM_BE (*(head++)) == 0x2e736e64) {
- parseau->le = 0;
- parseau->offset = GULONG_FROM_BE (*(head++));
- parseau->size = GULONG_FROM_BE (*(head++));
- parseau->encoding = GULONG_FROM_BE (*(head++));
- parseau->frequency = GULONG_FROM_BE (*(head++));
- parseau->channels = GULONG_FROM_BE (*(head++));
+ auparse->le = 0;
+ auparse->offset = GULONG_FROM_BE (*(head++));
+ auparse->size = GULONG_FROM_BE (*(head++));
+ auparse->encoding = GULONG_FROM_BE (*(head++));
+ auparse->frequency = GULONG_FROM_BE (*(head++));
+ auparse->channels = GULONG_FROM_BE (*(head++));
/* but I wouldn't be surprised by a little endian version */
} else if (GULONG_FROM_LE (*(head++)) == 0x2e736e64) {
- parseau->le = 1;
- parseau->offset = GULONG_FROM_LE(*(head++));
- parseau->size = GULONG_FROM_LE(*(head++));
- parseau->encoding = GULONG_FROM_LE(*(head++));
- parseau->frequency = GULONG_FROM_LE(*(head++));
- parseau->channels = GULONG_FROM_LE(*(head++));
+ auparse->le = 1;
+ auparse->offset = GULONG_FROM_LE(*(head++));
+ auparse->size = GULONG_FROM_LE(*(head++));
+ auparse->encoding = GULONG_FROM_LE(*(head++));
+ auparse->frequency = GULONG_FROM_LE(*(head++));
+ auparse->channels = GULONG_FROM_LE(*(head++));
} else {
g_warning ("help, dunno what I'm looking at!\n");
@@ -217,13 +217,13 @@ gst_parseau_chain (GstPad *pad, GstBuffer *buf)
}
g_print ("offset %ld, size %ld, encoding %ld, frequency %ld, channels %ld\n",
- parseau->offset,parseau->size,parseau->encoding,
- parseau->frequency,parseau->channels);
+ auparse->offset,auparse->size,auparse->encoding,
+ auparse->frequency,auparse->channels);
GST_DEBUG (0, "offset %ld, size %ld, encoding %ld, frequency %ld, channels %ld\n",
- parseau->offset,parseau->size,parseau->encoding,
- parseau->frequency,parseau->channels);
+ auparse->offset,auparse->size,auparse->encoding,
+ auparse->frequency,auparse->channels);
- switch (parseau->encoding) {
+ switch (auparse->encoding) {
case 1:
law = 1;
depth = 8;
@@ -248,31 +248,31 @@ gst_parseau_chain (GstPad *pad, GstBuffer *buf)
"audio/raw",
"format", GST_PROPS_STRING ("int"),
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
- "rate", GST_PROPS_INT (parseau->frequency),
- "channels", GST_PROPS_INT (parseau->channels),
+ "rate", GST_PROPS_INT (auparse->frequency),
+ "channels", GST_PROPS_INT (auparse->channels),
"law", GST_PROPS_INT (law),
"depth", GST_PROPS_INT (depth),
"width", GST_PROPS_INT (depth),
"signed", GST_PROPS_BOOLEAN (sign));
- if (!gst_pad_try_set_caps (parseau->srcpad, tempcaps)) {
+ if (!gst_pad_try_set_caps (auparse->srcpad, tempcaps)) {
gst_buffer_unref (buf);
- gst_element_error (GST_ELEMENT (parseau), "could not set audio caps");
+ gst_element_error (GST_ELEMENT (auparse), "could not set audio caps");
return;
}
newbuf = gst_buffer_new ();
- GST_BUFFER_DATA (newbuf) = (gpointer) malloc (size-(parseau->offset));
- memcpy (GST_BUFFER_DATA (newbuf), data+24, size-(parseau->offset));
- GST_BUFFER_SIZE (newbuf) = size-(parseau->offset);
+ GST_BUFFER_DATA (newbuf) = (gpointer) malloc (size-(auparse->offset));
+ memcpy (GST_BUFFER_DATA (newbuf), data+24, size-(auparse->offset));
+ GST_BUFFER_SIZE (newbuf) = size-(auparse->offset);
gst_buffer_unref (buf);
- gst_pad_push (parseau->srcpad, newbuf);
+ gst_pad_push (auparse->srcpad, newbuf);
return;
}
- gst_pad_push (parseau->srcpad, buf);
+ gst_pad_push (auparse->srcpad, buf);
}
@@ -283,9 +283,9 @@ plugin_init (GModule *module, GstPlugin *plugin)
GstTypeFactory *type;
/* create the plugin structure */
- /* create an elementfactory for the parseau element and list it */
- factory = gst_elementfactory_new ("parseau", GST_TYPE_PARSEAU,
- &gst_parseau_details);
+ /* create an elementfactory for the auparse element and list it */
+ factory = gst_elementfactory_new ("auparse", GST_TYPE_AUPARSE,
+ &gst_auparse_details);
g_return_val_if_fail (factory != NULL, FALSE);
gst_elementfactory_add_padtemplate (factory, GST_PADTEMPLATE_GET (sink_factory_templ));
@@ -302,7 +302,7 @@ plugin_init (GModule *module, GstPlugin *plugin)
GstPluginDesc plugin_desc = {
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
- "parseau",
+ "auparse",
plugin_init
};
diff --git a/gst/auparse/gstparseau.h b/gst/auparse/gstauparse.h
index 1bfd852e..0bee4a03 100644
--- a/gst/auparse/gstparseau.h
+++ b/gst/auparse/gstauparse.h
@@ -18,8 +18,8 @@
*/
-#ifndef __GST_PARSEAU_H__
-#define __GST_PARSEAU_H__
+#ifndef __GST_AUPARSE_H__
+#define __GST_AUPARSE_H__
#include <config.h>
@@ -31,21 +31,21 @@ extern "C" {
#endif /* __cplusplus */
-#define GST_TYPE_PARSEAU \
- (gst_parseau_get_type())
-#define GST_PARSEAU(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_PARSEAU,GstParseAu))
-#define GST_PARSEAU_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_PARSEAU,GstParseAu))
-#define GST_IS_PARSEAU(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_PARSEAU))
-#define GST_IS_PARSEAU_CLASS(obj) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_PARSEAU))
+#define GST_TYPE_AUPARSE \
+ (gst_auparse_get_type())
+#define GST_AUPARSE(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_AUPARSE,GstAuParse))
+#define GST_AUPARSE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_AUPARSE,GstAuParse))
+#define GST_IS_AUPARSE(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_AUPARSE))
+#define GST_IS_AUPARSE_CLASS(obj) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_AUPARSE))
-typedef struct _GstParseAu GstParseAu;
-typedef struct _GstParseAuClass GstParseAuClass;
+typedef struct _GstAuParse GstAuParse;
+typedef struct _GstAuParseClass GstAuParseClass;
-struct _GstParseAu {
+struct _GstAuParse {
GstElement element;
GstPad *sinkpad,*srcpad;
@@ -59,11 +59,11 @@ struct _GstParseAu {
};
-struct _GstParseAuClass {
+struct _GstAuParseClass {
GstElementClass parent_class;
};
-GType gst_parseau_get_type (void);
+GType gst_auparse_get_type (void);
#ifdef __cplusplus
@@ -71,4 +71,4 @@ GType gst_parseau_get_type (void);
#endif /* __cplusplus */
-#endif /* __GST_PARSEAU_H__ */
+#endif /* __GST_AUPARSE_H__ */