tools: Count argc after parsing GOption on Windows
[platform/upstream/gstreamer.git] / subprojects / gstreamer / gst / gstquery.h
1 /* GStreamer
2  * Copyright (C) 1999,2000 Erik Walthinsen <omega@cse.ogi.edu>
3  *                    2000 Wim Taymans <wim.taymans@chello.be>
4  *                    2005 Wim Taymans <wim@fluendo.com>
5  *                    2011 Wim Taymans <wim.taymans@gmail.com>
6  *
7  * gstquery.h: GstQuery API declaration
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the
21  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
22  * Boston, MA 02110-1301, USA.
23  */
24
25
26 #ifndef __GST_QUERY_H__
27 #define __GST_QUERY_H__
28
29 #include <glib.h>
30 #include <glib-object.h>
31 #include <gst/gstconfig.h>
32
33 G_BEGIN_DECLS
34
35 typedef struct _GstQuery GstQuery;
36
37 #include <gst/gstminiobject.h>
38
39 /**
40  * GstQueryTypeFlags:
41  * @GST_QUERY_TYPE_UPSTREAM:     Set if the query can travel upstream.
42  * @GST_QUERY_TYPE_DOWNSTREAM:   Set if the query can travel downstream.
43  * @GST_QUERY_TYPE_SERIALIZED:   Set if the query should be serialized with data
44  *                               flow.
45  *
46  * #GstQueryTypeFlags indicate the aspects of the different #GstQueryType
47  * values. You can get the type flags of a #GstQueryType with the
48  * gst_query_type_get_flags() function.
49  */
50 typedef enum {
51   GST_QUERY_TYPE_UPSTREAM       = 1 << 0,
52   GST_QUERY_TYPE_DOWNSTREAM     = 1 << 1,
53   GST_QUERY_TYPE_SERIALIZED     = 1 << 2
54 } GstQueryTypeFlags;
55
56 /**
57  * GST_QUERY_TYPE_BOTH: (value 3) (type GstQueryTypeFlags)
58  *
59  * The same thing as #GST_QUERY_TYPE_UPSTREAM | #GST_QUERY_TYPE_DOWNSTREAM.
60  */
61 #define GST_QUERY_TYPE_BOTH \
62     ((GstQueryTypeFlags)(GST_QUERY_TYPE_UPSTREAM | GST_QUERY_TYPE_DOWNSTREAM))
63
64 #define GST_QUERY_NUM_SHIFT     (8)
65
66 /**
67  * GST_QUERY_MAKE_TYPE:
68  * @num: the query number to create
69  * @flags: the query flags
70  *
71  * when making custom query types, use this macro with the num and
72  * the given flags
73  */
74 #define GST_QUERY_MAKE_TYPE(num,flags) \
75     (((num) << GST_QUERY_NUM_SHIFT) | (flags))
76
77 #define _FLAG(name) GST_QUERY_TYPE_##name
78
79
80 /**
81  * GstQueryType:
82  * @GST_QUERY_UNKNOWN: unknown query type
83  * @GST_QUERY_POSITION: current position in stream
84  * @GST_QUERY_DURATION: total duration of the stream
85  * @GST_QUERY_LATENCY: latency of stream
86  * @GST_QUERY_JITTER: current jitter of stream
87  * @GST_QUERY_RATE: current rate of the stream
88  * @GST_QUERY_SEEKING: seeking capabilities
89  * @GST_QUERY_SEGMENT: segment start/stop positions
90  * @GST_QUERY_CONVERT: convert values between formats
91  * @GST_QUERY_FORMATS: query supported formats for convert
92  * @GST_QUERY_BUFFERING: query available media for efficient seeking.
93  * @GST_QUERY_CUSTOM: a custom application or element defined query.
94  * @GST_QUERY_URI: query the URI of the source or sink.
95  * @GST_QUERY_ALLOCATION: the buffer allocation properties
96  * @GST_QUERY_SCHEDULING: the scheduling properties
97  * @GST_QUERY_ACCEPT_CAPS: the accept caps query
98  * @GST_QUERY_CAPS: the caps query
99  * @GST_QUERY_DRAIN: wait till all serialized data is consumed downstream
100  * @GST_QUERY_CONTEXT: query the pipeline-local context from
101  *     downstream or upstream (since 1.2)
102  * @GST_QUERY_BITRATE: the bitrate query (since 1.16)
103  * @GST_QUERY_SELECTABLE: Query stream selection capability (Since: 1.22)
104  *
105  * Standard predefined Query types
106  */
107 /* NOTE: don't forget to update the table in gstquery.c when changing
108  * this enum */
109 typedef enum {
110   GST_QUERY_UNKNOWN      = GST_QUERY_MAKE_TYPE (0, 0),
111   GST_QUERY_POSITION     = GST_QUERY_MAKE_TYPE (10, _FLAG(BOTH)),
112   GST_QUERY_DURATION     = GST_QUERY_MAKE_TYPE (20, _FLAG(BOTH)),
113   GST_QUERY_LATENCY      = GST_QUERY_MAKE_TYPE (30, _FLAG(BOTH)),
114   GST_QUERY_JITTER       = GST_QUERY_MAKE_TYPE (40, _FLAG(BOTH)),
115   GST_QUERY_RATE         = GST_QUERY_MAKE_TYPE (50, _FLAG(BOTH)),
116   GST_QUERY_SEEKING      = GST_QUERY_MAKE_TYPE (60, _FLAG(BOTH)),
117   GST_QUERY_SEGMENT      = GST_QUERY_MAKE_TYPE (70, _FLAG(BOTH)),
118   GST_QUERY_CONVERT      = GST_QUERY_MAKE_TYPE (80, _FLAG(BOTH)),
119   GST_QUERY_FORMATS      = GST_QUERY_MAKE_TYPE (90, _FLAG(BOTH)),
120   GST_QUERY_BUFFERING    = GST_QUERY_MAKE_TYPE (110, _FLAG(BOTH)),
121   GST_QUERY_CUSTOM       = GST_QUERY_MAKE_TYPE (120, _FLAG(BOTH)),
122   GST_QUERY_URI          = GST_QUERY_MAKE_TYPE (130, _FLAG(BOTH)),
123   GST_QUERY_ALLOCATION   = GST_QUERY_MAKE_TYPE (140, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)),
124   GST_QUERY_SCHEDULING   = GST_QUERY_MAKE_TYPE (150, _FLAG(UPSTREAM)),
125   GST_QUERY_ACCEPT_CAPS  = GST_QUERY_MAKE_TYPE (160, _FLAG(BOTH)),
126   GST_QUERY_CAPS         = GST_QUERY_MAKE_TYPE (170, _FLAG(BOTH)),
127   GST_QUERY_DRAIN        = GST_QUERY_MAKE_TYPE (180, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)),
128   GST_QUERY_CONTEXT      = GST_QUERY_MAKE_TYPE (190, _FLAG(BOTH)),
129   GST_QUERY_BITRATE      = GST_QUERY_MAKE_TYPE (200, _FLAG(DOWNSTREAM)),
130
131   /**
132    * GST_QUERY_SELECTABLE:
133    *
134    * Query stream selection capability.
135    *
136    * Since: 1.22
137    */
138   GST_QUERY_SELECTABLE   = GST_QUERY_MAKE_TYPE (210, _FLAG(BOTH)),
139 } GstQueryType;
140 #undef _FLAG
141
142 GST_API GType _gst_query_type;
143
144 #define GST_TYPE_QUERY                         (_gst_query_type)
145 #define GST_IS_QUERY(obj)                      (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_QUERY))
146 #define GST_QUERY_CAST(obj)                    ((GstQuery*)(obj))
147 #define GST_QUERY(obj)                         (GST_QUERY_CAST(obj))
148
149 /**
150  * GST_QUERY_TYPE:
151  * @query: the query to query
152  *
153  * Get the #GstQueryType of the query.
154  */
155 #define GST_QUERY_TYPE(query)  (((GstQuery*)(query))->type)
156
157 /**
158  * GST_QUERY_TYPE_NAME:
159  * @query: the query to query
160  *
161  * Get a constant string representation of the #GstQueryType of the query.
162  */
163 #define GST_QUERY_TYPE_NAME(query) (gst_query_type_get_name(GST_QUERY_TYPE(query)))
164
165 /**
166  * GST_QUERY_IS_UPSTREAM:
167  * @ev: the query to query
168  *
169  * Check if an query can travel upstream.
170  */
171 #define GST_QUERY_IS_UPSTREAM(ev)       !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_UPSTREAM)
172 /**
173  * GST_QUERY_IS_DOWNSTREAM:
174  * @ev: the query to query
175  *
176  * Check if an query can travel downstream.
177  */
178 #define GST_QUERY_IS_DOWNSTREAM(ev)     !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_DOWNSTREAM)
179 /**
180  * GST_QUERY_IS_SERIALIZED:
181  * @ev: the query to query
182  *
183  * Check if an query is serialized with the data stream.
184  */
185 #define GST_QUERY_IS_SERIALIZED(ev)     !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_SERIALIZED)
186
187
188 /**
189  * GstQuery:
190  * @mini_object: The parent #GstMiniObject type
191  * @type: the #GstQueryType
192  *
193  * The #GstQuery structure.
194  */
195 struct _GstQuery
196 {
197   GstMiniObject mini_object;
198
199   /*< public > *//* with COW */
200   GstQueryType type;
201 };
202
203 /**
204  * GstBufferingMode:
205  * @GST_BUFFERING_STREAM: a small amount of data is buffered
206  * @GST_BUFFERING_DOWNLOAD: the stream is being downloaded
207  * @GST_BUFFERING_TIMESHIFT: the stream is being downloaded in a ringbuffer
208  * @GST_BUFFERING_LIVE: the stream is a live stream
209  *
210  * The different types of buffering methods.
211  */
212 typedef enum {
213   GST_BUFFERING_STREAM,
214   GST_BUFFERING_DOWNLOAD,
215   GST_BUFFERING_TIMESHIFT,
216   GST_BUFFERING_LIVE
217 } GstBufferingMode;
218
219 #include <gst/gstiterator.h>
220 #include <gst/gststructure.h>
221 #include <gst/gstformat.h>
222 #include <gst/gstpad.h>
223 #include <gst/gstallocator.h>
224 #include <gst/gsttoc.h>
225 #include <gst/gstcontext.h>
226
227 GST_API
228 const gchar*    gst_query_type_get_name        (GstQueryType type);
229
230 GST_API
231 GQuark          gst_query_type_to_quark        (GstQueryType type);
232
233 GST_API
234 GstQueryTypeFlags
235                 gst_query_type_get_flags       (GstQueryType type);
236
237
238 GST_API
239 GType           gst_query_get_type             (void);
240
241 #ifndef GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS
242 /* refcounting */
243 static inline GstQuery *
244 gst_query_ref (GstQuery * q)
245 {
246   return GST_QUERY_CAST (gst_mini_object_ref (GST_MINI_OBJECT_CAST (q)));
247 }
248
249 static inline void
250 gst_query_unref (GstQuery * q)
251 {
252   gst_mini_object_unref (GST_MINI_OBJECT_CAST (q));
253 }
254
255 static inline void
256 gst_clear_query (GstQuery ** query_ptr)
257 {
258   gst_clear_mini_object ((GstMiniObject **) query_ptr);
259 }
260
261 /* copy query */
262 static inline GstQuery *
263 gst_query_copy (const GstQuery * q)
264 {
265   return GST_QUERY_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (q)));
266 }
267 #else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
268 GST_API
269 GstQuery *  gst_query_ref   (GstQuery * q);
270
271 GST_API
272 void        gst_query_unref (GstQuery * q);
273
274 GST_API
275 void        gst_clear_query (GstQuery ** query_ptr);
276
277 GST_API
278 GstQuery *  gst_query_copy  (const GstQuery * q);
279 #endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
280
281 /**
282  * gst_query_is_writable:
283  * @q: a #GstQuery
284  *
285  * Tests if you can safely write data into a query's structure.
286  */
287 #define         gst_query_is_writable(q)     gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (q))
288 /**
289  * gst_query_make_writable:
290  * @q: (transfer full): a #GstQuery to make writable
291  *
292  * Makes a writable query from the given query.
293  *
294  * Returns: (transfer full): a new writable query (possibly same as @q)
295  */
296 #define         gst_query_make_writable(q)      GST_QUERY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (q)))
297
298 #ifndef GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS
299 static inline gboolean
300 gst_query_replace (GstQuery **old_query, GstQuery *new_query)
301 {
302   return gst_mini_object_replace ((GstMiniObject **) old_query, (GstMiniObject *) new_query);
303 }
304
305 static inline gboolean
306 gst_query_take (GstQuery **old_query, GstQuery *new_query)
307 {
308   return gst_mini_object_take ((GstMiniObject **) old_query,
309       (GstMiniObject *) new_query);
310 }
311 #else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
312 GST_API
313 gboolean        gst_query_replace               (GstQuery ** old_query,
314                                                  GstQuery * new_query);
315
316 GST_API
317 gboolean        gst_query_take                  (GstQuery ** old_query,
318                                                  GstQuery * new_query);
319 #endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */
320
321 /* application specific query */
322
323 GST_API
324 GstQuery *      gst_query_new_custom            (GstQueryType type, GstStructure *structure) G_GNUC_MALLOC;
325
326 GST_API
327 const GstStructure *
328                 gst_query_get_structure         (GstQuery *query);
329
330 GST_API
331 GstStructure *  gst_query_writable_structure    (GstQuery *query);
332
333 /* position query */
334
335 GST_API
336 GstQuery*       gst_query_new_position          (GstFormat format) G_GNUC_MALLOC;
337
338 GST_API
339 void            gst_query_set_position          (GstQuery *query, GstFormat format, gint64 cur);
340
341 GST_API
342 void            gst_query_parse_position        (GstQuery *query, GstFormat *format, gint64 *cur);
343
344 /* duration query */
345
346 GST_API
347 GstQuery*       gst_query_new_duration          (GstFormat format) G_GNUC_MALLOC;
348
349 GST_API
350 void            gst_query_set_duration          (GstQuery *query, GstFormat format, gint64 duration);
351
352 GST_API
353 void            gst_query_parse_duration        (GstQuery *query, GstFormat *format, gint64 *duration);
354
355 /* latency query */
356
357 GST_API
358 GstQuery*       gst_query_new_latency           (void) G_GNUC_MALLOC;
359
360 GST_API
361 void            gst_query_set_latency           (GstQuery *query, gboolean live, GstClockTime min_latency,
362                                                  GstClockTime max_latency);
363
364 GST_API
365 void            gst_query_parse_latency         (GstQuery *query, gboolean *live, GstClockTime *min_latency,
366                                                  GstClockTime *max_latency);
367
368 /* convert query */
369
370 GST_API
371 GstQuery*       gst_query_new_convert           (GstFormat src_format, gint64 value, GstFormat dest_format) G_GNUC_MALLOC;
372
373 GST_API
374 void            gst_query_set_convert           (GstQuery *query, GstFormat src_format, gint64 src_value,
375                                                  GstFormat dest_format, gint64 dest_value);
376
377 GST_API
378 void            gst_query_parse_convert         (GstQuery *query, GstFormat *src_format, gint64 *src_value,
379                                                  GstFormat *dest_format, gint64 *dest_value);
380 /* segment query */
381
382 GST_API
383 GstQuery*       gst_query_new_segment           (GstFormat format) G_GNUC_MALLOC;
384
385 GST_API
386 void            gst_query_set_segment           (GstQuery *query, gdouble rate, GstFormat format,
387                                                  gint64 start_value, gint64 stop_value);
388
389 GST_API
390 void            gst_query_parse_segment         (GstQuery *query, gdouble *rate, GstFormat *format,
391                                                  gint64 *start_value, gint64 *stop_value);
392
393 /* seeking query */
394
395 GST_API
396 GstQuery*       gst_query_new_seeking           (GstFormat format) G_GNUC_MALLOC;
397
398 GST_API
399 void            gst_query_set_seeking           (GstQuery *query, GstFormat format,
400                                                  gboolean seekable,
401                                                  gint64 segment_start,
402                                                  gint64 segment_end);
403
404 GST_API
405 void            gst_query_parse_seeking         (GstQuery *query, GstFormat *format,
406                                                  gboolean *seekable,
407                                                  gint64 *segment_start,
408                                                  gint64 *segment_end);
409 /* formats query */
410
411 GST_API
412 GstQuery*       gst_query_new_formats           (void) G_GNUC_MALLOC;
413
414 GST_API
415 void            gst_query_set_formats           (GstQuery *query, gint n_formats, ...);
416
417 GST_API
418 void            gst_query_set_formatsv          (GstQuery *query, gint n_formats, const GstFormat *formats);
419
420 GST_API
421 void            gst_query_parse_n_formats       (GstQuery *query, guint *n_formats);
422
423 GST_API
424 void            gst_query_parse_nth_format      (GstQuery *query, guint nth, GstFormat *format);
425
426 /* buffering query */
427
428 GST_API
429 GstQuery*       gst_query_new_buffering           (GstFormat format) G_GNUC_MALLOC;
430
431 GST_API
432 void            gst_query_set_buffering_percent   (GstQuery *query, gboolean busy, gint percent);
433
434 GST_API
435 void            gst_query_parse_buffering_percent (GstQuery *query, gboolean *busy, gint *percent);
436
437 GST_API
438 void            gst_query_set_buffering_stats     (GstQuery *query, GstBufferingMode mode,
439                                                    gint avg_in, gint avg_out,
440                                                    gint64 buffering_left);
441
442 GST_API
443 void            gst_query_parse_buffering_stats    (GstQuery *query, GstBufferingMode *mode,
444                                                    gint *avg_in, gint *avg_out,
445                                                    gint64 *buffering_left);
446
447 GST_API
448 void            gst_query_set_buffering_range     (GstQuery *query, GstFormat format,
449                                                    gint64 start, gint64 stop,
450                                                    gint64 estimated_total);
451
452 GST_API
453 void            gst_query_parse_buffering_range   (GstQuery *query, GstFormat *format,
454                                                    gint64 *start, gint64 *stop,
455                                                    gint64 *estimated_total);
456
457 GST_API
458 gboolean        gst_query_add_buffering_range       (GstQuery *query,
459                                                      gint64 start, gint64 stop);
460
461 GST_API
462 guint           gst_query_get_n_buffering_ranges    (GstQuery *query);
463
464 GST_API
465 gboolean        gst_query_parse_nth_buffering_range (GstQuery *query,
466                                                      guint index, gint64 *start,
467                                                      gint64 *stop);
468
469 /* URI query */
470
471 GST_API
472 GstQuery *      gst_query_new_uri                    (void) G_GNUC_MALLOC;
473
474 GST_API
475 void            gst_query_parse_uri                  (GstQuery *query, gchar **uri);
476
477 GST_API
478 void            gst_query_set_uri                    (GstQuery *query, const gchar *uri);
479
480 GST_API
481 void            gst_query_parse_uri_redirection      (GstQuery *query, gchar **uri);
482
483 GST_API
484 void            gst_query_set_uri_redirection        (GstQuery *query, const gchar *uri);
485
486 GST_API
487 void            gst_query_parse_uri_redirection_permanent (GstQuery *query, gboolean * permanent);
488
489 GST_API
490 void            gst_query_set_uri_redirection_permanent (GstQuery *query, gboolean permanent);
491
492 /* allocation query */
493
494 GST_API
495 GstQuery *      gst_query_new_allocation             (GstCaps *caps, gboolean need_pool) G_GNUC_MALLOC;
496
497 GST_API
498 void            gst_query_parse_allocation           (GstQuery *query, GstCaps **caps, gboolean *need_pool);
499
500 /* pools */
501
502 GST_API
503 void            gst_query_add_allocation_pool        (GstQuery *query, GstBufferPool *pool,
504                                                       guint size, guint min_buffers,
505                                                       guint max_buffers);
506
507 GST_API
508 guint           gst_query_get_n_allocation_pools     (GstQuery *query);
509
510 GST_API
511 void            gst_query_parse_nth_allocation_pool  (GstQuery *query, guint index,
512                                                       GstBufferPool **pool,
513                                                       guint *size, guint *min_buffers,
514                                                       guint *max_buffers);
515
516 GST_API
517 void            gst_query_set_nth_allocation_pool    (GstQuery *query, guint index,
518                                                       GstBufferPool *pool,
519                                                       guint size, guint min_buffers,
520                                                       guint max_buffers);
521
522 GST_API
523 void            gst_query_remove_nth_allocation_pool (GstQuery *query, guint index);
524
525 /* allocators */
526
527 GST_API
528 void            gst_query_add_allocation_param       (GstQuery *query, GstAllocator *allocator,
529                                                       const GstAllocationParams *params);
530
531 GST_API
532 guint           gst_query_get_n_allocation_params    (GstQuery *query);
533
534 GST_API
535 void            gst_query_parse_nth_allocation_param (GstQuery *query, guint index,
536                                                       GstAllocator **allocator,
537                                                       GstAllocationParams *params);
538
539 GST_API
540 void            gst_query_set_nth_allocation_param   (GstQuery *query, guint index,
541                                                       GstAllocator *allocator,
542                                                       const GstAllocationParams *params);
543
544 GST_API
545 void            gst_query_remove_nth_allocation_param (GstQuery *query, guint index);
546
547 /* metadata */
548
549 GST_API
550 void            gst_query_add_allocation_meta        (GstQuery *query, GType api, const GstStructure *params);
551
552 GST_API
553 guint           gst_query_get_n_allocation_metas     (GstQuery *query);
554
555 GST_API
556 GType           gst_query_parse_nth_allocation_meta  (GstQuery *query, guint index,
557                                                       const GstStructure **params);
558
559 GST_API
560 void            gst_query_remove_nth_allocation_meta (GstQuery *query, guint index);
561
562 GST_API
563 gboolean        gst_query_find_allocation_meta       (GstQuery *query, GType api, guint *index);
564
565
566 /* scheduling query */
567 /**
568  * GstSchedulingFlags:
569  * @GST_SCHEDULING_FLAG_SEEKABLE: if seeking is possible
570  * @GST_SCHEDULING_FLAG_SEQUENTIAL: if sequential access is recommended
571  * @GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED: if bandwidth is limited and buffering possible (since 1.2)
572  *
573  * The different scheduling flags.
574  */
575 typedef enum {
576   GST_SCHEDULING_FLAG_SEEKABLE          = (1 << 0),
577   GST_SCHEDULING_FLAG_SEQUENTIAL        = (1 << 1),
578   GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED = (1 << 2)
579 } GstSchedulingFlags;
580
581 GST_API
582 GstQuery *      gst_query_new_scheduling          (void) G_GNUC_MALLOC;
583
584 GST_API
585 void            gst_query_set_scheduling          (GstQuery *query, GstSchedulingFlags flags,
586                                                    gint minsize, gint maxsize, gint align);
587
588 GST_API
589 void            gst_query_parse_scheduling        (GstQuery *query, GstSchedulingFlags *flags,
590                                                    gint *minsize, gint *maxsize, gint *align);
591
592 GST_API
593 void            gst_query_add_scheduling_mode       (GstQuery *query, GstPadMode mode);
594
595 GST_API
596 guint           gst_query_get_n_scheduling_modes    (GstQuery *query);
597
598 GST_API
599 GstPadMode      gst_query_parse_nth_scheduling_mode (GstQuery *query, guint index);
600
601 GST_API
602 gboolean        gst_query_has_scheduling_mode       (GstQuery *query, GstPadMode mode);
603
604 GST_API
605 gboolean        gst_query_has_scheduling_mode_with_flags (GstQuery * query, GstPadMode mode,
606                                                     GstSchedulingFlags flags);
607
608 /* accept-caps query */
609
610 GST_API
611 GstQuery *      gst_query_new_accept_caps          (GstCaps *caps) G_GNUC_MALLOC;
612
613 GST_API
614 void            gst_query_parse_accept_caps        (GstQuery *query, GstCaps **caps);
615
616 GST_API
617 void            gst_query_set_accept_caps_result   (GstQuery *query, gboolean result);
618
619 GST_API
620 void            gst_query_parse_accept_caps_result (GstQuery *query, gboolean *result);
621
622 /* caps query */
623
624 GST_API
625 GstQuery *      gst_query_new_caps                 (GstCaps *filter) G_GNUC_MALLOC;
626
627 GST_API
628 void            gst_query_parse_caps               (GstQuery *query, GstCaps **filter);
629
630 GST_API
631 void            gst_query_set_caps_result          (GstQuery *query, GstCaps *caps);
632
633 GST_API
634 void            gst_query_parse_caps_result        (GstQuery *query, GstCaps **caps);
635
636 /* drain query */
637
638 GST_API
639 GstQuery *      gst_query_new_drain                (void) G_GNUC_MALLOC;
640
641 /* context query */
642
643 GST_API
644 GstQuery *      gst_query_new_context              (const gchar * context_type) G_GNUC_MALLOC;
645
646 GST_API
647 gboolean        gst_query_parse_context_type       (GstQuery * query, const gchar ** context_type);
648
649 GST_API
650 void            gst_query_set_context              (GstQuery *query, GstContext *context);
651
652 GST_API
653 void            gst_query_parse_context            (GstQuery *query, GstContext **context);
654
655 /* bitrate query */
656
657 GST_API
658 GstQuery *      gst_query_new_bitrate              (void) G_GNUC_MALLOC;
659
660 GST_API
661 void            gst_query_set_bitrate              (GstQuery * query, guint nominal_bitrate);
662
663 GST_API
664 void            gst_query_parse_bitrate            (GstQuery * query, guint * nominal_bitrate);
665
666 /* selectable query */
667
668 GST_API
669 GstQuery *      gst_query_new_selectable           (void) G_GNUC_MALLOC;
670
671 GST_API
672 void            gst_query_set_selectable           (GstQuery *query, gboolean selectable);
673
674 GST_API
675 void            gst_query_parse_selectable         (GstQuery *query, gboolean * selectable);
676
677 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstQuery, gst_query_unref)
678
679 G_END_DECLS
680
681 #endif /* __GST_QUERY_H__ */
682