00001
00002
00003 #ifndef _GSTREAMERMM_QUERY_H
00004 #define _GSTREAMERMM_QUERY_H
00005
00006
00007 #include <glibmm.h>
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <gst/gstquery.h>
00031 #include <gstreamermm/miniobject.h>
00032 #include <gstreamermm/structure.h>
00033 #include <gstreamermm/wrap.h>
00034 #include <gstreamermm/format.h>
00035
00036
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038 typedef struct _GstQuery GstQuery;
00039 typedef struct _GstQueryClass GstQueryClass;
00040 #endif
00041
00042
00043 namespace Gst
00044 { class Query_Class; }
00045 namespace Gst
00046 {
00047
00053 enum QueryType
00054 {
00055 QUERY_NONE,
00056 QUERY_POSITION,
00057 QUERY_DURATION,
00058 QUERY_LATENCY,
00059 QUERY_JITTER,
00060 QUERY_RATE,
00061 QUERY_SEEKING,
00062 QUERY_SEGMENT,
00063 QUERY_CONVERT,
00064 QUERY_FORMATS
00065 };
00066
00067 }
00068
00069
00070 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00071 namespace Glib
00072 {
00073
00074 template <>
00075 class Value<Gst::QueryType> : public Glib::Value_Enum<Gst::QueryType>
00076 {
00077 public:
00078 static GType value_type() G_GNUC_CONST;
00079 };
00080
00081 }
00082 #endif
00083
00084
00085 namespace Gst
00086 {
00087
00088
00089 namespace Enums
00090 {
00091
00097 Glib::ustring get_name(QueryType t);
00098
00099
00105 Glib::QueryQuark get_quark(QueryType t);
00106
00107
00108 }
00109
00110 struct QueryTypeDefinition
00111 {
00112 QueryType value;
00113 Glib::ustring nick;
00114 Glib::ustring description;
00115 Glib::QueryQuark quark;
00116 };
00117
00118
00119 class Query : public MiniObject
00120 {
00121 protected:
00122
00123 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00124
00125 public:
00126 typedef Query CppObjectType;
00127 typedef Query_Class CppClassType;
00128 typedef GstQuery BaseObjectType;
00129 typedef GstQueryClass BaseClassType;
00130
00131 private: friend class Query_Class;
00132 static CppClassType query_class_;
00133
00134 private:
00135
00136 Query(const Query&);
00137 Query& operator=(const Query&);
00138
00139 protected:
00140 explicit Query(GstQuery* castitem);
00141
00142 #endif
00143
00144 public:
00145 virtual ~Query();
00146
00147 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00148 static GType get_type() G_GNUC_CONST;
00149 static GType get_base_type() G_GNUC_CONST;
00150 #endif
00151
00153 GstQuery* gobj() { return reinterpret_cast<GstQuery*>(gobject_); }
00154
00156 const GstQuery* gobj() const { return reinterpret_cast<GstQuery*>(gobject_); }
00157
00159 GstQuery* gobj_copy();
00160
00161 private:
00162
00163
00164 public:
00165
00169 Structure get_structure() const;
00170
00171 public:
00174 QueryType get_query_type() const;
00175
00181 static Glib::RefPtr<Query> wrap(GstQuery* query, bool take_copy=false);
00182
00183
00191 static QueryType register_query_type(const Glib::ustring& nick, const Glib::ustring& description);
00192
00198 static QueryType get_query_type(const Glib::ustring& nick);
00199
00200
00205 static bool query_types_contains(const Glib::ArrayHandle<QueryType>& types, QueryType type);
00206
00213 bool get_details(QueryType type, QueryTypeDefinition& def);
00214
00215
00216 public:
00217
00218 public:
00219
00220 #ifdef GLIBMM_VFUNCS_ENABLED
00221 #endif //GLIBMM_VFUNCS_ENABLED
00222
00223 protected:
00224
00225 #ifdef GLIBMM_VFUNCS_ENABLED
00226 #endif //GLIBMM_VFUNCS_ENABLED
00227
00228
00229 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00230 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00231
00232
00233 };
00234
00235
00236
00237
00238
00239
00240
00241 class QueryConvert : public Query
00242 {
00243 public:
00244 explicit QueryConvert(GstQuery* query);
00245
00246 static Glib::RefPtr<Query> create(Format src_format, gint64 value, Format dest_format);
00247 void set(Format src_format, gint64 src_value, Format dest_format, gint64 dest_value);
00248 void parse(Format& dest_format, gint64& dest_value);
00249 void parse(Format& src_format, gint64& src_value, Format& dest_format, gint64& dest_value);
00250 };
00251
00252 class QueryPosition : public Query
00253 {
00254 public:
00255 explicit QueryPosition(GstQuery* query);
00256
00257 static Glib::RefPtr<Query> create(Format format);
00258 void set(Format format, gint64 position);
00259 void parse(Format& format, gint64& position);
00260 };
00261
00262 class QueryDuration : public Query
00263 {
00264 public:
00265 explicit QueryDuration(GstQuery* query);
00266
00267 static Glib::RefPtr<Query> create(Format format);
00268 void set(Format format, gint64 duration);
00269 void parse(Format& format, gint64& duration);
00270 };
00271
00272 class QueryLatency : public Query
00273 {
00274 public:
00275 explicit QueryLatency(GstQuery* query);
00276
00277 static Glib::RefPtr<Query> create();
00278 void set(bool live, ClockTime min_latency, ClockTime max_latency);
00279 void parse(bool& live, ClockTime& min_latency, ClockTime& max_latency);
00280 };
00281
00282 class QuerySeeking : public Query
00283 {
00284 public:
00285 explicit QuerySeeking(GstQuery* query);
00286
00287 static Glib::RefPtr<Query> create(Format format);
00288 void set(Format format, bool seeakable, gint64 segment_start, gint64 segment_end);
00289 void parse(Format& format, bool& seekable, gint64& segment_start, gint64& segment_end);
00290 };
00291
00292 class QueryFormats : public Query
00293 {
00294 public:
00295 explicit QueryFormats(GstQuery* query);
00296
00297 static Glib::RefPtr<Query> create();
00298 void set(int n_formats, const va_list& varargs);
00299
00300 void parse(guint& n_formats);
00301 void parse(guint nth, Format& format);
00302 };
00303
00304 class QuerySegment : public Query
00305 {
00306 public:
00307 explicit QuerySegment(GstQuery* query);
00308
00309 static Glib::RefPtr<Query> create(Format format);
00310 void set(double rate, Format format, gint64 start_value, gint64 stop_value);
00311 void parse(double& rate, Format& format, gint64& start_value, gint64& stop_value);
00312 };
00313
00314 }
00315
00316
00317 namespace Gst
00318 {
00324 Glib::RefPtr<Gst::Query> wrap(GstQuery* object, bool take_copy = false);
00325 }
00326
00327
00328 #endif
00329