summaryrefslogtreecommitdiffstats
path: root/sys/oss/gstossaudio.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2003-10-31 20:03:30 +0000
committerBenjamin Otte <otte@gnome.org>2003-10-31 20:03:30 +0000
commit4ac17766c89a2a1f37e4fc9e0c88c52c7a494374 (patch)
treea6da9a91c3bd844b727408e854e2bbef44d69003 /sys/oss/gstossaudio.c
parent64eb55d84a48d00511a2e6c36e3424d9c430e8ba (diff)
first bunch of conversions to new plugin_init. Includes libs/gst, gst/id3, sys/oss, ext/gnomevfs, gst/typefind and ex...
Original commit message from CVS: first bunch of conversions to new plugin_init. Includes libs/gst, gst/id3, sys/oss, ext/gnomevfs, gst/typefind and ext/mad. You guessed it, everything Rhythmbox needs ;) fixed BMP typefind and made gnomevfs one plugin instead of two while doing this
Diffstat (limited to 'sys/oss/gstossaudio.c')
-rw-r--r--sys/oss/gstossaudio.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/sys/oss/gstossaudio.c b/sys/oss/gstossaudio.c
index 8c9421a7..0e178c0c 100644
--- a/sys/oss/gstossaudio.c
+++ b/sys/oss/gstossaudio.c
@@ -26,26 +26,48 @@
#include "gstosssrc.h"
#include "gstossgst.h"
+extern gchar *__gst_oss_plugin_dir;
+
static gboolean
-plugin_init (GModule *module, GstPlugin *plugin)
+plugin_init (GstPlugin *plugin)
{
+ guint i = 0;
+ gchar **path;
+
if (!gst_library_load ("gstaudio"))
return FALSE;
- if (!gst_osselement_factory_init (plugin) ||
- !gst_osssrc_factory_init (plugin) ||
- !gst_osssink_factory_init (plugin) ||
- !gst_ossgst_factory_init (plugin)) {
- g_warning ("Failed to register OSS elements!");
+ /* get the path of this plugin, we assume the helper progam lives in the */
+ /* same directory. */
+ path = g_strsplit (plugin->filename, G_DIR_SEPARATOR_S, 0);
+ while (path[i]) {
+ i++;
+ if (path[i] == NULL) {
+ g_free (path[i-1]);
+ path[i-1] = NULL;
+ }
+ }
+ __gst_oss_plugin_dir = g_strjoinv (G_DIR_SEPARATOR_S, path);
+ g_strfreev (path);
+
+ if (!gst_element_register (plugin, "osssrc", GST_RANK_PRIMARY, GST_TYPE_OSSSRC) ||
+ !gst_element_register (plugin, "osssink", GST_RANK_PRIMARY, GST_TYPE_OSSSINK) ||
+ !gst_element_register (plugin, "ossgst", GST_RANK_MARGINAL, GST_TYPE_OSSGST)) {
return FALSE;
}
return TRUE;
}
-GstPluginDesc plugin_desc = {
+GST_PLUGIN_DEFINE (
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
"ossaudio",
- plugin_init
-};
+ "OSS (Open Sound System) support for GStreamer",
+ plugin_init,
+ VERSION,
+ GST_LICENSE,
+ GST_COPYRIGHT,
+ GST_PACKAGE,
+ GST_ORIGIN
+)