AC_CONFIG_SUBDIRS(gst-libs/ext/ffmpeg/ffmpeg)
fi
+dnl ############################
+dnl # Set up some more defines #
+dnl ############################
+
+dnl set license and copyright notice
+AC_DEFINE(GST_LICENSE, "LGPL", [GStreamer license])
+AC_DEFINE(GST_COPYRIGHT, "(c) 1999-2003 The GStreamer Team", [copyright message in plugins])
+dnl package name in plugins
+AC_ARG_WITH(package-name,
+AC_HELP_STRING([--with-package-name],[specify package name to use in plugins]),
+[case "${withval}" in
+ yes) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
+ no) AC_MSG_ERROR(bad value ${withval} for --with-package-name) ;;
+ *) GST_PACKAGE="${withval}" ;;
+esac],
+[GST_PACKAGE="Gstreamer"]) dnl Default value
+AC_MSG_NOTICE(Using $GST_PACKAGE as package name)
+AC_DEFINE_UNQUOTED(GST_PACKAGE, "$GST_PACKAGE", [package name in plugins])
+dnl package origin URL
+AC_ARG_WITH(package-origin,
+AC_HELP_STRING([--with-package-origin],[specify package origin URL to use in plugins]),
+[case "${withval}" in
+ yes) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
+ no) AC_MSG_ERROR(bad value ${withval} for --with-package-origin) ;;
+ *) GST_ORIGIN="${withval}" ;;
+esac],
+[GST_ORIGIN="http://gstreamer.net"]) dnl Default value
+AC_MSG_NOTICE(Using $GST_ORIGIN as package origin)
+AC_DEFINE_UNQUOTED(GST_ORIGIN, "$GST_ORIGIN", [package origin])
+
dnl #########################
dnl # Make the output files #
dnl #########################
#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
+)
ARG_DEVICE_NAME,
};
-/* elementfactory information */
-static GstElementDetails gst_osselement_details = {
- "Audio Element (OSS)",
- "Generic/Audio",
- "LGPL",
- "Generic OSS element",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
-
static void gst_osselement_class_init (GstOssElementClass *klass);
static void gst_osselement_init (GstOssElement *oss);
static void gst_osselement_dispose (GObject *object);
return GST_STATE_SUCCESS;
}
-gboolean
-gst_osselement_factory_init (GstPlugin *plugin)
-{
- GstElementFactory *factory;
-
- factory = gst_element_factory_new ("ossmixer",
- GST_TYPE_OSSELEMENT,
- &gst_osselement_details);
- g_return_val_if_fail (factory != NULL, FALSE);
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
-}
GType gst_osselement_get_type (void);
-/* factory register function */
-gboolean gst_osselement_factory_init (GstPlugin *plugin);
-
/* some useful functions */
gboolean gst_osselement_parse_caps (GstOssElement *oss,
GstCaps *caps);
#include "gstosshelper.h"
-static GstElementDetails gst_ossgst_details = {
+static GstElementDetails gst_ossgst_details = GST_ELEMENT_DETAILS (
"Audio Wrapper (OSS)",
"Source/Audio",
- "LGPL",
"Hijacks /dev/dsp to get the output of OSS apps into GStreamer",
- VERSION,
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 2001",
-};
+ "Wim Taymans <wim.taymans@chello.be>"
+);
+static void gst_ossgst_base_init (gpointer g_class);
static void gst_ossgst_class_init (GstOssGstClass *klass);
static void gst_ossgst_init (GstOssGst *ossgst);
static GstElementClass *parent_class = NULL;
static GstPadTemplate *gst_ossgst_src_template;
-static gchar *plugin_dir = NULL;
+gchar *__gst_oss_plugin_dir = NULL;
GType
gst_ossgst_get_type (void)
if (!ossgst_type) {
static const GTypeInfo ossgst_info = {
sizeof(GstOssGstClass),
- NULL,
+ gst_ossgst_base_init,
NULL,
(GClassInitFunc)gst_ossgst_class_init,
NULL,
}
static void
+gst_ossgst_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (element_class, &gst_ossgst_details);
+ gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (ossgst_src_factory));
+}
+static void
gst_ossgst_class_init (GstOssGstClass *klass)
{
GObjectClass *gobject_class;
ld_preload = "";
}
- ld_preload = g_strconcat (ld_preload, " ", plugin_dir, G_DIR_SEPARATOR_S,
+ ld_preload = g_strconcat (ld_preload, " ", __gst_oss_plugin_dir, G_DIR_SEPARATOR_S,
"libgstosshelper.so", NULL);
setenv ("LD_PRELOAD", ld_preload, TRUE);
return GST_STATE_SUCCESS;
}
-gboolean
-gst_ossgst_factory_init (GstPlugin *plugin)
-{
- GstElementFactory *factory;
- gchar **path;
- gint i =0;
-
- /* 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;
- }
- }
- plugin_dir = g_strjoinv (G_DIR_SEPARATOR_S, path);
- g_strfreev (path);
-
- factory = gst_element_factory_new ("ossgst", GST_TYPE_OSSGST, &gst_ossgst_details);
- g_return_val_if_fail (factory != NULL, FALSE);
-
- gst_ossgst_src_template = ossgst_src_factory ();
- gst_element_factory_add_pad_template (factory, gst_ossgst_src_template);
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
-}
-
GType gst_ossgst_get_type(void);
-gboolean gst_ossgst_factory_init(GstPlugin *plugin);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include "gstosssink.h"
/* elementfactory information */
-static GstElementDetails gst_osssink_details = {
+static GstElementDetails gst_osssink_details = GST_ELEMENT_DETAILS (
"Audio Sink (OSS)",
"Sink/Audio",
- "LGPL",
"Output to a sound card via OSS",
- VERSION,
"Erik Walthinsen <omega@cse.ogi.edu>, "
- "Wim Taymans <wim.taymans@chello.be>",
- "(C) 1999",
-};
+ "Wim Taymans <wim.taymans@chello.be>"
+);
+static void gst_osssink_base_init (gpointer g_class);
static void gst_osssink_class_init (GstOssSinkClass *klass);
static void gst_osssink_init (GstOssSink *osssink);
static void gst_osssink_dispose (GObject *object);
if (!osssink_type) {
static const GTypeInfo osssink_info = {
sizeof(GstOssSinkClass),
- NULL,
+ gst_osssink_base_init,
NULL,
(GClassInitFunc)gst_osssink_class_init,
NULL,
}
static void
+gst_osssink_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (element_class, &gst_osssink_details);
+ gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (osssink_sink_factory));
+}
+static void
gst_osssink_class_init (GstOssSinkClass *klass)
{
GObjectClass *gobject_class;
return GST_STATE_SUCCESS;
}
-
-gboolean
-gst_osssink_factory_init (GstPlugin *plugin)
-{
- GstElementFactory *factory;
-
- factory = gst_element_factory_new ("osssink", GST_TYPE_OSSSINK, &gst_osssink_details);
- g_return_val_if_fail (factory != NULL, FALSE);
-
- gst_element_factory_add_pad_template (factory, GST_PAD_TEMPLATE_GET (osssink_sink_factory));
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
-}
GType gst_osssink_get_type(void);
-gboolean gst_osssink_factory_init(GstPlugin *plugin);
-
G_END_DECLS
#endif /* __GST_OSSSINK_H__ */
#include <gst/audio/audioclock.h>
/* elementfactory information */
-static GstElementDetails gst_osssrc_details = {
+static GstElementDetails gst_osssrc_details = GST_ELEMENT_DETAILS (
"Audio Source (OSS)",
"Source/Audio",
- "LGPL",
"Read from the sound card",
- VERSION,
- "Erik Walthinsen <omega@cse.ogi.edu>",
- "(C) 1999",
-};
+ "Erik Walthinsen <omega@cse.ogi.edu>"
+);
/* OssSrc signals and args */
)
)
+static void gst_osssrc_base_init (gpointer g_class);
static void gst_osssrc_class_init (GstOssSrcClass *klass);
static void gst_osssrc_init (GstOssSrc *osssrc);
static void gst_osssrc_dispose (GObject *object);
if (!osssrc_type) {
static const GTypeInfo osssrc_info = {
sizeof(GstOssSrcClass),
- NULL,
+ gst_osssrc_base_init,
NULL,
(GClassInitFunc)gst_osssrc_class_init,
NULL,
}
static void
+gst_osssrc_base_init (gpointer g_class)
+{
+ GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
+
+ gst_element_class_set_details (element_class, &gst_osssrc_details);
+ gst_element_class_add_pad_template (element_class, GST_PAD_TEMPLATE_GET (osssrc_src_factory));
+}
+static void
gst_osssrc_class_init (GstOssSrcClass *klass)
{
GObjectClass *gobject_class;
}
return res;
}
-
-gboolean
-gst_osssrc_factory_init (GstPlugin *plugin)
-{
- GstElementFactory *factory;
-
- factory = gst_element_factory_new ("osssrc",
- GST_TYPE_OSSSRC,
- &gst_osssrc_details);
- g_return_val_if_fail (factory != NULL, FALSE);
-
- gst_element_factory_add_pad_template (factory,
- GST_PAD_TEMPLATE_GET (osssrc_src_factory));
-
- gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
-
- return TRUE;
-}
GType gst_osssrc_get_type(void);
-gboolean gst_osssrc_factory_init (GstPlugin *plugin);
-
G_END_DECLS
#endif /* __GST_OSSSRC_H__ */