QtGStreamer  0.10.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
query.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_QUERY_H
00019 #define QGST_QUERY_H
00020 
00021 #include "miniobject.h"
00022 #include "structure.h"
00023 #include "clocktime.h"
00024 
00025 class QUrl;
00026 
00027 namespace QGst {
00028 
00053 class QTGSTREAMER_EXPORT Query : public MiniObject
00054 {
00055     QGST_WRAPPER(Query)
00056 public:
00057     QString typeName() const;
00058     QueryType type() const;
00059 
00060     StructurePtr internalStructure();
00061 };
00062 
00066 class QTGSTREAMER_EXPORT PositionQuery : public Query
00067 {
00068     QGST_WRAPPER_FAKE_SUBCLASS(Position, Query)
00069 public:
00070     static PositionQueryPtr create(Format format);
00071 
00072     Format format() const;
00073     qint64 position() const;
00074     void setValues(Format format, qint64 position);
00075 };
00076 
00080 class QTGSTREAMER_EXPORT DurationQuery : public Query
00081 {
00082     QGST_WRAPPER_FAKE_SUBCLASS(Duration, Query)
00083 public:
00084     static DurationQueryPtr create(Format format);
00085 
00086     Format format() const;
00087     qint64 duration() const;
00088     void setValues(Format format, qint64 duration);
00089 };
00090 
00094 class QTGSTREAMER_EXPORT LatencyQuery : public Query
00095 {
00096     QGST_WRAPPER_FAKE_SUBCLASS(Latency, Query)
00097 public:
00098     static LatencyQueryPtr create();
00099 
00100     bool hasLive() const;
00101     ClockTime minimumLatency() const;
00102     ClockTime maximumLatency() const;
00103 
00104     void setValues(bool live, ClockTime minimumLatency, ClockTime maximumLatency);
00105 };
00106 
00110 class QTGSTREAMER_EXPORT SeekingQuery : public Query
00111 {
00112     QGST_WRAPPER_FAKE_SUBCLASS(Seeking, Query)
00113 public:
00114     static SeekingQueryPtr create(Format format);
00115 
00116     Format format() const;
00117     bool seekable() const;
00118     qint64 segmentStart() const;
00119     qint64 segmentEnd() const;
00120 
00121     void setValues(Format format, bool seekable, qint64 segmentStart, qint64 segmentEnd);
00122 };
00123 
00127 class QTGSTREAMER_EXPORT SegmentQuery : public Query
00128 {
00129     QGST_WRAPPER_FAKE_SUBCLASS(Segment, Query)
00130 public:
00131     static SegmentQueryPtr create(Format format);
00132 
00133     Format format() const;
00134     double rate() const;
00135     qint64 startValue() const;
00136     qint64 stopValue() const;
00137 
00138     void setValues(Format format, double rate, qint64 startValue, qint64 stopValue);
00139 };
00140 
00144 class QTGSTREAMER_EXPORT ConvertQuery : public Query
00145 {
00146     QGST_WRAPPER_FAKE_SUBCLASS(Convert, Query)
00147 public:
00148     static ConvertQueryPtr create(Format sourceFormat, qint64 value, Format destinationFormat);
00149 
00150     Format sourceFormat() const;
00151     qint64 sourceValue() const;
00152     Format destinationFormat() const;
00153     qint64 destinationValue() const;
00154 
00155     void setValues(Format sourceFormat, qint64 sourcevalue, Format destinationFormat,
00156                     qint64 destinationValue);
00157 };
00158 
00162 class QTGSTREAMER_EXPORT FormatsQuery : public Query
00163 {
00164     QGST_WRAPPER_FAKE_SUBCLASS(Formats, Query)
00165 public:
00166     static FormatsQueryPtr create();
00167 
00168     QList<Format> formats() const;
00169     void setFormats(const QList<Format> & formats);
00170 };
00171 
00175 class QTGSTREAMER_EXPORT BufferingQuery : public Query
00176 {
00177     QGST_WRAPPER_FAKE_SUBCLASS(Buffering, Query)
00178 public:
00179     static BufferingQueryPtr create(Format format);
00180 
00181     bool isBusy() const;
00182     int percent() const;
00183 
00184     void setBufferingPercent(bool busy, int percent);
00185 
00186     BufferingMode mode() const;
00187     int averageIn() const;
00188     int averageOut() const;
00189     qint64 bufferingLeft() const;
00190 
00191     void setBufferingStats(BufferingMode mode, int averageIn,
00192                            int averageOut, qint64 bufferingLeft);
00193 
00194     Format rangeFormat() const;
00195     qint64 rangeStart() const;
00196     qint64 rangeStop() const;
00197     qint64 estimatedTotal() const;
00198 
00199     void setBufferingRange(Format rangeFormat, qint64 rangeStart,
00200                            qint64 rangeStop, qint64 estimatedTotal);
00201 };
00202 
00206 class QTGSTREAMER_EXPORT UriQuery : public Query
00207 {
00208     QGST_WRAPPER_FAKE_SUBCLASS(Uri, Query)
00209 public:
00210     static UriQueryPtr create();
00211 
00212     QUrl uri() const;
00213     void setUri(const QUrl & uri);
00214 };
00215 
00216 } //namespace QGst
00217 
00218 QGST_REGISTER_TYPE(QGst::Query)
00219 QGST_REGISTER_SUBCLASS(Query, Position)
00220 QGST_REGISTER_SUBCLASS(Query, Duration)
00221 QGST_REGISTER_SUBCLASS(Query, Latency)
00222 QGST_REGISTER_SUBCLASS(Query, Seeking)
00223 QGST_REGISTER_SUBCLASS(Query, Segment)
00224 QGST_REGISTER_SUBCLASS(Query, Convert)
00225 QGST_REGISTER_SUBCLASS(Query, Formats)
00226 QGST_REGISTER_SUBCLASS(Query, Buffering)
00227 QGST_REGISTER_SUBCLASS(Query, Uri)
00228 
00229 #endif