2000-12-28 22:12:02 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
|
|
|
|
* 2000 Wim Taymans <wtay@chello.be>
|
|
|
|
*
|
|
|
|
* gstplugin.h: Header for plugin subsystem
|
2000-01-30 09:03:00 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GST_PLUGIN_H__
|
|
|
|
#define __GST_PLUGIN_H__
|
|
|
|
|
2001-10-17 10:21:27 +00:00
|
|
|
#include <gst/gstconfig.h>
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-09-16 11:24:10 +00:00
|
|
|
#include <time.h> /* time_t */
|
2001-10-17 10:21:27 +00:00
|
|
|
#include <gmodule.h>
|
2005-09-15 20:56:30 +00:00
|
|
|
#include <gst/gstobject.h>
|
2005-09-20 09:08:25 +00:00
|
|
|
#include <gst/gstmacros.h>
|
2000-12-28 22:12:02 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
G_BEGIN_DECLS
|
2002-07-08 19:07:30 +00:00
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
typedef struct _GstPlugin GstPlugin;
|
|
|
|
typedef struct _GstPluginClass GstPluginClass;
|
|
|
|
typedef struct _GstPluginDesc GstPluginDesc;
|
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
GQuark gst_plugin_error_quark (void);
|
2002-05-20 23:11:10 +00:00
|
|
|
#define GST_PLUGIN_ERROR gst_plugin_error_quark ()
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_PLUGIN_ERROR_MODULE,
|
2003-10-31 19:32:47 +00:00
|
|
|
GST_PLUGIN_ERROR_DEPENDENCIES,
|
|
|
|
GST_PLUGIN_ERROR_NAME_MISMATCH
|
2004-03-15 14:43:35 +00:00
|
|
|
} GstPluginError;
|
2002-05-20 23:11:10 +00:00
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_PLUGIN_FLAG_CACHED = (1<<0),
|
|
|
|
} GstPluginFlags;
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2003-10-31 19:32:47 +00:00
|
|
|
/* Initialiser function: returns TRUE if plugin initialised successfully */
|
2004-03-15 14:43:35 +00:00
|
|
|
typedef gboolean (*GstPluginInitFunc) (GstPlugin *plugin);
|
2003-10-07 21:58:42 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstPluginDesc {
|
|
|
|
gint major_version; /* major version of core that plugin was compiled for */
|
|
|
|
gint minor_version; /* minor version of core that plugin was compiled for */
|
|
|
|
gchar *name; /* unique name of plugin */
|
|
|
|
gchar *description; /* description of plugin */
|
2003-10-31 19:32:47 +00:00
|
|
|
GstPluginInitFunc plugin_init; /* pointer to plugin_init function */
|
2004-03-15 14:43:35 +00:00
|
|
|
gchar *version; /* version of the plugin */
|
|
|
|
gchar *license; /* effective license of plugin */
|
2005-09-03 17:00:52 +00:00
|
|
|
gchar *source; /* source module plugin belongs to */
|
|
|
|
gchar *package; /* shipped package plugin belongs to */
|
2004-03-15 14:43:35 +00:00
|
|
|
gchar *origin; /* URL to provider of plugin */
|
2004-12-07 18:50:39 +00:00
|
|
|
|
2003-12-09 02:39:31 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2000-01-30 09:03:00 +00:00
|
|
|
};
|
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
|
|
|
|
#define GST_TYPE_PLUGIN (gst_plugin_get_type())
|
|
|
|
#define GST_IS_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PLUGIN))
|
|
|
|
#define GST_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PLUGIN))
|
|
|
|
#define GST_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_PLUGIN, GstPluginClass))
|
|
|
|
#define GST_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PLUGIN, GstPlugin))
|
|
|
|
#define GST_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PLUGIN, GstPluginClass))
|
|
|
|
|
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
struct _GstPlugin {
|
2005-09-15 20:56:30 +00:00
|
|
|
GstObject object;
|
2005-09-15 00:13:26 +00:00
|
|
|
|
2005-09-20 06:28:33 +00:00
|
|
|
/*< private >*/
|
2004-03-15 14:43:35 +00:00
|
|
|
GstPluginDesc desc;
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
GstPluginDesc *orig_desc;
|
|
|
|
|
|
|
|
unsigned int flags;
|
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
gchar * filename;
|
2003-10-31 19:32:47 +00:00
|
|
|
|
2004-12-07 18:50:39 +00:00
|
|
|
GModule * module; /* contains the module if plugin is loaded */
|
2003-10-31 19:32:47 +00:00
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
size_t file_size;
|
|
|
|
time_t file_mtime;
|
|
|
|
|
2003-12-09 02:39:31 +00:00
|
|
|
gpointer _gst_reserved[GST_PADDING];
|
2001-04-22 12:30:14 +00:00
|
|
|
};
|
2000-01-30 09:03:00 +00:00
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
struct _GstPluginClass {
|
2005-09-15 20:56:30 +00:00
|
|
|
GstObjectClass object_class;
|
2005-09-15 00:13:26 +00:00
|
|
|
|
2005-09-20 06:28:33 +00:00
|
|
|
/*< private >*/
|
2005-09-15 00:13:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-12-22 01:39:35 +00:00
|
|
|
#define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,package,origin) \
|
2004-12-07 18:50:39 +00:00
|
|
|
GST_PLUGIN_EXPORT GstPluginDesc gst_plugin_desc = { \
|
2001-08-21 20:16:48 +00:00
|
|
|
major, \
|
|
|
|
minor, \
|
|
|
|
name, \
|
2004-12-07 18:50:39 +00:00
|
|
|
description, \
|
2003-10-31 19:32:47 +00:00
|
|
|
init, \
|
|
|
|
version, \
|
2004-12-07 18:50:39 +00:00
|
|
|
license, \
|
2005-09-03 17:00:52 +00:00
|
|
|
PACKAGE, \
|
2003-10-31 19:32:47 +00:00
|
|
|
package, \
|
|
|
|
origin, \
|
2003-12-22 01:39:35 +00:00
|
|
|
GST_PADDING_INIT \
|
|
|
|
};
|
|
|
|
|
2003-12-04 10:02:41 +00:00
|
|
|
#define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,package,origin) \
|
2002-11-29 19:08:47 +00:00
|
|
|
static void GST_GNUC_CONSTRUCTOR \
|
|
|
|
_gst_plugin_static_init__ ##init (void) \
|
2001-08-21 20:16:48 +00:00
|
|
|
{ \
|
|
|
|
static GstPluginDesc plugin_desc_ = { \
|
|
|
|
major, \
|
|
|
|
minor, \
|
2004-12-07 18:50:39 +00:00
|
|
|
name, \
|
|
|
|
description, \
|
|
|
|
init, \
|
2003-10-31 19:32:47 +00:00
|
|
|
version, \
|
2004-12-07 18:50:39 +00:00
|
|
|
license, \
|
2005-09-03 17:00:52 +00:00
|
|
|
PACKAGE, \
|
2003-10-31 19:32:47 +00:00
|
|
|
package, \
|
|
|
|
origin, \
|
2003-12-09 02:39:31 +00:00
|
|
|
GST_PADDING_INIT \
|
2001-08-21 20:16:48 +00:00
|
|
|
}; \
|
|
|
|
_gst_plugin_register_static (&plugin_desc_); \
|
2004-12-07 18:50:39 +00:00
|
|
|
}
|
2001-08-21 20:16:48 +00:00
|
|
|
|
2003-10-31 19:32:47 +00:00
|
|
|
#define GST_LICENSE_UNKNOWN "unknown"
|
2001-08-21 20:16:48 +00:00
|
|
|
|
2003-11-13 02:47:03 +00:00
|
|
|
|
2003-04-14 18:53:03 +00:00
|
|
|
/* function for filters */
|
2004-03-15 14:43:35 +00:00
|
|
|
typedef gboolean (*GstPluginFilter) (GstPlugin *plugin,
|
|
|
|
gpointer user_data);
|
2003-04-14 18:53:03 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
GType gst_plugin_get_type (void);
|
2005-09-15 00:13:26 +00:00
|
|
|
|
2004-03-15 14:43:35 +00:00
|
|
|
void _gst_plugin_initialize (void);
|
2004-12-07 18:50:39 +00:00
|
|
|
void _gst_plugin_register_static (GstPluginDesc *desc);
|
2004-03-15 14:43:35 +00:00
|
|
|
|
|
|
|
G_CONST_RETURN gchar* gst_plugin_get_name (GstPlugin *plugin);
|
|
|
|
G_CONST_RETURN gchar* gst_plugin_get_description (GstPlugin *plugin);
|
|
|
|
G_CONST_RETURN gchar* gst_plugin_get_filename (GstPlugin *plugin);
|
2004-12-07 18:50:39 +00:00
|
|
|
G_CONST_RETURN gchar* gst_plugin_get_version (GstPlugin *plugin);
|
2004-03-15 14:43:35 +00:00
|
|
|
G_CONST_RETURN gchar* gst_plugin_get_license (GstPlugin *plugin);
|
2005-09-03 17:00:52 +00:00
|
|
|
G_CONST_RETURN gchar* gst_plugin_get_source (GstPlugin *plugin);
|
2004-03-15 14:43:35 +00:00
|
|
|
G_CONST_RETURN gchar* gst_plugin_get_package (GstPlugin *plugin);
|
2004-12-07 18:50:39 +00:00
|
|
|
G_CONST_RETURN gchar* gst_plugin_get_origin (GstPlugin *plugin);
|
2004-03-15 14:43:35 +00:00
|
|
|
GModule * gst_plugin_get_module (GstPlugin *plugin);
|
|
|
|
gboolean gst_plugin_is_loaded (GstPlugin *plugin);
|
|
|
|
|
|
|
|
gboolean gst_plugin_name_filter (GstPlugin *plugin, const gchar *name);
|
|
|
|
|
2004-12-07 18:50:39 +00:00
|
|
|
gboolean gst_plugin_check_file (const gchar *filename, GError** error);
|
|
|
|
GstPlugin * gst_plugin_load_file (const gchar *filename, GError** error);
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2005-09-15 00:13:26 +00:00
|
|
|
GstPlugin * gst_plugin_load (GstPlugin *plugin);
|
2005-09-18 06:59:25 +00:00
|
|
|
GstPlugin * gst_plugin_load_by_name (const gchar *name);
|
2005-09-15 00:13:26 +00:00
|
|
|
|
2005-09-18 06:59:25 +00:00
|
|
|
void gst_plugin_list_free (GList *list);
|
2000-11-04 18:54:07 +00:00
|
|
|
|
2002-07-08 19:07:30 +00:00
|
|
|
G_END_DECLS
|
2004-03-15 14:43:35 +00:00
|
|
|
|
2000-01-30 09:03:00 +00:00
|
|
|
#endif /* __GST_PLUGIN_H__ */
|