00001
00002
00003 #ifndef _GSTMM_QUERY_H
00004 #define _GSTMM_QUERY_H
00005
00006
00007 #include <glibmm.h>
00008
00009 #include <gstreamermm/miniobject.h>
00010 #include <gstreamermm/structure.h>
00011 #include <gstreamermm/wrap.h>
00012
00013
00014 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00015 typedef struct _GstQuery GstQuery;
00016 typedef struct _GstQueryClass GstQueryClass;
00017 #endif
00018
00019
00020 namespace Gst
00021 { class Query_Class; }
00022 namespace Gst
00023 {
00024
00025 struct QueryTypeDefinition
00026 {
00027 QueryType value;
00028 Glib::ustring nick;
00029 Glib::ustring description;
00030 Glib::QueryQuark quark;
00031 };
00032
00033
00034 class Query : public MiniObject
00035 {
00036 protected:
00037
00038 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00039
00040 public:
00041 typedef Query CppObjectType;
00042 typedef Query_Class CppClassType;
00043 typedef GstQuery BaseObjectType;
00044 typedef GstQueryClass BaseClassType;
00045
00046 private: friend class Query_Class;
00047 static CppClassType query_class_;
00048
00049 private:
00050
00051 Query(const Query&);
00052 Query& operator=(const Query&);
00053
00054 protected:
00055 explicit Query(GstQuery* castitem);
00056
00057 #endif
00058
00059 public:
00060 virtual ~Query();
00061
00062 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00063 static GType get_type() G_GNUC_CONST;
00064 static GType get_base_type() G_GNUC_CONST;
00065 #endif
00066
00068 GstQuery* gobj() { return reinterpret_cast<GstQuery*>(gobject_); }
00069
00071 const GstQuery* gobj() const { return reinterpret_cast<GstQuery*>(gobject_); }
00072
00074 GstQuery* gobj_copy();
00075
00076 private:
00077
00078
00079 public:
00080 const Structure& get_structure();
00081
00082 public:
00083 QueryType get_query_type() const;
00084
00090 static Glib::RefPtr<Query> wrap(GstQuery* query, bool take_copy=false);
00091
00092
00093 static QueryType register_query_type(const Glib::ustring& nick, const Glib::ustring& description);
00094
00095 static QueryType get_query_type(const Glib::ustring& nick);
00096
00097
00098 bool get_details(QueryType type, QueryTypeDefinition& def);
00099
00100 protected:
00101 Structure structure_;
00102
00103
00104 public:
00105
00106 public:
00107
00108 #ifdef GLIBMM_VFUNCS_ENABLED
00109 #endif //GLIBMM_VFUNCS_ENABLED
00110
00111 protected:
00112
00113 #ifdef GLIBMM_VFUNCS_ENABLED
00114 #endif //GLIBMM_VFUNCS_ENABLED
00115
00116
00117 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00118 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
00119
00120
00121 };
00122
00123 class QueryConvert : public Query
00124 {
00125 public:
00126 explicit QueryConvert(GstQuery* query);
00127
00128 static Glib::RefPtr<Query> create(Format src_format, gint64 value, Format dest_format);
00129 void set(Format src_format, gint64 src_value, Format dest_format, gint64 dest_value);
00130 void parse(Format& dest_format, gint64& dest_value);
00131 void parse(Format& src_format, gint64& src_value, Format& dest_format, gint64& dest_value);
00132 };
00133
00134 class QueryPosition : public Query
00135 {
00136 public:
00137 explicit QueryPosition(GstQuery* query);
00138
00139 static Glib::RefPtr<Query> create(Format format);
00140 void set(Format format, gint64 position);
00141 void parse(Format& format, gint64& position);
00142 };
00143
00144 class QueryDuration : public Query
00145 {
00146 public:
00147 explicit QueryDuration(GstQuery* query);
00148
00149 static Glib::RefPtr<Query> create(Format format);
00150 void set(Format format, gint64 duration);
00151 void parse(Format& format, gint64& duration);
00152 };
00153
00154 class QueryLatency : public Query
00155 {
00156 public:
00157 explicit QueryLatency(GstQuery* query);
00158
00159 static Glib::RefPtr<Query> create();
00160 void set(bool live, ClockTime min_latency, ClockTime max_latency);
00161 void parse(bool& live, ClockTime& min_latency, ClockTime& max_latency);
00162 };
00163
00164 class QuerySeeking : public Query
00165 {
00166 public:
00167 explicit QuerySeeking(GstQuery* query);
00168
00169 static Glib::RefPtr<Query> create(Format format);
00170 void set(Format format, bool seeakable, gint64 segment_start, gint64 segment_end);
00171 void parse(Format& format, bool& seekable, gint64& segment_start, gint64& segment_end);
00172 };
00173
00174 class QueryFormats : public Query
00175 {
00176 public:
00177 explicit QueryFormats(GstQuery* query);
00178
00179 static Glib::RefPtr<Query> create();
00180 void set(int n_formats, const va_list& varargs);
00181
00182 void parse(guint& n_formats);
00183 void parse(guint nth, Format& format);
00184 };
00185
00186 class QuerySegment : public Query
00187 {
00188 public:
00189 explicit QuerySegment(GstQuery* query);
00190
00191 static Glib::RefPtr<Query> create(Format format);
00192 void set(double rate, Format format, gint64 start_value, gint64 stop_value);
00193 void parse(double& rate, Format& format, gint64& start_value, gint64& stop_value);
00194 };
00195
00196 }
00197
00198
00199 namespace Gst
00200 {
00206 Glib::RefPtr<Gst::Query> wrap(GstQuery* object, bool take_copy = false);
00207 }
00208
00209
00210 #endif
00211