00001
00002
00003 #ifndef _GSTREAMERMM_PLUGIN_H
00004 #define _GSTREAMERMM_PLUGIN_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <gst/gstplugin.h>
00031 #include <gstreamermm/object.h>
00032
00033
00034 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00035 typedef struct _GstPlugin GstPlugin;
00036 typedef struct _GstPluginClass GstPluginClass;
00037 #endif
00038
00039
00040 namespace Gst
00041 { class Plugin_Class; }
00042 namespace Gst
00043 {
00044
00051 class PluginError : public Glib::Error
00052 {
00053 public:
00054 enum Code
00055 {
00056 MODULE,
00057 DEPENDENCIES,
00058 NAME_MISMATCH
00059 };
00060
00061 PluginError(Code error_code, const Glib::ustring& error_message);
00062 explicit PluginError(GError* gobject);
00063 Code code() const;
00064
00065 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00066 private:
00067
00068 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00069 static void throw_func(GError* gobject);
00070 #else
00071
00072 static std::auto_ptr<Glib::Error> throw_func(GError* gobject);
00073 #endif //GLIBMM_EXCEPTIONS_ENABLED
00074
00075 friend void wrap_init();
00076 #endif
00077 };
00078
00079 }
00080
00081 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00082 namespace Glib
00083 {
00084
00085 template <>
00086 class Value<Gst::PluginError::Code> : public Glib::Value_Enum<Gst::PluginError::Code>
00087 {
00088 public:
00089 static GType value_type() G_GNUC_CONST;
00090 };
00091
00092 }
00093 #endif
00094
00095
00096 namespace Gst
00097 {
00098
00099
00122 class Plugin : public Object
00123 {
00124
00125 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00126
00127 public:
00128 typedef Plugin CppObjectType;
00129 typedef Plugin_Class CppClassType;
00130 typedef GstPlugin BaseObjectType;
00131 typedef GstPluginClass BaseClassType;
00132
00133 private: friend class Plugin_Class;
00134 static CppClassType plugin_class_;
00135
00136 private:
00137
00138 Plugin(const Plugin&);
00139 Plugin& operator=(const Plugin&);
00140
00141 protected:
00142 explicit Plugin(const Glib::ConstructParams& construct_params);
00143 explicit Plugin(GstPlugin* castitem);
00144
00145 #endif
00146
00147 public:
00148 virtual ~Plugin();
00149
00150 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00151 static GType get_type() G_GNUC_CONST;
00152 static GType get_base_type() G_GNUC_CONST;
00153 #endif
00154
00156 GstPlugin* gobj() { return reinterpret_cast<GstPlugin*>(gobject_); }
00157
00159 const GstPlugin* gobj() const { return reinterpret_cast<GstPlugin*>(gobject_); }
00160
00162 GstPlugin* gobj_copy();
00163
00164 private:
00165
00166
00167 public:
00173 typedef sigc::slot< bool, const Glib::RefPtr<Gst::Plugin>& > SlotInit;
00174
00180 typedef sigc::slot< bool, const Glib::RefPtr<Gst::Plugin>& > SlotFilter;
00181
00182
00183 static Glib::QueryQuark error_quark();
00184
00188 Glib::ustring get_name() const;
00189
00193 Glib::ustring get_description() const;
00194
00198 Glib::ustring get_filename() const;
00199
00203 Glib::ustring get_license() const;
00204
00208 Glib::ustring get_package() const;
00209
00213 Glib::ustring get_origin() const;
00214
00218 Glib::ustring get_source() const;
00219
00223 Glib::ustring get_version() const;
00224
00225
00231 GModule* get_module() const;
00232
00233
00237 bool is_loaded() const;
00238
00247 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00248 static Glib::RefPtr<Gst::Plugin> load_file(const Glib::ustring& filename);
00249 #else
00250 static Glib::RefPtr<Gst::Plugin> load_file(const Glib::ustring& filename, std::auto_ptr<Glib::Error>& error);
00251 #endif //GLIBMM_EXCEPTIONS_ENABLED
00252
00253
00266 Glib::RefPtr<Gst::Plugin> load();
00267
00272 static Glib::RefPtr<Gst::Plugin> load_by_name(const Glib::ustring& name);
00273
00274
00278 static void free(Glib::ListHandle< Glib::RefPtr<Gst::Plugin> >);
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293 public:
00294
00295 public:
00296
00297 #ifdef GLIBMM_VFUNCS_ENABLED
00298 #endif //GLIBMM_VFUNCS_ENABLED
00299
00300 protected:
00301
00302 #ifdef GLIBMM_VFUNCS_ENABLED
00303 #endif //GLIBMM_VFUNCS_ENABLED
00304
00305
00306 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00307 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00308
00309
00310 };
00311
00312 }
00313
00314
00315 namespace Glib
00316 {
00325 Glib::RefPtr<Gst::Plugin> wrap(GstPlugin* object, bool take_copy = false);
00326 }
00327
00328
00329 #endif
00330