QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
event.h
00001 /*
00002     Copyright (C) 2010  Collabora Multimedia.
00003       @author Mauricio Piacentini <mauricio.piacentini@collabora.co.uk>
00004 
00005     This library is free software; you can redistribute it and/or modify
00006     it under the terms of the GNU Lesser General Public License as published
00007     by the Free Software Foundation; either version 2.1 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 #ifndef QGST_EVENT_H
00019 #define QGST_EVENT_H
00020 
00021 #include "miniobject.h"
00022 #include "structure.h"
00023 #include "clocktime.h"
00024 #include "taglist.h"
00025 
00026 namespace QGst {
00027 
00055 class QTGSTREAMER_EXPORT Event : public MiniObject
00056 {
00057     QGST_WRAPPER(Event)
00058 public:
00059     ObjectPtr source() const;
00060     quint64 timestamp() const;
00061     EventType type() const;
00062     QString typeName() const;
00063 
00064     StructurePtr internalStructure();
00065 
00066     quint32 sequenceNumber() const;
00067     void setSequenceNumber(quint32 num);
00068 
00069     EventPtr copy() const;
00070 
00071 };
00072 
00076 class QTGSTREAMER_EXPORT FlushStartEvent : public Event
00077 {
00078     QGST_WRAPPER_FAKE_SUBCLASS(FlushStart, Event)
00079 public:
00080     static FlushStartEventPtr create();
00081 };
00082 
00086 class QTGSTREAMER_EXPORT FlushStopEvent : public Event
00087 {
00088     QGST_WRAPPER_FAKE_SUBCLASS(FlushStop, Event)
00089 public:
00090     static FlushStopEventPtr create();
00091 };
00092 
00096 class QTGSTREAMER_EXPORT EosEvent : public Event
00097 {
00098     QGST_WRAPPER_FAKE_SUBCLASS(Eos, Event)
00099 public:
00100     static EosEventPtr create();
00101 };
00102 
00106 class QTGSTREAMER_EXPORT NewSegmentEvent : public Event
00107 {
00108     QGST_WRAPPER_FAKE_SUBCLASS(NewSegment, Event)
00109 public:
00110     static NewSegmentEventPtr create(bool update, double rate, double appliedRate, Format format,
00111                                      qint64 start, qint64 stop, qint64 position);
00112 
00113     bool isUpdate() const;
00114     double rate() const;
00115     double appliedRate() const;
00116     Format format() const;
00117     qint64 start() const;
00118     qint64 stop() const;
00119     qint64 position() const;
00120 };
00121 
00125 class QTGSTREAMER_EXPORT TagEvent : public Event
00126 {
00127     QGST_WRAPPER_FAKE_SUBCLASS(Tag, Event)
00128 public:
00129     static TagEventPtr create(const TagList & taglist);
00130 
00131     TagList taglist() const;
00132 };
00133 
00137 class QTGSTREAMER_EXPORT BufferSizeEvent : public Event
00138 {
00139     QGST_WRAPPER_FAKE_SUBCLASS(BufferSize, Event)
00140 public:
00141     static BufferSizeEventPtr create(Format format, qint64 minSize, qint64 maxSize, bool isAsync);
00142 
00143     Format format() const;
00144     qint64 minSize() const;
00145     qint64 maxSize() const;
00146     bool isAsync() const;
00147 };
00148 
00152 class QTGSTREAMER_EXPORT SinkMessageEvent : public Event
00153 {
00154     QGST_WRAPPER_FAKE_SUBCLASS(SinkMessage, Event)
00155 public:
00156     static SinkMessageEventPtr create(const MessagePtr & msg);
00157 
00158     MessagePtr message() const;
00159 };
00160 
00164 class QTGSTREAMER_EXPORT QosEvent : public Event
00165 {
00166     QGST_WRAPPER_FAKE_SUBCLASS(Qos, Event)
00167 public:
00168     static QosEventPtr create(double proportion, ClockTimeDiff diff, ClockTime timestamp);
00169 
00170     double proportion() const;
00171     ClockTimeDiff diff() const;
00172     ClockTime timestamp() const;
00173 };
00174 
00178 class QTGSTREAMER_EXPORT SeekEvent : public Event
00179 {
00180     QGST_WRAPPER_FAKE_SUBCLASS(Seek, Event)
00181 public:
00182     static SeekEventPtr create(double rate, Format format, SeekFlags flags, SeekType startType,
00183                                qint64 start, SeekType stopType, qint64 stop);
00184 
00185     double rate() const;
00186     Format format() const;
00187     SeekFlags flags() const;
00188     SeekType startType() const;
00189     qint64 start() const;
00190     SeekType stopType() const;
00191     qint64 stop() const;
00192 };
00193 
00197 class QTGSTREAMER_EXPORT NavigationEvent : public Event
00198 {
00199     QGST_WRAPPER_FAKE_SUBCLASS(Navigation, Event)
00200 public:
00201     static NavigationEventPtr create(const Structure & structure  = Structure());
00202 };
00203 
00207 class QTGSTREAMER_EXPORT LatencyEvent : public Event
00208 {
00209     QGST_WRAPPER_FAKE_SUBCLASS(Latency, Event)
00210 public:
00211     static LatencyEventPtr create(ClockTime latency);
00212 
00213     ClockTime latency() const;
00214 };
00215 
00219 class QTGSTREAMER_EXPORT StepEvent : public Event
00220 {
00221     QGST_WRAPPER_FAKE_SUBCLASS(Step, Event)
00222 public:
00223     static StepEventPtr create(Format format, quint64 amount, double rate,
00224                             bool flush, bool intermediate);
00225 
00226     Format format() const;
00227     quint64 amount() const;
00228     double rate() const;
00229     bool flush() const;
00230     bool intermediate() const;
00231 };
00232 
00233 } //namespace QGst
00234 
00235 QGST_REGISTER_TYPE(QGst::Event)
00236 QGST_REGISTER_SUBCLASS(Event, FlushStart)
00237 QGST_REGISTER_SUBCLASS(Event, FlushStop)
00238 QGST_REGISTER_SUBCLASS(Event, Eos)
00239 QGST_REGISTER_SUBCLASS(Event, NewSegment)
00240 QGST_REGISTER_SUBCLASS(Event, Tag)
00241 QGST_REGISTER_SUBCLASS(Event, BufferSize)
00242 QGST_REGISTER_SUBCLASS(Event, SinkMessage)
00243 QGST_REGISTER_SUBCLASS(Event, Qos)
00244 QGST_REGISTER_SUBCLASS(Event, Seek)
00245 QGST_REGISTER_SUBCLASS(Event, Navigation)
00246 QGST_REGISTER_SUBCLASS(Event, Latency)
00247 QGST_REGISTER_SUBCLASS(Event, Step)
00248 
00249 #endif