gstreamer_core/gst/gstplugin.h
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
    30 #include <sys/types.h> /* off_t */
    30 #include <sys/types.h> /* off_t */
    31 #include <sys/stat.h> /* off_t */
    31 #include <sys/stat.h> /* off_t */
    32 #include <gmodule.h>
    32 #include <gmodule.h>
    33 #include <gst/gstobject.h>
    33 #include <gst/gstobject.h>
    34 #include <gst/gstmacros.h>
    34 #include <gst/gstmacros.h>
    35 #include <gst/gststructure.h>
       
    36 
    35 
    37 G_BEGIN_DECLS
    36 G_BEGIN_DECLS
    38 
    37 
    39 typedef struct _GstPlugin GstPlugin;
    38 typedef struct _GstPlugin GstPlugin;
    40 typedef struct _GstPluginClass GstPluginClass;
    39 typedef struct _GstPluginClass GstPluginClass;
    41 typedef struct _GstPluginPrivate GstPluginPrivate;
       
    42 typedef struct _GstPluginDesc GstPluginDesc;
    40 typedef struct _GstPluginDesc GstPluginDesc;
    43 
    41 
    44 /**
    42 /**
    45  * gst_plugin_error_quark:
    43  * gst_plugin_error_quark:
    46  *
    44  *
    80 {
    78 {
    81   GST_PLUGIN_FLAG_CACHED = (1<<0)
    79   GST_PLUGIN_FLAG_CACHED = (1<<0)
    82 } GstPluginFlags;
    80 } GstPluginFlags;
    83 
    81 
    84 /**
    82 /**
    85  * GstPluginDependencyFlags:
       
    86  * @GST_PLUGIN_DEPENDENCY_FLAG_NONE : no special flags
       
    87  * @GST_PLUGIN_DEPENDENCY_FLAG_RECURSE : recurse into subdirectories
       
    88  * @GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY : use paths
       
    89  *         argument only if none of the environment variables is set
       
    90  * @GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX : interpret
       
    91  *         filename argument as filter suffix and check all matching files in
       
    92  *         the directory
       
    93  *
       
    94  * Flags used in connection with gst_plugin_add_dependency().
       
    95  *
       
    96  * Since: 0.10.22
       
    97  */
       
    98 typedef enum {
       
    99   GST_PLUGIN_DEPENDENCY_FLAG_NONE = 0,
       
   100   GST_PLUGIN_DEPENDENCY_FLAG_RECURSE = (1 << 0),
       
   101   GST_PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY = (1 << 1),
       
   102   GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX = (1 << 2)
       
   103 } GstPluginDependencyFlags;
       
   104 
       
   105 /**
       
   106  * GstPluginInitFunc:
    83  * GstPluginInitFunc:
   107  * @plugin: The plugin object that can be used to register #GstPluginFeatures for this plugin.
    84  * @plugin: The plugin object that can be used to register #GstPluginFeatures for this plugin.
   108  *
    85  *
   109  * A plugin should provide a pointer to a function of this type in the
    86  * A plugin should provide a pointer to a function of this type in the
   110  * plugin_desc struct.
    87  * plugin_desc struct.
   111  * This function will be called by the loader at startup.
    88  * This function will be called by the loader at startup.
   112  *
    89  *
   113  * Returns: %TRUE if plugin initialised successfully
    90  * Returns: %TRUE if plugin initialised successfully
   114  */
    91  */
   115 typedef gboolean (*GstPluginInitFunc) (GstPlugin *plugin);
    92 typedef gboolean (*GstPluginInitFunc) (GstPlugin *plugin);
   116 
       
   117 /**
       
   118  * GstPluginInitFullFunc:
       
   119  * @plugin: The plugin object that can be used to register #GstPluginFeatures for this plugin.
       
   120  * @user_data: The user data.
       
   121  *
       
   122  * A plugin should provide a pointer to a function of either #GstPluginInitFunc
       
   123  * or this type in the plugin_desc struct.
       
   124  * The function will be called by the loader at startup. This version allows
       
   125  * user data to be passed to init function (useful for bindings).
       
   126  *
       
   127  * Returns: %TRUE if plugin initialised successfully
       
   128  *
       
   129  * Since: 0.10.24
       
   130  *
       
   131  */
       
   132 typedef gboolean (*GstPluginInitFullFunc) (GstPlugin *plugin, gpointer user_data);
       
   133 
    93 
   134 /**
    94 /**
   135  * GstPluginDesc:
    95  * GstPluginDesc:
   136  * @major_version: the major version number of core that plugin was compiled for
    96  * @major_version: the major version number of core that plugin was compiled for
   137  * @minor_version: the minor version number of core that plugin was compiled for
    97  * @minor_version: the minor version number of core that plugin was compiled for
   198   off_t         file_size;
   158   off_t         file_size;
   199   time_t        file_mtime;
   159   time_t        file_mtime;
   200   gboolean      registered;     /* TRUE when the registry has seen a filename
   160   gboolean      registered;     /* TRUE when the registry has seen a filename
   201                                  * that matches the plugin's basename */
   161                                  * that matches the plugin's basename */
   202 
   162 
   203   GstPluginPrivate *priv;
   163   gpointer _gst_reserved[GST_PADDING];
   204   gpointer _gst_reserved[GST_PADDING - 1];
       
   205 };
   164 };
   206 
   165 
   207 struct _GstPluginClass {
   166 struct _GstPluginClass {
   208   GstObjectClass  object_class;
   167   GstObjectClass  object_class;
   209 
   168 
   223  * @package: the package-name (e.g. PACKAGE_NAME from config.h)
   182  * @package: the package-name (e.g. PACKAGE_NAME from config.h)
   224  * @origin: a description from where the package comes from (e.g. the homepage URL)
   183  * @origin: a description from where the package comes from (e.g. the homepage URL)
   225  *
   184  *
   226  * This macro needs to be used to define the entry point and meta data of a
   185  * This macro needs to be used to define the entry point and meta data of a
   227  * plugin. One would use this macro to export a plugin, so that it can be used
   186  * plugin. One would use this macro to export a plugin, so that it can be used
   228  * by other applications.
   187  * by other applications
   229  *
       
   230  * The macro uses a define named PACKAGE for the #GstPluginDesc,source field.
       
   231  */
   188  */
   232 #define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,package,origin)	\
   189 #define GST_PLUGIN_DEFINE(major,minor,name,description,init,version,license,package,origin)	\
   233 GST_PLUGIN_EXPORT GstPluginDesc gst_plugin_desc = {	\
   190 GST_PLUGIN_EXPORT GstPluginDesc gst_plugin_desc = {	\
   234   major,						\
   191   major,						\
   235   minor,						\
   192   minor,						\
   258  *
   215  *
   259  * This macro needs to be used to define the entry point and meta data of a
   216  * This macro needs to be used to define the entry point and meta data of a
   260  * local plugin. One would use this macro to define a local plugin that can only
   217  * local plugin. One would use this macro to define a local plugin that can only
   261  * be used by the own application.
   218  * be used by the own application.
   262  *
   219  *
   263  * The macro uses a define named PACKAGE for the #GstPluginDesc.source field.
       
   264  *
       
   265  * Deprecated: Use gst_plugin_register_static() instead. This macro was
   220  * Deprecated: Use gst_plugin_register_static() instead. This macro was
   266  * deprecated because it uses constructors, which is a compiler feature not
   221  * deprecated because it uses constructors, which is a compiler feature not
   267  * available on all compilers.
   222  * available on all compilers.
   268  *
       
   269  */
   223  */
   270 /* We don't have deprecation guards here on purpose, it's enough to have
   224 /* We don't have deprecation guards here on purpose, it's enough to have
   271  * deprecation guards around _gst_plugin_register_static(), and will result in
   225  * deprecation guards around _gst_plugin_register_static(), and will result in
   272  * much better error messages when compiling with -DGST_DISABLE_DEPRECATED */
   226  * much better error messages when compiling with -DGST_DISABLE_DEPRECATED */
   273 #define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,package,origin)  \
   227 #define GST_PLUGIN_DEFINE_STATIC(major,minor,name,description,init,version,license,package,origin)  \
   318 
   272 
   319 
   273 
   320 GType                   gst_plugin_get_type             (void);
   274 GType                   gst_plugin_get_type             (void);
   321 
   275 
   322 #ifndef GST_DISABLE_DEPRECATED
   276 #ifndef GST_DISABLE_DEPRECATED
   323 #ifdef __SYMBIAN32__
       
   324 IMPORT_C
       
   325 #endif
       
   326 void			_gst_plugin_register_static	(GstPluginDesc *desc);
   277 void			_gst_plugin_register_static	(GstPluginDesc *desc);
   327 #endif
   278 #endif
   328 
   279 
   329 #ifdef __SYMBIAN32__
       
   330 IMPORT_C
       
   331 #endif
       
   332 gboolean		gst_plugin_register_static	(gint major_version,
   280 gboolean		gst_plugin_register_static	(gint major_version,
   333                                                          gint minor_version,
   281                                                          gint minor_version,
   334                                                          const gchar *name,
   282                                                          const gchar *name,
   335                                                          gchar *description,
   283                                                          gchar *description,
   336                                                          GstPluginInitFunc init_func,
   284                                                          GstPluginInitFunc init_func,
   342 #ifdef __SYMBIAN32__
   290 #ifdef __SYMBIAN32__
   343 IMPORT_C
   291 IMPORT_C
   344 #endif
   292 #endif
   345 
   293 
   346 
   294 
   347 gboolean		gst_plugin_register_static_full	(gint major_version,
       
   348                                                          gint minor_version,
       
   349                                                          const gchar *name,
       
   350                                                          gchar *description,
       
   351                                                          GstPluginInitFullFunc init_full_func,
       
   352                                                          const gchar *version,
       
   353                                                          const gchar *license,
       
   354                                                          const gchar *source,
       
   355                                                          const gchar *package,
       
   356                                                          const gchar *origin,
       
   357                                                          gpointer user_data);
       
   358 #ifdef __SYMBIAN32__
       
   359 IMPORT_C
       
   360 #endif
       
   361 
       
   362 
       
   363 G_CONST_RETURN gchar*	gst_plugin_get_name		(GstPlugin *plugin);
   295 G_CONST_RETURN gchar*	gst_plugin_get_name		(GstPlugin *plugin);
   364 #ifdef __SYMBIAN32__
   296 #ifdef __SYMBIAN32__
   365 IMPORT_C
   297 IMPORT_C
   366 #endif
   298 #endif
   367 
   299 
   398 G_CONST_RETURN gchar*	gst_plugin_get_origin		(GstPlugin *plugin);
   330 G_CONST_RETURN gchar*	gst_plugin_get_origin		(GstPlugin *plugin);
   399 #ifdef __SYMBIAN32__
   331 #ifdef __SYMBIAN32__
   400 IMPORT_C
   332 IMPORT_C
   401 #endif
   333 #endif
   402 
   334 
   403 G_CONST_RETURN GstStructure*	gst_plugin_get_cache_data	(GstPlugin * plugin);
       
   404 #ifdef __SYMBIAN32__
       
   405 IMPORT_C
       
   406 #endif
       
   407 
       
   408 void		gst_plugin_set_cache_data	(GstPlugin * plugin, GstStructure *cache_data);
       
   409 #ifdef __SYMBIAN32__
       
   410 IMPORT_C
       
   411 #endif
       
   412 
       
   413 
       
   414 GModule *		gst_plugin_get_module		(GstPlugin *plugin);
   335 GModule *		gst_plugin_get_module		(GstPlugin *plugin);
   415 #ifdef __SYMBIAN32__
   336 #ifdef __SYMBIAN32__
   416 IMPORT_C
   337 IMPORT_C
   417 #endif
   338 #endif
   418 
   339 
   443 #ifdef __SYMBIAN32__
   364 #ifdef __SYMBIAN32__
   444 IMPORT_C
   365 IMPORT_C
   445 #endif
   366 #endif
   446 
   367 
   447 
   368 
   448 void                    gst_plugin_add_dependency (GstPlugin    * plugin,
       
   449                                                    const gchar ** env_vars,
       
   450                                                    const gchar ** paths,
       
   451                                                    const gchar ** names,
       
   452                                                    GstPluginDependencyFlags flags);
       
   453 #ifdef __SYMBIAN32__
       
   454 IMPORT_C
       
   455 #endif
       
   456 
       
   457 
       
   458 void                    gst_plugin_add_dependency_simple (GstPlugin   * plugin,
       
   459                                                           const gchar * env_vars,
       
   460                                                           const gchar * paths,
       
   461                                                           const gchar * names,
       
   462                                                           GstPluginDependencyFlags flags);
       
   463 #ifdef __SYMBIAN32__
       
   464 IMPORT_C
       
   465 #endif
       
   466 
       
   467 
       
   468 void gst_plugin_list_free (GList *list);
   369 void gst_plugin_list_free (GList *list);
   469 
   370 
   470 G_END_DECLS
   371 G_END_DECLS
   471 
   372 
   472 #endif /* __GST_PLUGIN_H__ */
   373 #endif /* __GST_PLUGIN_H__ */