00001
00002
00003 #ifndef _GSTMM_PAD_H
00004 #define _GSTMM_PAD_H
00005
00006
00007 #include <glibmm.h>
00008
00009 #include <gstreamermm/object.h>
00010 #include <gstreamermm/enums.h>
00011
00012
00013 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00014 typedef struct _GstPad GstPad;
00015 typedef struct _GstPadClass GstPadClass;
00016 #endif
00017
00018
00019 namespace Gst
00020 { class Pad_Class; }
00021 namespace Gst
00022 {
00023
00024 class Caps;
00025 class Element;
00026 class PadTemplate;
00027
00028
00029 class Pad : public Object
00030 {
00031
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033
00034 public:
00035 typedef Pad CppObjectType;
00036 typedef Pad_Class CppClassType;
00037 typedef GstPad BaseObjectType;
00038 typedef GstPadClass BaseClassType;
00039
00040 private: friend class Pad_Class;
00041 static CppClassType pad_class_;
00042
00043 private:
00044
00045 Pad(const Pad&);
00046 Pad& operator=(const Pad&);
00047
00048 protected:
00049 explicit Pad(const Glib::ConstructParams& construct_params);
00050 explicit Pad(GstPad* castitem);
00051
00052 #endif
00053
00054 public:
00055 virtual ~Pad();
00056
00057 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00058 static GType get_type() G_GNUC_CONST;
00059 static GType get_base_type() G_GNUC_CONST;
00060 #endif
00061
00063 GstPad* gobj() { return reinterpret_cast<GstPad*>(gobject_); }
00064
00066 const GstPad* gobj() const { return reinterpret_cast<GstPad*>(gobject_); }
00067
00069 GstPad* gobj_copy();
00070
00071 private:
00072
00073
00074 protected:
00075 Pad();
00076
00077 public:
00078
00079 static Glib::RefPtr<Pad> create(const Glib::ustring& name, PadDirection direction);
00080
00081
00082 PadDirection get_direction() const;
00083
00084 Glib::RefPtr<Element> get_parent_element();
00085
00086 Glib::RefPtr<const Element> get_parent_element() const;
00087
00088 PadLinkReturn link(const Glib::RefPtr<Pad>& sink_pad);
00089
00090 bool unlink(const Glib::RefPtr<Pad>& sink_pad);
00091
00092 bool is_linked() const;
00093
00094 bool can_link(const Glib::RefPtr<Pad>& other_pad);
00095
00096 Glib::RefPtr<Caps> get_caps();
00097
00098 Glib::RefPtr<const Caps> get_caps() const;
00099
00100 Glib::RefPtr<Caps> get_allowed_caps();
00101
00102 Glib::RefPtr<const Caps> get_allowed_caps() const;
00103
00104 Glib::RefPtr<Caps> get_negotiated_caps();
00105
00106 Glib::RefPtr<const Caps> get_negotiated_caps() const;
00107
00108
00109 bool set_caps (const Glib::RefPtr<Caps>& caps);
00110
00111 Glib::RefPtr<Pad> get_peer();
00112
00113 Glib::RefPtr<const Pad> get_peer() const;
00114
00115 Glib::RefPtr<Caps> peer_get_caps();
00116
00117 Glib::RefPtr<const Caps> peer_get_caps() const;
00118
00119 void use_fixed_caps();
00120
00121 bool is_active() const;
00122
00123 bool set_blocked(bool blocked = true);
00124
00125 bool is_blocked() const;
00126
00127 bool is_blocking() const;
00128
00129
00130 void remove_data_probe(guint handler_id);
00131
00132 void remove_buffer_probe(guint handler_id);
00133
00134 void remove_event_probe(guint handler_id);
00135
00136
00137 bool accept_caps(const Glib::RefPtr<Caps>& caps);
00138
00139
00140 bool proxy_setcaps(const Glib::RefPtr<Caps>& caps);
00141
00142
00143 void fixate_caps(const Glib::RefPtr<Caps>& caps);
00144
00145
00146 bool peer_accept_caps(const Glib::RefPtr<Caps>& caps);
00147
00148
00149 bool check_pull_range() const;
00150
00151
00152 bool activate_pull(bool active = true);
00153
00154 bool activate_push(bool active = true);
00155
00156 bool query_position(Format& format) const;
00157
00158 bool query_position(Format& format, gint64& position) const;
00159 bool query_duration(Format& format) const;
00160
00161 bool query_duration(Format& format, gint64& duration) const;
00162 bool query_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const;
00163 bool query_peer_position(Format& format) const;
00164
00165 bool query_peer_position(Format& format, gint64& position) const;
00166 bool query_peer_duration(Format& format) const;
00167
00168 bool query_peer_duration(Format& format, gint64& duration) const;
00169
00170 bool query_peer_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const;
00171
00172
00173 bool pause_task() ;
00174
00175 bool stop_task() ;
00176
00177 bool set_active(bool active = true);
00178
00179
00180 typedef sigc::slot<void, bool> SlotPadBlockCallback;
00181
00182 bool set_blocked_async(bool blocked, const SlotPadBlockCallback& slot);
00183
00184
00185
00186
00192 Glib::SignalProxy1< void,const Glib::RefPtr<Pad>& > signal_linked();
00193
00194
00200 Glib::SignalProxy0< void > signal_request_link();
00201
00202
00208 Glib::SignalProxy1< void,const Glib::RefPtr<Pad>& > signal_unlinked();
00209
00210
00211 #ifdef GLIBMM_PROPERTIES_ENABLED
00212
00218 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Caps> > property_caps() const;
00219 #endif //#GLIBMM_PROPERTIES_ENABLED
00220
00221
00222 #ifdef GLIBMM_PROPERTIES_ENABLED
00223
00229 Glib::PropertyProxy_ReadOnly<PadDirection> property_direction() const;
00230 #endif //#GLIBMM_PROPERTIES_ENABLED
00231
00232
00233 #ifdef GLIBMM_PROPERTIES_ENABLED
00234
00240 Glib::PropertyProxy<PadTemplate> property_template() ;
00241 #endif //#GLIBMM_PROPERTIES_ENABLED
00242
00243 #ifdef GLIBMM_PROPERTIES_ENABLED
00244
00250 Glib::PropertyProxy_ReadOnly<PadTemplate> property_template() const;
00251 #endif //#GLIBMM_PROPERTIES_ENABLED
00252
00253
00254 public:
00255
00256 public:
00257
00258 #ifdef GLIBMM_VFUNCS_ENABLED
00259 #endif //GLIBMM_VFUNCS_ENABLED
00260
00261 protected:
00262
00263 #ifdef GLIBMM_VFUNCS_ENABLED
00264 #endif //GLIBMM_VFUNCS_ENABLED
00265
00266
00267 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00268 virtual void on_linked(const Glib::RefPtr<Pad>& peer_pad);
00269 virtual void on_request_link();
00270 virtual void on_unlinked(const Glib::RefPtr<Pad>& peer_pad);
00271 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00272
00273
00274 };
00275
00276 }
00277
00278
00279 namespace Glib
00280 {
00289 Glib::RefPtr<Gst::Pad> wrap(GstPad* object, bool take_copy = false);
00290 }
00291
00292
00293 #endif
00294