00001
00002
00003 #ifndef _GSTREAMERMM_INTERFACE_H
00004 #define _GSTREAMERMM_INTERFACE_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 #include <glibmm/interface.h>
00029 #include <gstreamermm/element.h>
00030
00031
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 typedef struct _GstImplementsInterface GstImplementsInterface;
00034 typedef struct _GstImplementsInterfaceClass GstImplementsInterfaceClass;
00035 #endif
00036
00037
00038 namespace Gst
00039 { class Interface_Class; }
00040 namespace Gst
00041 {
00042
00050 class Interface : public Glib::Interface
00051 {
00052
00053 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00054
00055 public:
00056 typedef Interface CppObjectType;
00057 typedef Interface_Class CppClassType;
00058 typedef GstImplementsInterface BaseObjectType;
00059 typedef GstImplementsInterfaceClass BaseClassType;
00060
00061 private:
00062 friend class Interface_Class;
00063 static CppClassType interface_class_;
00064
00065
00066 Interface(const Interface&);
00067 Interface& operator=(const Interface&);
00068
00069 protected:
00070 Interface();
00071
00078 explicit Interface(const Glib::Interface_Class& interface_class);
00079
00080 public:
00081
00082
00083
00084 explicit Interface(GstImplementsInterface* castitem);
00085
00086 protected:
00087 #endif
00088
00089 public:
00090 virtual ~Interface();
00091
00092 static void add_interface(GType gtype_implementer);
00093
00094 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00095 static GType get_type() G_GNUC_CONST;
00096 static GType get_base_type() G_GNUC_CONST;
00097 #endif
00098
00100 GstImplementsInterface* gobj() { return reinterpret_cast<GstImplementsInterface*>(gobject_); }
00101
00103 const GstImplementsInterface* gobj() const { return reinterpret_cast<GstImplementsInterface*>(gobject_); }
00104
00105 private:
00106
00107
00108 public:
00109
00115 static bool element_implements(const Glib::RefPtr<const Gst::Element>&element, GType iface_type);
00116
00120 template <class T_CastTo>
00121 static Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >
00122 cast(const Glib::RefPtr<Gst::Element>& element);
00123
00126 #ifdef GLIBMM_VFUNCS_ENABLED
00127 virtual bool supported_vfunc(GType iface_type);
00128 #endif //GLIBMM_VFUNCS_ENABLED
00129
00130
00131
00132
00133
00134
00135 public:
00136
00137 public:
00138
00139 #ifdef GLIBMM_VFUNCS_ENABLED
00140 #endif //GLIBMM_VFUNCS_ENABLED
00141
00142 protected:
00143
00144 #ifdef GLIBMM_VFUNCS_ENABLED
00145 #endif //GLIBMM_VFUNCS_ENABLED
00146
00147
00148 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00149 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00150
00151
00152 };
00153
00154 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00155
00156 template <class T_CastTo>
00157 Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> > Interface::cast(const Glib::RefPtr<Gst::Element>& element)
00158 {
00159 if (element && gst_element_implements_interface(element->gobj(), T_CastTo::get_type()))
00160 {
00161 void* result =
00162 gst_implements_interface_cast(element->gobj(), T_CastTo::get_type());
00163
00164 Gst::ElementInterfaced<T_CastTo>* element_interfaced =
00165 new ElementInterfaced<T_CastTo>((GstElement*) result);
00166
00167 return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(element_interfaced);
00168 }
00169 else
00170 return Glib::RefPtr< Gst::ElementInterfaced<T_CastTo> >(0);
00171 }
00172
00173 #endif
00174
00175 }
00176
00177
00178 namespace Glib
00179 {
00188 Glib::RefPtr<Gst::Interface> wrap(GstImplementsInterface* object, bool take_copy = false);
00189
00190 }
00191
00192
00193 #endif
00194