00001
00002
00003 #ifndef _GSTMM_EVENT_H
00004 #define _GSTMM_EVENT_H
00005
00006
00007 #include <glibmm.h>
00008
00009 #include <gstreamermm/miniobject.h>
00010 #include <gstreamermm/structure.h>
00011 #include <gstreamermm/wrap.h>
00012
00013
00014 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00015 typedef struct _GstEvent GstEvent;
00016 typedef struct _GstEventClass GstEventClass;
00017 #endif
00018
00019
00020 namespace Gst
00021 { class Event_Class; }
00022 namespace Gst
00023 {
00024
00025
00026 class Event : public MiniObject
00027 {
00028 protected:
00029
00030 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00031
00032 public:
00033 typedef Event CppObjectType;
00034 typedef Event_Class CppClassType;
00035 typedef GstEvent BaseObjectType;
00036 typedef GstEventClass BaseClassType;
00037
00038 private: friend class Event_Class;
00039 static CppClassType event_class_;
00040
00041 private:
00042
00043 Event(const Event&);
00044 Event& operator=(const Event&);
00045
00046 protected:
00047 explicit Event(GstEvent* castitem);
00048
00049 #endif
00050
00051 public:
00052 virtual ~Event();
00053
00054 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00055 static GType get_type() G_GNUC_CONST;
00056 static GType get_base_type() G_GNUC_CONST;
00057 #endif
00058
00060 GstEvent* gobj() { return reinterpret_cast<GstEvent*>(gobject_); }
00061
00063 const GstEvent* gobj() const { return reinterpret_cast<GstEvent*>(gobject_); }
00064
00066 GstEvent* gobj_copy();
00067
00068 private:
00069
00070
00071 public:
00072 const Structure& get_structure();
00073
00074 public:
00075 EventType get_event_type() const;
00076 ClockTime get_timestamp() const;
00077 Glib::RefPtr<Gst::Object> get_source() const;
00078
00084 static Glib::RefPtr<Event> wrap(GstEvent* event, bool take_copy=false);
00085
00086 bool is_downstream() const;
00087 bool is_upstream() const;
00088 bool is_serialized() const;
00089
00090 protected:
00091 Structure structure_;
00092
00093
00094 public:
00095
00096 public:
00097
00098 #ifdef GLIBMM_VFUNCS_ENABLED
00099 #endif //GLIBMM_VFUNCS_ENABLED
00100
00101 protected:
00102
00103 #ifdef GLIBMM_VFUNCS_ENABLED
00104 #endif //GLIBMM_VFUNCS_ENABLED
00105
00106
00107 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00108 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00109
00110
00111 };
00112
00113 class EventBufferSize : public Event
00114 {
00115 public:
00116 explicit EventBufferSize(GstEvent* event);
00117
00118 static Glib::RefPtr<Event> create(Format format, gint64 minsize, gint64 maxsize, bool async);
00119 void parse(Format& format, gint64& minsize, gint64& maxsize, bool& async);
00120 };
00121
00122 class EventCustom : public Event
00123 {
00124 public:
00125 explicit EventCustom(GstEvent* event);
00126
00127 static Glib::RefPtr<Event> create(EventType type, Structure& structure);
00128 };
00129
00130 class EventEos : public Event
00131 {
00132 public:
00133 explicit EventEos(GstEvent* event);
00134
00135 static Glib::RefPtr<Event> create();
00136 };
00137
00138 class EventFlushStart : public Event
00139 {
00140 public:
00141 explicit EventFlushStart(GstEvent* event);
00142
00143 static Glib::RefPtr<Event> create();
00144 };
00145
00146 class EventFlushStop : public Event
00147 {
00148 public:
00149 explicit EventFlushStop(GstEvent* event);
00150
00151 static Glib::RefPtr<Event> create();
00152 };
00153
00154 class EventLatency : public Event
00155 {
00156 public:
00157 explicit EventLatency(GstEvent* event);
00158
00159 static Glib::RefPtr<Event> create(ClockTime time);
00160 void parse(ClockTime& latency);
00161 };
00162
00163 class EventNavigation : public Event
00164 {
00165 public:
00166 explicit EventNavigation(GstEvent* event);
00167
00168 static Glib::RefPtr<Event> create(Structure& structure);
00169 };
00170
00171 class EventNewSegment : public Event
00172 {
00173 public:
00174 explicit EventNewSegment(GstEvent* event);
00175
00176 static Glib::RefPtr<Event> create(bool update, double rate, Format format, gint64 strat, gint64 stop, gint64 position, double applied_rate=1.0);
00177 void parse(bool& update, double& rate, Format& format, gint64& start, gint64& stop, gint64& position);
00178 void parse(bool& update, double& rate, Format& format, gint64& start, gint64& stop, gint64& position, double& applied_rate);
00179 };
00180
00181 class EventQos : public Event
00182 {
00183 public:
00184 explicit EventQos(GstEvent* event);
00185
00186 static Glib::RefPtr<Event> create(double proportion, ClockTimeDiff diff, ClockTime timestamp);
00187 void parse(double& proportion, ClockTimeDiff& diff, ClockTime& timestamp);
00188 };
00189
00190 class EventSeek : public Event
00191 {
00192 public:
00193 explicit EventSeek(GstEvent* event);
00194
00195 static Glib::RefPtr<Event> create(double rate, Format format, SeekFlags flags, SeekType start_type, gint64 start, SeekType stop_type, gint64 stop);
00196 void parse(double& rate, Format& format, SeekFlags& flags, SeekType& start_type, gint64& start, SeekType& stop_type, gint64& stop);
00197 };
00198
00199 class EventTag : public Event
00200 {
00201 public:
00202 explicit EventTag(GstEvent* event);
00203
00204
00205
00206 };
00207
00208 }
00209
00210
00211 namespace Gst
00212 {
00218 Glib::RefPtr<Gst::Event> wrap(GstEvent* object, bool take_copy = false);
00219 }
00220
00221
00222 #endif
00223