QtGStreamer 1.2.0
Loading...
Searching...
No Matches
message.h
1/*
2 Copyright (C) 2009-2010 George Kiagiadakis <kiagiadakis.george@gmail.com>
3
4 This library is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as published
6 by the Free Software Foundation; either version 2.1 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17#ifndef QGST_MESSAGE_H
18#define QGST_MESSAGE_H
19
20#include "clocktime.h"
21#include "miniobject.h"
22#include "structure.h"
23#include "taglist.h"
24
25namespace QGst {
26
48class QTGSTREAMER_EXPORT Message : public MiniObject
49{
50 QGST_WRAPPER(Message)
51public:
52 ObjectPtr source() const;
53 quint64 timestamp() const;
54 QString typeName() const;
55 MessageType type() const;
56
57 StructureConstPtr internalStructure();
58
59 quint32 sequenceNumber() const;
60 void setSequenceNumber(quint32 num);
61};
62
66class QTGSTREAMER_EXPORT EosMessage : public Message
67{
68 QGST_WRAPPER_FAKE_SUBCLASS(Eos, Message)
69public:
70 static EosMessagePtr create(const ObjectPtr & source);
71};
72
76class QTGSTREAMER_EXPORT ErrorMessage : public Message
77{
78 QGST_WRAPPER_FAKE_SUBCLASS(Error, Message)
79public:
80 static ErrorMessagePtr create(const ObjectPtr & source,
81 const QGlib::Error & error, const char *debug);
82
83 QGlib::Error error() const;
84 QString debugMessage() const;
85};
86
90class QTGSTREAMER_EXPORT WarningMessage : public Message
91{
92 QGST_WRAPPER_FAKE_SUBCLASS(Warning, Message)
93public:
94 static WarningMessagePtr create(const ObjectPtr & source,
95 const QGlib::Error & error, const char *debug);
96
97 QGlib::Error error() const;
98 QString debugMessage() const;
99};
100
104class QTGSTREAMER_EXPORT InfoMessage : public Message
105{
106 QGST_WRAPPER_FAKE_SUBCLASS(Info, Message)
107public:
108 static InfoMessagePtr create(const ObjectPtr & source,
109 const QGlib::Error & error, const char *debug);
110
111 QGlib::Error error() const;
112 QString debugMessage() const;
113};
114
118class QTGSTREAMER_EXPORT TagMessage : public Message
119{
120 QGST_WRAPPER_FAKE_SUBCLASS(Tag, Message)
121public:
122 static TagMessagePtr create(const ObjectPtr & source, const TagList & taglist);
123
124 TagList taglist() const;
125};
126
130class QTGSTREAMER_EXPORT BufferingMessage : public Message
131{
132 QGST_WRAPPER_FAKE_SUBCLASS(Buffering, Message)
133public:
134 static BufferingMessagePtr create(const ObjectPtr & source, int percent);
135
136 int percent() const;
137 BufferingMode mode() const;
138 int averageInputRate() const;
139 int averageOutputRate() const;
140 qint64 bufferingTimeLeft() const;
141
142 void setStats(BufferingMode mode, int avgIn, int avgOut, qint64 bufferingLeft);
143};
144
148class QTGSTREAMER_EXPORT StateChangedMessage : public Message
149{
150 QGST_WRAPPER_FAKE_SUBCLASS(StateChanged, Message)
151public:
152 static StateChangedMessagePtr create(const ObjectPtr & source,
153 State oldState, State newState, State pending);
154
155 State oldState() const;
156 State newState() const;
157 State pendingState() const;
158};
159
160//won't do: STATE_DIRTY (deprecated)
161
165class QTGSTREAMER_EXPORT StepDoneMessage : public Message
166{
167 QGST_WRAPPER_FAKE_SUBCLASS(StepDone, Message)
168public:
169 static StepDoneMessagePtr create(const ObjectPtr & source, Format format, quint64 amount,
170 double rate, bool flush, bool intermediate, quint64 duration, bool eos);
171
172 Format format() const;
173 quint64 amount() const;
174 double rate() const;
175 bool isFlushingStep() const;
176 bool isIntermediateStep() const;
177 quint64 duration() const;
178 bool causedEos() const;
179};
180
181//TODO CLOCK_PROVIDE, CLOCK_LOST, NEW_CLOCK
182//maybe do: STRUCTURE_CHANGE (internal)
183
187class QTGSTREAMER_EXPORT StreamStatusMessage : public Message
188{
189 QGST_WRAPPER_FAKE_SUBCLASS(StreamStatus, Message)
190public:
191 static StreamStatusMessagePtr create(const ObjectPtr & source,
192 StreamStatusType type, const ElementPtr & owner);
193
194 StreamStatusType statusType() const;
195 ElementPtr owner() const;
196 QGlib::Value streamStatusObject() const;
197 void setStreamStatusObject(const QGlib::Value & object);
198};
199
203class QTGSTREAMER_EXPORT ApplicationMessage : public Message
204{
205 QGST_WRAPPER_FAKE_SUBCLASS(Application, Message)
206public:
207 static ApplicationMessagePtr create(const ObjectPtr & source,
208 const Structure & structure = Structure());
209};
210
214class QTGSTREAMER_EXPORT ElementMessage : public Message
215{
216 QGST_WRAPPER_FAKE_SUBCLASS(Element, Message)
217public:
218 static ElementMessagePtr create(const ObjectPtr & source,
219 const Structure & structure = Structure());
220};
221
222//maybe do: SEGMENT_START (internal)
223
227class QTGSTREAMER_EXPORT SegmentDoneMessage : public Message
228{
229 QGST_WRAPPER_FAKE_SUBCLASS(SegmentDone, Message)
230public:
231 static SegmentDoneMessagePtr create(const ObjectPtr & source, Format format, qint64 position);
232
233 Format format() const;
234 qint64 position() const;
235};
236
240class QTGSTREAMER_EXPORT DurationChangedMessage : public Message
241{
242 QGST_WRAPPER_FAKE_SUBCLASS(DurationChanged, Message)
243public:
244 static DurationChangedMessagePtr create(const ObjectPtr & source);
245
246};
247
251class QTGSTREAMER_EXPORT LatencyMessage : public Message
252{
253 QGST_WRAPPER_FAKE_SUBCLASS(Latency, Message)
254public:
255 static LatencyMessagePtr create(const ObjectPtr & source);
256};
257
258//maybe do: ASYNC_START (internal)
259
263class QTGSTREAMER_EXPORT AsyncDoneMessage : public Message
264{
265 QGST_WRAPPER_FAKE_SUBCLASS(AsyncDone, Message)
266public:
267 static AsyncDoneMessagePtr create(const ObjectPtr & source, ClockTime running_time);
268
269 ClockTime runningTime() const;
270};
271
275class QTGSTREAMER_EXPORT RequestStateMessage : public Message
276{
277 QGST_WRAPPER_FAKE_SUBCLASS(RequestState, Message)
278public:
279 static RequestStateMessagePtr create(const ObjectPtr & source, State state);
280
281 State state() const;
282};
283
287class QTGSTREAMER_EXPORT StepStartMessage : public Message
288{
289 QGST_WRAPPER_FAKE_SUBCLASS(StepStart, Message)
290public:
291 static StepStartMessagePtr create(const ObjectPtr & source, bool active, Format format,
292 quint64 amount, double rate, bool flush, bool intermediate);
293 bool isActive() const;
294 Format format() const;
295 quint64 amount() const;
296 double rate() const;
297 bool isFlushingStep() const;
298 bool isIntermediateStep() const;
299};
300
304class QTGSTREAMER_EXPORT QosMessage : public Message
305{
306 QGST_WRAPPER_FAKE_SUBCLASS(Qos, Message)
307public:
308 static QosMessagePtr create(const ObjectPtr & source, bool live, quint64 runningTime,
309 quint64 streamTime, quint64 timestamp, quint64 duration);
310
311 bool live() const;
312 quint64 runningTime() const;
313 quint64 streamTime() const;
314 quint64 timestamp() const;
315 quint64 duration() const;
316
317 qint64 jitter() const;
318 double proportion() const;
319 int quality() const;
320 void setValues(qint64 jitter, double proportion, int quality);
321
322 Format format() const;
323 quint64 processed() const;
324 quint64 dropped() const;
325 void setStats(Format format, quint64 processed, quint64 dropped);
326};
327
328} //namespace QGst
329
330QGST_REGISTER_TYPE(QGst::Message)
331QGST_REGISTER_SUBCLASS(Message, Eos)
332QGST_REGISTER_SUBCLASS(Message, Error)
333QGST_REGISTER_SUBCLASS(Message, Warning)
334QGST_REGISTER_SUBCLASS(Message, Info)
335QGST_REGISTER_SUBCLASS(Message, Tag)
336QGST_REGISTER_SUBCLASS(Message, Buffering)
337QGST_REGISTER_SUBCLASS(Message, StateChanged)
338QGST_REGISTER_SUBCLASS(Message, StepDone)
339QGST_REGISTER_SUBCLASS(Message, StreamStatus)
340QGST_REGISTER_SUBCLASS(Message, Application)
341QGST_REGISTER_SUBCLASS(Message, Element)
342QGST_REGISTER_SUBCLASS(Message, SegmentDone)
343QGST_REGISTER_SUBCLASS(Message, DurationChanged)
344QGST_REGISTER_SUBCLASS(Message, Latency)
345QGST_REGISTER_SUBCLASS(Message, AsyncDone)
346QGST_REGISTER_SUBCLASS(Message, RequestState)
347QGST_REGISTER_SUBCLASS(Message, StepStart)
348QGST_REGISTER_SUBCLASS(Message, Qos)
349
350#endif
Wrapper class for GError.
Definition error.h:31
Smart pointer class for working with wrapper classes that support reference counting.
Definition refpointer.h:91
Wrapper class for GValue.
Definition value.h:77
Wrapper class for messages of type QGst::MessageApplication.
Definition message.h:204
Wrapper class for messages of type QGst::MessageAsyncDone.
Definition message.h:264
Wrapper class for messages of type QGst::MessageBuffering.
Definition message.h:131
A datatype to hold a time, measured in nanoseconds.
Definition clocktime.h:38
Wrapper class for messages of type QGst::MessageDuration.
Definition message.h:241
Wrapper class for messages of type QGst::MessageElement.
Definition message.h:215
Wrapper class for GstElement.
Definition element.h:34
Wrapper class for messages of type QGst::MessageEos.
Definition message.h:67
Wrapper class for messages of type QGst::MessageError.
Definition message.h:77
Wrapper class for messages of type QGst::MessageInfo.
Definition message.h:105
Wrapper class for messages of type QGst::MessageLatency.
Definition message.h:252
Wrapper class for GstMessage.
Definition message.h:49
Wrapper class for GstMiniObject.
Definition miniobject.h:30
Wrapper class for messages of type QGst::MessageQos.
Definition message.h:305
Wrapper class for messages of type QGst::MessageRequestState.
Definition message.h:276
Wrapper class for messages of type QGst::MessageSegmentDone.
Definition message.h:228
Wrapper class for messages of type QGst::MessageStateChanged.
Definition message.h:149
Wrapper class for messages of type QGst::MessageStepDone.
Definition message.h:166
Wrapper class for messages of type QGst::MessageStepStart.
Definition message.h:288
Wrapper class for messages of type QGst::MessageStreamStatus.
Definition message.h:188
Wrapper for GstStructure.
Definition structure.h:50
Wrapper class for GstTagList.
Definition taglist.h:71
Wrapper class for messages of type QGst::MessageTag.
Definition message.h:119
Wrapper class for messages of type QGst::MessageWarning.
Definition message.h:91
Wrappers for GStreamer classes.