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 #include <gstreamermm/element.h>
00029 #include <gstreamermm/childproxy.h>
00030 #include <gstreamermm/pad.h>
00031
00032
00033 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00034 typedef struct _GstBin GstBin;
00035 typedef struct _GstBinClass GstBinClass;
00036 #endif
00037
00038
00039 namespace Gst
00040 { class Bin_Class; }
00041 namespace Gst
00042 {
00043
00044 class Pad;
00045 class GhostPad;
00046
00047
00048 template <class CppType>
00049 class Iterator;
00050
00142 class Bin
00143 : public Element,
00144 public ChildProxy
00145 {
00146
00147 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00148
00149 public:
00150 typedef Bin CppObjectType;
00151 typedef Bin_Class CppClassType;
00152 typedef GstBin BaseObjectType;
00153 typedef GstBinClass BaseClassType;
00154
00155 private: friend class Bin_Class;
00156 static CppClassType bin_class_;
00157
00158 private:
00159
00160 Bin(const Bin&);
00161 Bin& operator=(const Bin&);
00162
00163 protected:
00164 explicit Bin(const Glib::ConstructParams& construct_params);
00165 explicit Bin(GstBin* castitem);
00166
00167 #endif
00168
00169 public:
00170 virtual ~Bin();
00171
00172 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00173 static GType get_type() G_GNUC_CONST;
00174
00175
00176 static GType get_base_type() G_GNUC_CONST;
00177 #endif
00178
00180 GstBin* gobj() { return reinterpret_cast<GstBin*>(gobject_); }
00181
00183 const GstBin* gobj() const { return reinterpret_cast<GstBin*>(gobject_); }
00184
00186 GstBin* gobj_copy();
00187
00188 private:
00189
00190
00191 protected:
00192 explicit Bin(const Glib::ustring& name);
00193 Bin();
00194
00195 public:
00202 static Glib::RefPtr<Bin> create(const Glib::ustring& name);
00203
00204
00210 static Glib::RefPtr<Bin> create();
00211
00212
00227 Glib::RefPtr<Gst::Bin> add(const Glib::RefPtr<Gst::Element>& element);
00228
00229
00245 Glib::RefPtr<Gst::Bin> remove(const Glib::RefPtr<Gst::Element>& element);
00246
00247
00248
00249
00250
00251
00259 Glib::RefPtr<Gst::Element> get_element(const Glib::ustring& name);
00260
00268 Glib::RefPtr<const Gst::Element> get_element(const Glib::ustring& name) const;
00269
00270
00278 Glib::RefPtr<Gst::Element> get_element_recurse_up(const Glib::ustring& name);
00279
00287 Glib::RefPtr<const Gst::Element> get_element_recurse_up(const Glib::ustring& name) const;
00288
00289
00300 Glib::RefPtr<Gst::Element> get_element(GType interface);
00301
00312 Glib::RefPtr<const Gst::Element> get_element(GType interface) const;
00313
00320 Glib::RefPtr<Gst::GhostPad> add_ghost_pad(const Glib::RefPtr<Gst::Element>&
00321 element, const Glib::ustring& pad_name, const Glib::ustring& name =
00322 Glib::ustring());
00323
00324
00335 Glib::RefPtr<Gst::Pad> find_unlinked_pad(PadDirection dir);
00336
00347 Glib::RefPtr<const Gst::Pad> find_unlinked_pad(PadDirection dir) const;
00348
00349
00358 Gst::Iterator<Gst::Element> iterate_elements();
00359
00368 Gst::Iterator<const Gst::Element> iterate_elements() const;
00369
00379 Gst::Iterator<Gst::Element> iterate_recurse();
00380
00390 Gst::Iterator<const Gst::Element> iterate_recurse() const;
00391
00405 Gst::Iterator<Gst::Element> iterate_sorted();
00406
00420 Gst::Iterator<const Gst::Element> iterate_sorted() const;
00421
00431 Gst::Iterator<Gst::Element> iterate_sources();
00432
00442 Gst::Iterator<const Gst::Element> iterate_sources() const;
00443
00453 Gst::Iterator<Gst::Element> iterate_sinks();
00454
00464 Gst::Iterator<const Gst::Element> iterate_sinks() const;
00465
00479 Gst::Iterator<Gst::Element> iterate_by_interface(GType iface);
00480
00494 Gst::Iterator<const Gst::Element> iterate_by_interface(GType iface) const;
00495
00496
00509 bool recalculate_latency();
00510
00511
00514 Glib::ListHandle< Glib::RefPtr<Gst::Element> > get_children() const;
00515
00518 int get_num_children() const;
00519
00520
00527 Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Element>& > signal_element_added();
00528
00529
00536 Glib::SignalProxy1< void,const Glib::RefPtr<Gst::Element>& > signal_element_removed();
00537
00538
00539
00540
00546 Glib::SignalProxy0< bool > signal_do_latency();
00547
00548
00549 #ifdef GLIBMM_PROPERTIES_ENABLED
00550
00556 Glib::PropertyProxy<bool> property_async_handling() ;
00557 #endif //#GLIBMM_PROPERTIES_ENABLED
00558
00559 #ifdef GLIBMM_PROPERTIES_ENABLED
00560
00566 Glib::PropertyProxy_ReadOnly<bool> property_async_handling() const;
00567 #endif //#GLIBMM_PROPERTIES_ENABLED
00568
00569
00572 #ifdef GLIBMM_VFUNCS_ENABLED
00573 virtual bool add_element_vfunc(const Glib::RefPtr<Gst::Element>& element);
00574 #endif //GLIBMM_VFUNCS_ENABLED
00575
00576
00579 #ifdef GLIBMM_VFUNCS_ENABLED
00580 virtual bool remove_element_vfunc(const Glib::RefPtr<Gst::Element>& element);
00581 #endif //GLIBMM_VFUNCS_ENABLED
00582
00583
00586 #ifdef GLIBMM_VFUNCS_ENABLED
00587 virtual void handle_message_vfunc(const Glib::RefPtr<Gst::Message>& message);
00588 #endif //GLIBMM_VFUNCS_ENABLED
00589
00590
00591 private:
00592 void handle_error(const Glib::ustring& message);
00593
00594
00595 public:
00596
00597 public:
00598
00599 #ifdef GLIBMM_VFUNCS_ENABLED
00600 #endif //GLIBMM_VFUNCS_ENABLED
00601
00602 protected:
00603
00604 #ifdef GLIBMM_VFUNCS_ENABLED
00605 #endif //GLIBMM_VFUNCS_ENABLED
00606
00607
00608 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00609 virtual void on_element_added(const Glib::RefPtr<Gst::Element>& element);
00610 virtual void on_element_removed(const Glib::RefPtr<Gst::Element>& element);
00611 virtual bool on_do_latency();
00612 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00613
00614
00615 };
00616
00617 }
00618
00619
00620 namespace Glib
00621 {
00630 Glib::RefPtr<Gst::Bin> wrap(GstBin* object, bool take_copy = false);
00631 }
00632
00633
00634 #endif
00635