44 * @GST_QUERY_RATE: current rate of the stream |
44 * @GST_QUERY_RATE: current rate of the stream |
45 * @GST_QUERY_SEEKING: seeking capabilities |
45 * @GST_QUERY_SEEKING: seeking capabilities |
46 * @GST_QUERY_SEGMENT: segment start/stop positions |
46 * @GST_QUERY_SEGMENT: segment start/stop positions |
47 * @GST_QUERY_CONVERT: convert values between formats |
47 * @GST_QUERY_CONVERT: convert values between formats |
48 * @GST_QUERY_FORMATS: query supported formats for convert |
48 * @GST_QUERY_FORMATS: query supported formats for convert |
49 * @GST_QUERY_BUFFERING: query available media for efficient seeking. Since |
|
50 * 0.10.20. |
|
51 * @GST_QUERY_CUSTOM: a custom application or element defined query. Since |
|
52 * 0.10.22. |
|
53 * @GST_QUERY_URI: query the URI of the source or sink. Since 0.10.22. |
|
54 * |
49 * |
55 * Standard predefined Query types |
50 * Standard predefined Query types |
56 */ |
51 */ |
57 /* NOTE: don't forget to update the table in gstquery.c when changing |
52 /* NOTE: don't forget to update the table in gstquery.c when changing |
58 * this enum */ |
53 * this enum */ |
64 GST_QUERY_JITTER, /* not in draft-query, necessary? */ |
59 GST_QUERY_JITTER, /* not in draft-query, necessary? */ |
65 GST_QUERY_RATE, |
60 GST_QUERY_RATE, |
66 GST_QUERY_SEEKING, |
61 GST_QUERY_SEEKING, |
67 GST_QUERY_SEGMENT, |
62 GST_QUERY_SEGMENT, |
68 GST_QUERY_CONVERT, |
63 GST_QUERY_CONVERT, |
69 GST_QUERY_FORMATS, |
64 GST_QUERY_FORMATS |
70 GST_QUERY_BUFFERING, |
|
71 GST_QUERY_CUSTOM, |
|
72 GST_QUERY_URI |
|
73 } GstQueryType; |
65 } GstQueryType; |
74 |
|
75 /** |
|
76 * GstBufferingMode: |
|
77 * @GST_BUFFERING_STREAM: a small amount of data is buffered |
|
78 * @GST_BUFFERING_DOWNLOAD: the stream is being downloaded |
|
79 * @GST_BUFFERING_TIMESHIFT: the stream is being downloaded in a ringbuffer |
|
80 * @GST_BUFFERING_LIVE: the stream is a live stream |
|
81 * |
|
82 * The different types of buffering methods. |
|
83 */ |
|
84 typedef enum { |
|
85 GST_BUFFERING_STREAM, |
|
86 GST_BUFFERING_DOWNLOAD, |
|
87 GST_BUFFERING_TIMESHIFT, |
|
88 GST_BUFFERING_LIVE |
|
89 } GstBufferingMode; |
|
90 |
66 |
91 typedef struct _GstQueryTypeDefinition GstQueryTypeDefinition; |
67 typedef struct _GstQueryTypeDefinition GstQueryTypeDefinition; |
92 typedef struct _GstQuery GstQuery; |
68 typedef struct _GstQuery GstQuery; |
93 typedef struct _GstQueryClass GstQueryClass; |
69 typedef struct _GstQueryClass GstQueryClass; |
94 |
70 |
112 #define GST_TYPE_QUERY (gst_query_get_type()) |
88 #define GST_TYPE_QUERY (gst_query_get_type()) |
113 #define GST_IS_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_QUERY)) |
89 #define GST_IS_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_QUERY)) |
114 #define GST_IS_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_QUERY)) |
90 #define GST_IS_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_QUERY)) |
115 #define GST_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_QUERY, GstQueryClass)) |
91 #define GST_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_QUERY, GstQueryClass)) |
116 #define GST_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_QUERY, GstQuery)) |
92 #define GST_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_QUERY, GstQuery)) |
117 #define GST_QUERY_CAST(obj) ((GstQuery*)(obj)) /* only since 0.10.23 */ |
|
118 #define GST_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_QUERY, GstQueryClass)) |
93 #define GST_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_QUERY, GstQueryClass)) |
119 |
|
120 |
94 |
121 /** |
95 /** |
122 * GST_QUERY_TYPE: |
96 * GST_QUERY_TYPE: |
123 * @query: the query to query |
97 * @query: the query to query |
124 * |
98 * |
152 /*< public > *//* with COW */ |
126 /*< public > *//* with COW */ |
153 GstQueryType type; |
127 GstQueryType type; |
154 |
128 |
155 GstStructure *structure; |
129 GstStructure *structure; |
156 |
130 |
157 /*< private >*/ |
131 /*< private > */ |
158 gpointer _gst_reserved; |
132 gpointer _gst_reserved; |
159 }; |
133 }; |
160 |
134 |
161 struct _GstQueryClass { |
135 struct _GstQueryClass { |
162 GstMiniObjectClass mini_object_class; |
136 GstMiniObjectClass mini_object_class; |
163 |
137 |
164 /*< private >*/ |
138 /*< private > */ |
165 gpointer _gst_reserved[GST_PADDING]; |
139 gpointer _gst_reserved[GST_PADDING]; |
166 }; |
140 }; |
167 #ifdef __SYMBIAN32__ |
141 #ifdef __SYMBIAN32__ |
168 IMPORT_C |
142 IMPORT_C |
169 #endif |
143 #endif |
221 /** |
195 /** |
222 * gst_query_ref: |
196 * gst_query_ref: |
223 * @q: a #GstQuery to increase the refcount of. |
197 * @q: a #GstQuery to increase the refcount of. |
224 * |
198 * |
225 * Increases the refcount of the given query by one. |
199 * Increases the refcount of the given query by one. |
226 * |
200 */ |
227 * Returns: @q |
201 #define gst_query_ref(q) GST_QUERY (gst_mini_object_ref (GST_MINI_OBJECT (q))) |
228 */ |
|
229 #ifdef _FOOL_GTK_DOC_ |
|
230 G_INLINE_FUNC GstQuery * gst_query_ref (GstQuery * q); |
|
231 #endif |
|
232 |
|
233 static inline GstQuery * |
|
234 gst_query_ref (GstQuery * q) |
|
235 { |
|
236 return GST_QUERY (gst_mini_object_ref (GST_MINI_OBJECT_CAST (q))); |
|
237 } |
|
238 |
|
239 /** |
202 /** |
240 * gst_query_unref: |
203 * gst_query_unref: |
241 * @q: a #GstQuery to decrease the refcount of. |
204 * @q: a #GstQuery to decrease the refcount of. |
242 * |
205 * |
243 * Decreases the refcount of the query. If the refcount reaches 0, the query |
206 * Decreases the refcount of the query. If the refcount reaches 0, the query |
244 * will be freed. |
207 * will be freed. |
245 */ |
208 */ |
246 #ifdef _FOOL_GTK_DOC_ |
209 #define gst_query_unref(q) gst_mini_object_unref (GST_MINI_OBJECT (q)) |
247 G_INLINE_FUNC void gst_query_unref (GstQuery * q); |
|
248 #endif |
|
249 |
|
250 static inline void |
|
251 gst_query_unref (GstQuery * q) |
|
252 { |
|
253 gst_mini_object_unref (GST_MINI_OBJECT_CAST (q)); |
|
254 } |
|
255 |
210 |
256 /* copy query */ |
211 /* copy query */ |
257 /** |
212 /** |
258 * gst_query_copy: |
213 * gst_query_copy: |
259 * @q: a #GstQuery to copy. |
214 * @q: a #GstQuery to copy. |
260 * |
215 * |
261 * Copies the given query using the copy function of the parent #GstData |
216 * Copies the given query using the copy function of the parent #GstData |
262 * structure. |
217 * structure. |
263 * |
218 */ |
264 * Returns: a new copy of @q. |
219 #define gst_query_copy(q) GST_QUERY (gst_mini_object_copy (GST_MINI_OBJECT (q))) |
265 */ |
|
266 #ifdef _FOOL_GTK_DOC_ |
|
267 G_INLINE_FUNC GstQuery * gst_query_copy (const GstQuery * q); |
|
268 #endif |
|
269 |
|
270 static inline GstQuery * |
|
271 gst_query_copy (const GstQuery * q) |
|
272 { |
|
273 return GST_QUERY (gst_mini_object_copy (GST_MINI_OBJECT_CAST (q))); |
|
274 } |
|
275 |
|
276 /** |
220 /** |
277 * gst_query_make_writable: |
221 * gst_query_make_writable: |
278 * @q: a #GstQuery to make writable |
222 * @q: a #GstQuery to make writable |
279 * |
223 * |
280 * Makes a writable query from the given query. |
224 * Makes a writable query from the given query. |
431 IMPORT_C |
375 IMPORT_C |
432 #endif |
376 #endif |
433 |
377 |
434 void gst_query_parse_formats_nth (GstQuery *query, guint nth, GstFormat *format); |
378 void gst_query_parse_formats_nth (GstQuery *query, guint nth, GstFormat *format); |
435 |
379 |
436 /* buffering query */ |
|
437 #ifdef __SYMBIAN32__ |
|
438 IMPORT_C |
|
439 #endif |
|
440 |
|
441 GstQuery* gst_query_new_buffering (GstFormat format); |
|
442 #ifdef __SYMBIAN32__ |
|
443 IMPORT_C |
|
444 #endif |
|
445 |
|
446 void gst_query_set_buffering_percent (GstQuery *query, gboolean busy, gint percent); |
|
447 #ifdef __SYMBIAN32__ |
|
448 IMPORT_C |
|
449 #endif |
|
450 |
|
451 void gst_query_parse_buffering_percent (GstQuery *query, gboolean *busy, gint *percent); |
|
452 #ifdef __SYMBIAN32__ |
|
453 IMPORT_C |
|
454 #endif |
|
455 |
|
456 |
|
457 void gst_query_set_buffering_stats (GstQuery *query, GstBufferingMode mode, |
|
458 gint avg_in, gint avg_out, |
|
459 gint64 buffering_left); |
|
460 #ifdef __SYMBIAN32__ |
|
461 IMPORT_C |
|
462 #endif |
|
463 |
|
464 void gst_query_parse_buffering_stats (GstQuery *query, GstBufferingMode *mode, |
|
465 gint *avg_in, gint *avg_out, |
|
466 gint64 *buffering_left); |
|
467 #ifdef __SYMBIAN32__ |
|
468 IMPORT_C |
|
469 #endif |
|
470 |
|
471 |
|
472 void gst_query_set_buffering_range (GstQuery *query, GstFormat format, |
|
473 gint64 start, gint64 stop, |
|
474 gint64 estimated_total); |
|
475 #ifdef __SYMBIAN32__ |
|
476 IMPORT_C |
|
477 #endif |
|
478 |
|
479 void gst_query_parse_buffering_range (GstQuery *query, GstFormat *format, |
|
480 gint64 *start, gint64 *stop, |
|
481 gint64 *estimated_total); |
|
482 /* URI query */ |
|
483 #ifdef __SYMBIAN32__ |
|
484 IMPORT_C |
|
485 #endif |
|
486 |
|
487 GstQuery * gst_query_new_uri (void); |
|
488 #ifdef __SYMBIAN32__ |
|
489 IMPORT_C |
|
490 #endif |
|
491 |
|
492 void gst_query_parse_uri (GstQuery *query, gchar **uri); |
|
493 #ifdef __SYMBIAN32__ |
|
494 IMPORT_C |
|
495 #endif |
|
496 |
|
497 void gst_query_set_uri (GstQuery *query, const gchar *uri); |
|
498 |
|
499 G_END_DECLS |
380 G_END_DECLS |
500 |
381 |
501 #endif /* __GST_QUERY_H__ */ |
382 #endif /* __GST_QUERY_H__ */ |
502 |
383 |