summaryrefslogtreecommitdiffstats
path: root/ext/audiofile
diff options
context:
space:
mode:
Diffstat (limited to 'ext/audiofile')
-rw-r--r--ext/audiofile/Makefile.am17
-rw-r--r--ext/audiofile/gstaf.c40
-rw-r--r--ext/audiofile/gstafparse.c27
-rw-r--r--ext/audiofile/gstafparse.h2
-rw-r--r--ext/audiofile/gstafsink.c12
-rw-r--r--ext/audiofile/gstafsink.h7
-rw-r--r--ext/audiofile/gstafsrc.c11
-rw-r--r--ext/audiofile/gstafsrc.h6
8 files changed, 69 insertions, 53 deletions
diff --git a/ext/audiofile/Makefile.am b/ext/audiofile/Makefile.am
index 8be5846d..31fab02d 100644
--- a/ext/audiofile/Makefile.am
+++ b/ext/audiofile/Makefile.am
@@ -1,15 +1,10 @@
plugindir = $(libdir)/gst
-plugin_LTLIBRARIES = libgstafsink.la libgstafsrc.la
+plugin_LTLIBRARIES = libgstaf.la
-libgstafsink_la_SOURCES = gstafsink.c
-libgstafsink_la_CFLAGS = $(GST_CFLAGS) $(AUDIOFILE_CFLAGS)
-libgstafsink_la_LIBADD = $(AUDIOFILE_LIBS)
-libgstafsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
+libgstaf_la_SOURCES = gstaf.c gstafsink.c gstafsrc.c gstafparse.c
+libgstaf_la_CFLAGS = $(GST_CFLAGS) $(AUDIOFILE_CFLAGS)
+libgstaf_la_LIBADD = $(AUDIOFILE_LIBS)
+libgstaf_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-libgstafsrc_la_SOURCES = gstafsrc.c
-libgstafsrc_la_CFLAGS = $(GST_CFLAGS) $(AUDIOFILE_CFLAGS)
-libgstafsrc_la_LIBADD = $(AUDIOFILE_LIBS)
-libgstafsrc_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
-
-noinst_HEADERS = gstafsink.h gstafsrc.h
+noinst_HEADERS = gstafsink.h gstafsrc.h
diff --git a/ext/audiofile/gstaf.c b/ext/audiofile/gstaf.c
new file mode 100644
index 00000000..4e2b3e9a
--- /dev/null
+++ b/ext/audiofile/gstaf.c
@@ -0,0 +1,40 @@
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ *
+ * 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.
+ */
+
+
+#include "gstafsrc.h"
+#include "gstafsink.h"
+#include "gstafparse.h"
+
+static gboolean
+plugin_init (GModule *module, GstPlugin *plugin)
+{
+ gst_afsink_plugin_init (module, plugin);
+ gst_afsrc_plugin_init (module, plugin);
+ gst_afparse_plugin_init (module, plugin);
+
+ return TRUE;
+}
+
+GstPluginDesc plugin_desc = {
+ GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ "gstaf",
+ plugin_init
+};
diff --git a/ext/audiofile/gstafparse.c b/ext/audiofile/gstafparse.c
index 32a12dce..5067ea1f 100644
--- a/ext/audiofile/gstafparse.c
+++ b/ext/audiofile/gstafparse.c
@@ -180,7 +180,7 @@ gst_afparse_loop(GstElement *element)
GstAFParse *afparse;
GstBuffer *buf;
GstBufferPool *bufpool;
- gint numframes, frames_to_bytes, frames_per_read, bytes_per_read;
+ gint numframes = 0, frames_to_bytes, frames_per_read, bytes_per_read;
guint8 *data;
gboolean bypass_afread = TRUE;
GstByteStream *bs;
@@ -315,8 +315,8 @@ gst_afparse_get_property (GObject *object, guint prop_id, GValue *value, GParamS
}
}
-static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+gboolean
+gst_afparse_plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
@@ -343,14 +343,6 @@ plugin_init (GModule *module, GstPlugin *plugin)
return TRUE;
}
-
-GstPluginDesc plugin_desc = {
- GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "afparse",
- plugin_init
-};
-
/* this is where we open the audiofile */
static gboolean
gst_afparse_open_file (GstAFParse *afparse)
@@ -483,7 +475,7 @@ static long
gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative)
{
GstByteStream *bs = (GstByteStream*)vfile->closure;
- GstSeekType type;
+ GstSeekType method;
guint64 current_offset = gst_bytestream_tell(bs);
if (!is_relative){
@@ -492,16 +484,15 @@ gst_afparse_vf_seek (AFvirtualfile *vfile, long offset, int is_relative)
return offset;
}
- type = GST_SEEK_BYTEOFFSET_SET;
+ method = GST_SEEK_METHOD_SET;
}
else {
if (offset == 0) return current_offset;
- type = GST_SEEK_BYTEOFFSET_CUR;
+ method = GST_SEEK_METHOD_CUR;
}
-
- g_print("doing seek to %d, current offset %lld\n", (gint)offset, current_offset);
- if (gst_bytestream_seek(bs, type, (gint64)offset)){
-
+
+ if (gst_bytestream_seek(bs, (gint64)offset, method)){
+ g_print("doing seek to %d\n", (gint)offset);
return offset;
}
return 0;
diff --git a/ext/audiofile/gstafparse.h b/ext/audiofile/gstafparse.h
index 72a40bb6..9483f248 100644
--- a/ext/audiofile/gstafparse.h
+++ b/ext/audiofile/gstafparse.h
@@ -95,6 +95,8 @@ struct _GstAFParseClass {
void (*handoff) (GstElement *element,GstPad *pad);
};
+gboolean gst_afparse_plugin_init (GModule *module, GstPlugin *plugin);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/ext/audiofile/gstafsink.c b/ext/audiofile/gstafsink.c
index 77e1637d..7ea8d3c8 100644
--- a/ext/audiofile/gstafsink.c
+++ b/ext/audiofile/gstafsink.c
@@ -260,8 +260,8 @@ gst_afsink_get_property (GObject *object, guint prop_id, GValue *value, GParamSp
}
}
-static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+gboolean
+gst_afsink_plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
@@ -276,14 +276,6 @@ plugin_init (GModule *module, GstPlugin *plugin)
return TRUE;
}
-
-GstPluginDesc plugin_desc = {
- GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "afsink",
- plugin_init
-};
-
/* this is where we open the audiofile */
static gboolean
gst_afsink_open_file (GstAFSink *sink)
diff --git a/ext/audiofile/gstafsink.h b/ext/audiofile/gstafsink.h
index d61951b6..7dc0d73d 100644
--- a/ext/audiofile/gstafsink.h
+++ b/ext/audiofile/gstafsink.h
@@ -53,7 +53,7 @@ typedef struct _GstAFSink GstAFSink;
typedef struct _GstAFSinkClass GstAFSinkClass;
typedef enum {
- GST_AFSINK_OPEN = GST_ELEMENT_FLAG_LAST,
+ GST_AFSINK_OPEN = GST_ELEMENT_FLAG_LAST,
GST_AFSINK_FLAG_LAST = GST_ELEMENT_FLAG_LAST + 2,
} GstAFSinkFlags;
@@ -88,8 +88,9 @@ struct _GstAFSinkClass {
void (*handoff) (GstElement *element,GstPad *pad);
};
-GType gst_afsink_get_type(void);
-/*gboolean gst_afsink_factory_init (GstElementFactory *factory); */
+GType gst_afsink_get_type (void);
+gboolean gst_afsink_plugin_init (GModule *module, GstPlugin *plugin);
+
#ifdef __cplusplus
diff --git a/ext/audiofile/gstafsrc.c b/ext/audiofile/gstafsrc.c
index 751b3cec..d42c6ebc 100644
--- a/ext/audiofile/gstafsrc.c
+++ b/ext/audiofile/gstafsrc.c
@@ -271,8 +271,8 @@ gst_afsrc_get_property (GObject *object, guint prop_id, GValue *value, GParamSpe
}
}
-static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+gboolean
+gst_afsrc_plugin_init (GModule *module, GstPlugin *plugin)
{
GstElementFactory *factory;
@@ -295,13 +295,6 @@ plugin_init (GModule *module, GstPlugin *plugin)
}
-GstPluginDesc plugin_desc = {
- GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "afsrc",
- plugin_init
-};
-
/* this is where we open the audiofile */
static gboolean
gst_afsrc_open_file (GstAFSrc *src)
diff --git a/ext/audiofile/gstafsrc.h b/ext/audiofile/gstafsrc.h
index 2544678b..61cb5095 100644
--- a/ext/audiofile/gstafsrc.h
+++ b/ext/audiofile/gstafsrc.h
@@ -94,8 +94,10 @@ struct _GstAFSrcClass {
void (*handoff) (GstElement *element,GstPad *pad);
};
-GType gst_afsrc_get_type(void);
-/*gboolean gst_afsrc_factory_init (GstElementFactory *factory);*/
+GType gst_afsrc_get_type (void);
+gboolean gst_afsrc_plugin_init (GModule *module, GstPlugin *plugin);
+
+
#ifdef __cplusplus