- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

# plugin.h

Go to the documentation of this file.

    00001 // -*- c++ -*-
    00002 // Generated by gtkmmproc -- DO NOT MODIFY!
    00003 #ifndef _GSTREAMERMM_PLUGIN_H
    00004 #define _GSTREAMERMM_PLUGIN_H
    00005
    00006
    00007 #include <glibmm.h>
    00008
    00009 /* gstreamermm - a C++ wrapper for gstreamer
    00010  *
    00011  * Copyright 2008 The gstreamermm Development Team
    00012  *
    00013  * This library is free software; you can redistribute it and/or
    00014  * modify it under the terms of the GNU Lesser General Public
    00015  * License as published by the Free Software Foundation; either
    00016  * version 2.1 of the License, or (at your option) any later version.
    00017  *
    00018  * This library is distributed in the hope that it will be useful,
    00019  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00020  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00021  * Lesser General Public License for more details.
    00022  *
    00023  * You should have received a copy of the GNU Lesser General Public
    00024  * License along with this library; if not, write to the Free
    00025  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    00026  */
    00027
    00028 #include <gst/gstplugin.h>
    00029 #include <gstreamermm/object.h>
    00030
    00031
    00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00033 typedef struct _GstPlugin GstPlugin;
    00034 typedef struct _GstPluginClass GstPluginClass;
    00035 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00036
    00037
    00038 namespace Gst
    00039 { class Plugin_Class; } // namespace Gst
    00040 namespace Gst
    00041 {
    00042
    00056 enum PluginDependencyFlags
    00057 {
    00058   PLUGIN_DEPENDENCY_FLAG_NONE = 0,
    00059   PLUGIN_DEPENDENCY_FLAG_RECURSE = 1 << 0,
    00060   PLUGIN_DEPENDENCY_FLAG_PATHS_ARE_DEFAULT_ONLY = 1 << 1,
    00061   PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_SUFFIX = 1 << 2
    00062 };
    00063
    00065 inline PluginDependencyFlags operator|(PluginDependencyFlags lhs, PluginDependencyFlags rhs)
    00066   { return static_cast<PluginDependencyFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs)); }
    00067
    00069 inline PluginDependencyFlags operator&(PluginDependencyFlags lhs, PluginDependencyFlags rhs)
    00070   { return static_cast<PluginDependencyFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs)); }
    00071
    00073 inline PluginDependencyFlags operator^(PluginDependencyFlags lhs, PluginDependencyFlags rhs)
    00074   { return static_cast<PluginDependencyFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs)); }
    00075
    00077 inline PluginDependencyFlags operator~(PluginDependencyFlags flags)
    00078   { return static_cast<PluginDependencyFlags>(~static_cast<unsigned>(flags)); }
    00079
    00081 inline PluginDependencyFlags& operator|=(PluginDependencyFlags& lhs, PluginDependencyFlags rhs)
    00082   { return (lhs = static_cast<PluginDependencyFlags>(static_cast<unsigned>(lhs) | static_cast<unsigned>(rhs))); }
    00083
    00085 inline PluginDependencyFlags& operator&=(PluginDependencyFlags& lhs, PluginDependencyFlags rhs)
    00086   { return (lhs = static_cast<PluginDependencyFlags>(static_cast<unsigned>(lhs) & static_cast<unsigned>(rhs))); }
    00087
    00089 inline PluginDependencyFlags& operator^=(PluginDependencyFlags& lhs, PluginDependencyFlags rhs)
    00090   { return (lhs = static_cast<PluginDependencyFlags>(static_cast<unsigned>(lhs) ^ static_cast<unsigned>(rhs))); }
    00091
    00092 } // namespace Gst
    00093
    00094
    00095 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00096 namespace Glib
    00097 {
    00098
    00099 template <>
    00100 class Value<Gst::PluginDependencyFlags> : public Glib::Value_Flags<Gst::PluginDependencyFlags>
    00101 {
    00102 public:
    00103   static GType value_type() G_GNUC_CONST;
    00104 };
    00105
    00106 } // namespace Glib
    00107 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00108
    00109
    00110 namespace Gst
    00111 {
    00112
    00113
    00120 class PluginError : public Glib::Error
    00121 {
    00122 public:
    00123   enum Code
    00124   {
    00125     MODULE,
    00126     DEPENDENCIES,
    00127     NAME_MISMATCH
    00128   };
    00129
    00130   PluginError(Code error_code, const Glib::ustring& error_message);
    00131   explicit PluginError(GError* gobject);
    00132   Code code() const;
    00133
    00134 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00135 private:
    00136
    00137 #ifdef GLIBMM_EXCEPTIONS_ENABLED
    00138   static void throw_func(GError* gobject);
    00139 #else
    00140   //When not using exceptions, we just pass the Exception object around without throwing it:
    00141   static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
    00142 #endif //GLIBMM_EXCEPTIONS_ENABLED
    00143
    00144   friend void wrap_init(); // uses throw_func()
    00145 #endif
    00146 };
    00147
    00148 } // namespace Gst
    00149
    00150 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00151 namespace Glib
    00152 {
    00153
    00154 template <>
    00155 class Value<Gst::PluginError::Code> : public Glib::Value_Enum<Gst::PluginError::Code>
    00156 {
    00157 public:
    00158   static GType value_type() G_GNUC_CONST;
    00159 };
    00160
    00161 } // namespace Glib
    00162 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00163
    00164
    00165 namespace Gst
    00166 {
    00167
    00168
    00169 class Structure;
    00170
    00194 class Plugin : public Object
    00195 {
    00196
    00197 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00198
    00199 public:
    00200   typedef Plugin CppObjectType;
    00201   typedef Plugin_Class CppClassType;
    00202   typedef GstPlugin BaseObjectType;
    00203   typedef GstPluginClass BaseClassType;
    00204
    00205 private:  friend class Plugin_Class;
    00206   static CppClassType plugin_class_;
    00207
    00208 private:
    00209   // noncopyable
    00210   Plugin(const Plugin&);
    00211   Plugin& operator=(const Plugin&);
    00212
    00213 protected:
    00214   explicit Plugin(const Glib::ConstructParams& construct_params);
    00215   explicit Plugin(GstPlugin* castitem);
    00216
    00217 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
    00218
    00219 public:
    00220   virtual ~Plugin();
    00221
    00222 #ifndef DOXYGEN_SHOULD_SKIP_THIS
    00223   static GType get_type()      G_GNUC_CONST;
    00224
    00225
    00226   static GType get_base_type() G_GNUC_CONST;
    00227 #endif
    00228
    00230   GstPlugin*       gobj()       { return reinterpret_cast<GstPlugin*>(gobject_); }
    00231
    00233   const GstPlugin* gobj() const { return reinterpret_cast<GstPlugin*>(gobject_); }
    00234
    00236   GstPlugin* gobj_copy();
    00237
    00238 private:
    00239
    00240
    00241 public:
    00247   typedef sigc::slot< bool, const Glib::RefPtr<Gst::Plugin>& > SlotInit;
    00248
    00254   typedef sigc::slot< bool, const Glib::RefPtr<Gst::Plugin>& > SlotFilter;
    00255
    00256
    00257   static Glib::QueryQuark error_quark();
    00258
    00262   Glib::ustring get_name() const;
    00263
    00267   Glib::ustring get_description() const;
    00268
    00272   Glib::ustring get_filename() const;
    00273
    00277   Glib::ustring get_license() const;
    00278
    00282   Glib::ustring get_package() const;
    00283
    00287   Glib::ustring get_origin() const;
    00288
    00292   Glib::ustring get_source() const;
    00293
    00297   Glib::ustring get_version() const;
    00298
    00299   //TODO: Use Glib::Module instead of GModule if possible:
    00300
    00306   GModule* get_module();
    00307
    00313   const GModule* get_module() const;
    00314
    00318   bool is_loaded() const;
    00319
    00320 // A copy is taken so that the original is not freed by the wrapper.
    00321
    00322
    00329   const Gst::Structure get_cache_data() const;
    00330
    00331
    00340   void set_cache_data(Gst::Structure& cache_data);
    00341
    00342   //gst_plugin_name_filter is a C API convenience function which tells if a
    00343   //plugin has a given name so ignore it.
    00344
    00345
    00354 #ifdef GLIBMM_EXCEPTIONS_ENABLED
    00355   static Glib::RefPtr<Gst::Plugin> load_file(const Glib::ustring& filename);
    00356 #else
    00357   static Glib::RefPtr<Gst::Plugin> load_file(const Glib::ustring& filename, std::auto_ptr<Glib::Error>& error);
    00358 #endif //GLIBMM_EXCEPTIONS_ENABLED
    00359
    00360
    00373   Glib::RefPtr<Gst::Plugin> load();
    00374
    00379   static Glib::RefPtr<Gst::Plugin> load_by_name(const Glib::ustring& name);
    00380
    00381   // Don't wrap gst_plugin_list_free because Glib::ListHandle<> already takes
    00382   // care of freeing.
    00383
    00384
    00385   bool register_static(int major_version, int minor_version,
    00386     const Glib::ustring& name, const Glib::ustring& description,
    00387     const SlotInit& init_slot, const Glib::ustring& version,
    00388     const Glib::ustring& license, const Glib::ustring& source,
    00389     const Glib::ustring& package, const Glib::ustring& origin);
    00390
    00391
    00417   void add_dependency(const Glib::StringArrayHandle& env_vars,
    00418     const Glib::StringArrayHandle& paths,
    00419     const Glib::StringArrayHandle& names,
    00420     Gst::PluginDependencyFlags flags);
    00421
    00422
    00448   void add_dependency(const Glib::ustring& env_vars,
    00449     const Glib::ustring& paths,
    00450     const Glib::ustring& names,
    00451     Gst::PluginDependencyFlags flags);
    00452
    00453
    00454 public:
    00455
    00456 public:
    00457   //C++ methods used to invoke GTK+ virtual functions:
    00458 #ifdef GLIBMM_VFUNCS_ENABLED
    00459 #endif //GLIBMM_VFUNCS_ENABLED
    00460
    00461 protected:
    00462   //GTK+ Virtual Functions (override these to change behaviour):
    00463 #ifdef GLIBMM_VFUNCS_ENABLED
    00464 #endif //GLIBMM_VFUNCS_ENABLED
    00465
    00466   //Default Signal Handlers::
    00467 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00468 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
    00469
    00470
    00471 };
    00472
    00473 } // namespace Gst
    00474
    00475
    00476 namespace Glib
    00477 {
    00486   Glib::RefPtr<Gst::Plugin> wrap(GstPlugin* object, bool take_copy = false);
    00487 }
    00488
    00489
    00490 #endif /* _GSTREAMERMM_PLUGIN_H */
    00491