QtGStreamer 1.2.0
Loading...
Searching...
No Matches
query.h
1/*
2 Copyright (C) 2010 Collabora Multimedia.
3 @author Mauricio Piacentini <mauricio.piacentini@collabora.co.uk>
4
5 This library is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published
7 by the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef QGST_QUERY_H
19#define QGST_QUERY_H
20
21#include "miniobject.h"
22#include "structure.h"
23#include "clocktime.h"
24
25class QUrl;
26
27namespace QGst {
28
53class QTGSTREAMER_EXPORT Query : public MiniObject
54{
55 QGST_WRAPPER(Query)
56public:
57 QString typeName() const;
58 QueryType type() const;
59
60 StructureConstPtr internalStructure();
61};
62
66class QTGSTREAMER_EXPORT PositionQuery : public Query
67{
68 QGST_WRAPPER_FAKE_SUBCLASS(Position, Query)
69public:
70 static PositionQueryPtr create(Format format);
71
72 Format format() const;
73 qint64 position() const;
74 void setValues(Format format, qint64 position);
75};
76
80class QTGSTREAMER_EXPORT DurationQuery : public Query
81{
82 QGST_WRAPPER_FAKE_SUBCLASS(Duration, Query)
83public:
84 static DurationQueryPtr create(Format format);
85
86 Format format() const;
87 qint64 duration() const;
88 void setValues(Format format, qint64 duration);
89};
90
94class QTGSTREAMER_EXPORT LatencyQuery : public Query
95{
96 QGST_WRAPPER_FAKE_SUBCLASS(Latency, Query)
97public:
98 static LatencyQueryPtr create();
99
100 bool hasLive() const;
101 ClockTime minimumLatency() const;
102 ClockTime maximumLatency() const;
103
104 void setValues(bool live, ClockTime minimumLatency, ClockTime maximumLatency);
105};
106
110class QTGSTREAMER_EXPORT SeekingQuery : public Query
111{
112 QGST_WRAPPER_FAKE_SUBCLASS(Seeking, Query)
113public:
114 static SeekingQueryPtr create(Format format);
115
116 Format format() const;
117 bool seekable() const;
118 qint64 segmentStart() const;
119 qint64 segmentEnd() const;
120
121 void setValues(Format format, bool seekable, qint64 segmentStart, qint64 segmentEnd);
122};
123
127class QTGSTREAMER_EXPORT SegmentQuery : public Query
128{
129 QGST_WRAPPER_FAKE_SUBCLASS(Segment, Query)
130public:
131 static SegmentQueryPtr create(Format format);
132
133 Format format() const;
134 double rate() const;
135 qint64 startValue() const;
136 qint64 stopValue() const;
137
138 void setValues(Format format, double rate, qint64 startValue, qint64 stopValue);
139};
140
144class QTGSTREAMER_EXPORT ConvertQuery : public Query
145{
146 QGST_WRAPPER_FAKE_SUBCLASS(Convert, Query)
147public:
148 static ConvertQueryPtr create(Format sourceFormat, qint64 value, Format destinationFormat);
149
150 Format sourceFormat() const;
151 qint64 sourceValue() const;
152 Format destinationFormat() const;
153 qint64 destinationValue() const;
154
155 void setValues(Format sourceFormat, qint64 sourcevalue, Format destinationFormat,
156 qint64 destinationValue);
157};
158
162class QTGSTREAMER_EXPORT FormatsQuery : public Query
163{
164 QGST_WRAPPER_FAKE_SUBCLASS(Formats, Query)
165public:
166 static FormatsQueryPtr create();
167
168 QList<Format> formats() const;
169 void setFormats(const QList<Format> & formats);
170};
171
175class QTGSTREAMER_EXPORT BufferingQuery : public Query
176{
177 QGST_WRAPPER_FAKE_SUBCLASS(Buffering, Query)
178public:
179 static BufferingQueryPtr create(Format format);
180
181 bool isBusy() const;
182 int percent() const;
183
184 void setBufferingPercent(bool busy, int percent);
185
186 BufferingMode mode() const;
187 int averageIn() const;
188 int averageOut() const;
189 qint64 bufferingLeft() const;
190
191 void setBufferingStats(BufferingMode mode, int averageIn,
192 int averageOut, qint64 bufferingLeft);
193
194 Format rangeFormat() const;
195 qint64 rangeStart() const;
196 qint64 rangeStop() const;
197 qint64 estimatedTotal() const;
198
199 void setBufferingRange(Format rangeFormat, qint64 rangeStart,
200 qint64 rangeStop, qint64 estimatedTotal);
201};
202
206class QTGSTREAMER_EXPORT UriQuery : public Query
207{
208 QGST_WRAPPER_FAKE_SUBCLASS(Uri, Query)
209public:
210 static UriQueryPtr create();
211
212 QUrl uri() const;
213 void setUri(const QUrl & uri);
214};
215
216} //namespace QGst
217
218QGST_REGISTER_TYPE(QGst::Query)
219QGST_REGISTER_SUBCLASS(Query, Position)
220QGST_REGISTER_SUBCLASS(Query, Duration)
221QGST_REGISTER_SUBCLASS(Query, Latency)
222QGST_REGISTER_SUBCLASS(Query, Seeking)
223QGST_REGISTER_SUBCLASS(Query, Segment)
224QGST_REGISTER_SUBCLASS(Query, Convert)
225QGST_REGISTER_SUBCLASS(Query, Formats)
226QGST_REGISTER_SUBCLASS(Query, Buffering)
227QGST_REGISTER_SUBCLASS(Query, Uri)
228
229#endif
Smart pointer class for working with wrapper classes that support reference counting.
Definition refpointer.h:91
Wrapper class for queries of type QGst::BufferingQuery.
Definition query.h:176
A datatype to hold a time, measured in nanoseconds.
Definition clocktime.h:38
Wrapper class for queries of type QGst::ConvertQuery.
Definition query.h:145
Wrapper class for queries of type QGst::DurationQuery.
Definition query.h:81
Wrapper class for queries of type QGst::FormatsQuery.
Definition query.h:163
Wrapper class for queries of type QGst::LatencyQuery.
Definition query.h:95
Wrapper class for GstMiniObject.
Definition miniobject.h:30
Wrapper class for queries of type QGst::PositionQuery.
Definition query.h:67
Wrapper class for GstQuery.
Definition query.h:54
Wrapper class for queries of type QGst::SeekingQuery.
Definition query.h:111
Wrapper class for queries of type QGst::SegmentQuery.
Definition query.h:128
Wrapper for GstSegment.
Definition segment.h:28
Wrapper class for queries of type QGst::UriQuery.
Definition query.h:207
Wrappers for GStreamer classes.