00001
00002
00003 #ifndef _GSTREAMERMM_BIN_H
00004 #define _GSTREAMERMM_BIN_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 <gstreamermm/element.h>
00031 #include <gstreamermm/childproxy.h>
00032 #include <gstreamermm/pad.h>
00033 #include <stdexcept>
00034
00035
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 typedef struct _GstBin GstBin;
00038 typedef struct _GstBinClass GstBinClass;
00039 #endif
00040
00041
00042 namespace Gst
00043 { class Bin_Class; }
00044 namespace Gst
00045 {
00046
00047 class Pad;
00048
00049
00050 template <class CppType>
00051 class Iterator;
00052
00143 class Bin
00144 : public Element,
00145 public ChildProxy
00146 {
00147
00148 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00149
00150 public:
00151 typedef Bin CppObjectType;
00152 typedef Bin_Class CppClassType;
00153 typedef GstBin BaseObjectType;
00154 typedef GstBinClass BaseClassType;
00155
00156 private: friend class Bin_Class;
00157 static CppClassType bin_class_;
00158
00159 private:
00160
00161 Bin(const Bin&);
00162 Bin& operator=(const Bin&);
00163
00164 protected:
00165 explicit Bin(const Glib::ConstructParams& construct_params);
00166 explicit Bin(GstBin* castitem);
00167
00168 #endif
00169
00170 public:
00171 virtual ~Bin();
00172
00173 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00174 static GType get_type() G_GNUC_CONST;
00175 static GType get_base_type() G_GNUC_CONST;
00176 #endif
00177
00179 GstBin* gobj() { return reinterpret_cast<GstBin*>(gobject_); }
00180
00182 const GstBin* gobj() const { return reinterpret_cast<GstBin*>(gobject_); }
00183
00185 GstBin* gobj_copy();
00186
00187 private:
00188
00189
00190 protected:
00191 explicit Bin(const Glib::ustring& name);
00192 Bin();
00193
00194 public:
00201 static Glib::RefPtr<Bin> create(const Glib::ustring& name);
00202
00203
00209 static Glib::RefPtr<Bin> create();
00210
00211
00226 Glib::RefPtr<Gst::Bin> add(const Glib::RefPtr<Gst::Element>& element);
00227
00228
00243 Glib::RefPtr<Gst::Bin> remove(const Glib::RefPtr<Gst::Element>& element);
00244
00245
00246
00247
00248
00249
00257 Glib::RefPtr<Gst::Element> get_element(const Glib::ustring& name);
00258
00266 Glib::RefPtr<const Gst::Element> get_element(const Glib::ustring& name) const;
00267
00268
00276 Glib::RefPtr<Gst::Element> get_element_recurse_up(const Glib::ustring& name);
00277
00285 Glib::RefPtr<const Gst::Element> get_element_recurse_up(const Glib::ustring& name) const;
00286
00287
00298 Glib::RefPtr<Gst::Element> get_element(GType interface);
00299
00310 Glib::RefPtr<const Gst::Element> get_element(GType interface) const;
00311
00312
00323 Glib::RefPtr<Gst::Pad> find_unlinked_pad(PadDirection dir);
00324
00335 Glib::RefPtr<const Gst::Pad> find_unlinked_pad(PadDirection dir) const;
00336
00337
00346 Gst::Iterator<Gst::Element> iterate_elements();
00347
00357 Gst::Iterator<Gst::Element> iterate_recurse();
00358
00372 Gst::Iterator<Gst::Element> iterate_sorted();
00373
00383 Gst::Iterator<Gst::Element> iterate_sources();
00384
00394 Gst::Iterator<Gst::Element> iterate_sinks();
00395
00409 Gst::Iterator<Gst::Element> iterate_by_interface(GType iface);
00410
00411
00414 Glib::ListHandle< Glib::RefPtr<Gst::Element> > get_children() const;
00415
00418 int get_num_children() const;
00419
00420
00427 Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Element>& > signal_element_added();
00428
00429
00436 Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Element>& > signal_element_removed();
00437
00438
00439 #ifdef GLIBMM_PROPERTIES_ENABLED
00440
00446 Glib::PropertyProxy<bool> property_async_handling() ;
00447 #endif //#GLIBMM_PROPERTIES_ENABLED
00448
00449 #ifdef GLIBMM_PROPERTIES_ENABLED
00450
00456 Glib::PropertyProxy_ReadOnly<bool> property_async_handling() const;
00457 #endif //#GLIBMM_PROPERTIES_ENABLED
00458
00459
00462 #ifdef GLIBMM_VFUNCS_ENABLED
00463 virtual bool add_element_vfunc(const Glib::RefPtr<Gst::Element>& element);
00464 #endif //GLIBMM_VFUNCS_ENABLED
00465
00466
00469 #ifdef GLIBMM_VFUNCS_ENABLED
00470 virtual bool remove_element_vfunc(const Glib::RefPtr<Gst::Element>& element);
00471 #endif //GLIBMM_VFUNCS_ENABLED
00472
00473
00476 #ifdef GLIBMM_VFUNCS_ENABLED
00477 virtual void handle_message_vfunc(const Glib::RefPtr<Gst::Message>& message);
00478 #endif //GLIBMM_VFUNCS_ENABLED
00479
00480
00481 public:
00482
00483 public:
00484
00485 #ifdef GLIBMM_VFUNCS_ENABLED
00486 #endif //GLIBMM_VFUNCS_ENABLED
00487
00488 protected:
00489
00490 #ifdef GLIBMM_VFUNCS_ENABLED
00491 #endif //GLIBMM_VFUNCS_ENABLED
00492
00493
00494 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00495 virtual void on_element_added(const Glib::RefPtr<Gst::Element>& element);
00496 virtual void on_element_removed(const Glib::RefPtr<Gst::Element>& element);
00497 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00498
00499
00500 };
00501
00502 }
00503
00504
00505 namespace Glib
00506 {
00515 Glib::RefPtr<Gst::Bin> wrap(GstBin* object, bool take_copy = false);
00516 }
00517
00518
00519 #endif
00520