00001
00002
00003 #ifndef _GSTMM_ELEMENT_H
00004 #define _GSTMM_ELEMENT_H
00005
00006
00007 #include <glibmm.h>
00008
00009 #include <gstreamermm/object.h>
00010 #include <gstreamermm/clock.h>
00011 #include <gstreamermm/enums.h>
00012
00013
00014 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00015 typedef struct _GstElement GstElement;
00016 typedef struct _GstElementClass GstElementClass;
00017 #endif
00018
00019
00020 namespace Gst
00021 { class Element_Class; }
00022 namespace Gst
00023 {
00024
00025 class Bus;
00026 class Caps;
00027 class Clock;
00028 class Event;
00029 class Message;
00030 class Pad;
00031 class PadTemplate;
00032 class Query;
00033
00034
00035 class Element : public Object
00036 {
00037
00038 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00039
00040 public:
00041 typedef Element CppObjectType;
00042 typedef Element_Class CppClassType;
00043 typedef GstElement BaseObjectType;
00044 typedef GstElementClass BaseClassType;
00045
00046 private: friend class Element_Class;
00047 static CppClassType element_class_;
00048
00049 private:
00050
00051 Element(const Element&);
00052 Element& operator=(const Element&);
00053
00054 protected:
00055 explicit Element(const Glib::ConstructParams& construct_params);
00056 explicit Element(GstElement* castitem);
00057
00058 #endif
00059
00060 public:
00061 virtual ~Element();
00062
00063 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00064 static GType get_type() G_GNUC_CONST;
00065 static GType get_base_type() G_GNUC_CONST;
00066 #endif
00067
00069 GstElement* gobj() { return reinterpret_cast<GstElement*>(gobject_); }
00070
00072 const GstElement* gobj() const { return reinterpret_cast<GstElement*>(gobject_); }
00073
00075 GstElement* gobj_copy();
00076
00077 private:
00078
00079
00080 protected:
00081
00082 Element();
00083
00084 public:
00085 static Glib::RefPtr<Element> create(const Glib::ustring& factoryname, const Glib::ustring& name);
00086 Glib::RefPtr<Element> link(const Glib::RefPtr<Element>& other_element);
00087
00088 bool add_pad(const Glib::RefPtr<Pad>& pad);
00089
00090 Glib::RefPtr<Pad> get_pad(const Glib::ustring& name);
00091
00092 void create_all_pads();
00093
00094
00095 Glib::RefPtr<Pad> get_compatible_pad(const Glib::RefPtr<Pad>& pad, const Glib::RefPtr<Caps>& caps);
00096 Glib::RefPtr<PadTemplate> get_compatible_pad_template(const Glib::RefPtr<PadTemplate>& padtemplate);
00097
00098
00099 Glib::RefPtr<Pad> get_request_pad(const Glib::ustring& name);
00100
00101 Glib::RefPtr<Pad> get_static_pad(const Glib::ustring& name);
00102
00103 void no_more_pads();
00104
00105 void release_request_pad(const Glib::RefPtr<Pad>& pad);
00106
00107 bool remove_pad(const Glib::RefPtr<Pad>& pad);
00108
00109
00110 void unlink(const Glib::RefPtr<Element>& other_element);
00111
00112
00113 bool link_pads(const Glib::ustring& padname, const Glib::RefPtr<Element>& other_element, const Glib::ustring& others_padname);
00114
00115
00116 void unlink_pads(const Glib::ustring& padname, const Glib::RefPtr<Element>& other_element, const Glib::ustring& other_padname);
00117
00118
00119
00120 bool link_pads_filtered(const char* padname, const Glib::RefPtr<Element>& other_element, const char* others_padname, const Glib::RefPtr<Caps>& filter);
00121
00122
00123 bool link_filtered(const Glib::RefPtr<Element>& other_element, const Glib::RefPtr<Caps>& filter);
00124
00125 void set_base_time(ClockTime time);
00126
00127 ClockTime get_base_time() const;
00128
00129 void set_bus(const Glib::RefPtr<Bus>& bus);
00130
00131 Glib::RefPtr<Bus> get_bus();
00132
00133 Glib::RefPtr<const Bus> get_bus() const;
00134
00135
00136 bool is_indexable() const;
00137
00138 bool requires_clock() const;
00139
00140 bool set_clock(const Glib::RefPtr<Clock>& clock);
00141
00142 Glib::RefPtr<Clock> get_clock();
00143
00144 Glib::RefPtr<const Clock> get_clock() const;
00145
00146 bool provides_clock() const;
00147
00148 Glib::RefPtr<Clock> provide_clock();
00149
00150 Glib::RefPtr<const Clock> provide_clock() const;
00151
00152 StateChangeReturn set_state(State state);
00153
00154 StateChangeReturn get_state(State& state, State& pending, ClockTime timeout) const;
00155
00156 bool set_locked_state(gboolean locked_state);
00157
00158 bool is_locked_state() const;
00159
00160 void abort_state();
00161
00162 StateChangeReturn continue_state(StateChangeReturn prestate_value);
00163
00164 void lost_state();
00165
00166 bool sync_state_with_parent();
00167
00168 StateChangeReturn change_state(StateChange transition);
00169
00170
00171 bool post_message(const Glib::RefPtr<Message>& message);
00172
00173
00174 bool query(const Glib::RefPtr<Query>& query);
00175
00176 bool query_convert(Format src_format, gint64 src_value, Format& dst_format, gint64& dst_value) const;
00177
00178 bool query_position(Format& format, gint64& position) const;
00179
00180 bool query_duration(Format& format, gint64& duration) const;
00181
00182 bool query_position(Format& format) const;
00183 bool query_duration(Format& format) const;
00184
00185
00186 bool seek(Format format, SeekFlags flags, gint64 position);
00187
00188 bool seek(double rate, Format format, SeekFlags flags, SeekType current_type, gint64 current_position, SeekType stop_type, gint64 stop_position);
00189
00190 bool send_event(const Glib::RefPtr<Event>& event);
00191
00192
00198 Glib::SignalProxy0< void > signal_no_more_pads();
00199
00200
00206 Glib::SignalProxy1< void,const Glib::RefPtr<Pad>& > signal_pad_added();
00207
00208
00214 Glib::SignalProxy1< void,const Glib::RefPtr<Pad>& > signal_pad_removed();
00215
00216
00217 public:
00218
00219 public:
00220
00221 #ifdef GLIBMM_VFUNCS_ENABLED
00222 #endif //GLIBMM_VFUNCS_ENABLED
00223
00224 protected:
00225
00226 #ifdef GLIBMM_VFUNCS_ENABLED
00227 #endif //GLIBMM_VFUNCS_ENABLED
00228
00229
00230 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00231 virtual void on_no_more_pads();
00232 virtual void on_pad_added(const Glib::RefPtr<Pad>& new_pad);
00233 virtual void on_pad_removed(const Glib::RefPtr<Pad>& old_pad);
00234 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00235
00236
00237 };
00238
00239 }
00240
00241
00242 namespace Glib
00243 {
00252 Glib::RefPtr<Gst::Element> wrap(GstElement* object, bool take_copy = false);
00253 }
00254
00255
00256 #endif
00257