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 | * |
104 | * Standard predefined Query types |
105 | */ |
106 | /* NOTE: don't forget to update the table in gstquery.c when changing |
107 | * this enum */ |
108 | typedef enum { |
109 | GST_QUERY_UNKNOWN = GST_QUERY_MAKE_TYPE (0, 0), |
110 | GST_QUERY_POSITION = GST_QUERY_MAKE_TYPE (10, _FLAG(BOTH)), |
111 | GST_QUERY_DURATION = GST_QUERY_MAKE_TYPE (20, _FLAG(BOTH)), |
112 | GST_QUERY_LATENCY = GST_QUERY_MAKE_TYPE (30, _FLAG(BOTH)), |
113 | GST_QUERY_JITTER = GST_QUERY_MAKE_TYPE (40, _FLAG(BOTH)), |
114 | GST_QUERY_RATE = GST_QUERY_MAKE_TYPE (50, _FLAG(BOTH)), |
115 | GST_QUERY_SEEKING = GST_QUERY_MAKE_TYPE (60, _FLAG(BOTH)), |
116 | GST_QUERY_SEGMENT = GST_QUERY_MAKE_TYPE (70, _FLAG(BOTH)), |
117 | GST_QUERY_CONVERT = GST_QUERY_MAKE_TYPE (80, _FLAG(BOTH)), |
118 | GST_QUERY_FORMATS = GST_QUERY_MAKE_TYPE (90, _FLAG(BOTH)), |
119 | GST_QUERY_BUFFERING = GST_QUERY_MAKE_TYPE (110, _FLAG(BOTH)), |
120 | GST_QUERY_CUSTOM = GST_QUERY_MAKE_TYPE (120, _FLAG(BOTH)), |
121 | GST_QUERY_URI = GST_QUERY_MAKE_TYPE (130, _FLAG(BOTH)), |
122 | GST_QUERY_ALLOCATION = GST_QUERY_MAKE_TYPE (140, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)), |
123 | GST_QUERY_SCHEDULING = GST_QUERY_MAKE_TYPE (150, _FLAG(UPSTREAM)), |
124 | GST_QUERY_ACCEPT_CAPS = GST_QUERY_MAKE_TYPE (160, _FLAG(BOTH)), |
125 | GST_QUERY_CAPS = GST_QUERY_MAKE_TYPE (170, _FLAG(BOTH)), |
126 | GST_QUERY_DRAIN = GST_QUERY_MAKE_TYPE (180, _FLAG(DOWNSTREAM) | _FLAG(SERIALIZED)), |
127 | GST_QUERY_CONTEXT = GST_QUERY_MAKE_TYPE (190, _FLAG(BOTH)), |
128 | GST_QUERY_BITRATE = GST_QUERY_MAKE_TYPE (200, _FLAG(DOWNSTREAM)), |
129 | } GstQueryType; |
130 | #undef _FLAG |
131 | |
132 | GST_API GType _gst_query_type; |
133 | |
134 | #define GST_TYPE_QUERY (_gst_query_type) |
135 | #define GST_IS_QUERY(obj) (GST_IS_MINI_OBJECT_TYPE (obj, GST_TYPE_QUERY)) |
136 | #define GST_QUERY_CAST(obj) ((GstQuery*)(obj)) |
137 | #define GST_QUERY(obj) (GST_QUERY_CAST(obj)) |
138 | |
139 | /** |
140 | * GST_QUERY_TYPE: |
141 | * @query: the query to query |
142 | * |
143 | * Get the #GstQueryType of the query. |
144 | */ |
145 | #define GST_QUERY_TYPE(query) (((GstQuery*)(query))->type) |
146 | |
147 | /** |
148 | * GST_QUERY_TYPE_NAME: |
149 | * @query: the query to query |
150 | * |
151 | * Get a constant string representation of the #GstQueryType of the query. |
152 | */ |
153 | #define GST_QUERY_TYPE_NAME(query) (gst_query_type_get_name(GST_QUERY_TYPE(query))) |
154 | |
155 | /** |
156 | * GST_QUERY_IS_UPSTREAM: |
157 | * @ev: the query to query |
158 | * |
159 | * Check if an query can travel upstream. |
160 | */ |
161 | #define GST_QUERY_IS_UPSTREAM(ev) !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_UPSTREAM) |
162 | /** |
163 | * GST_QUERY_IS_DOWNSTREAM: |
164 | * @ev: the query to query |
165 | * |
166 | * Check if an query can travel downstream. |
167 | */ |
168 | #define GST_QUERY_IS_DOWNSTREAM(ev) !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_DOWNSTREAM) |
169 | /** |
170 | * GST_QUERY_IS_SERIALIZED: |
171 | * @ev: the query to query |
172 | * |
173 | * Check if an query is serialized with the data stream. |
174 | */ |
175 | #define GST_QUERY_IS_SERIALIZED(ev) !!(GST_QUERY_TYPE (ev) & GST_QUERY_TYPE_SERIALIZED) |
176 | |
177 | |
178 | /** |
179 | * GstQuery: |
180 | * @mini_object: The parent #GstMiniObject type |
181 | * @type: the #GstQueryType |
182 | * |
183 | * The #GstQuery structure. |
184 | */ |
185 | struct _GstQuery |
186 | { |
187 | GstMiniObject mini_object; |
188 | |
189 | /*< public > *//* with COW */ |
190 | GstQueryType type; |
191 | }; |
192 | |
193 | /** |
194 | * GstBufferingMode: |
195 | * @GST_BUFFERING_STREAM: a small amount of data is buffered |
196 | * @GST_BUFFERING_DOWNLOAD: the stream is being downloaded |
197 | * @GST_BUFFERING_TIMESHIFT: the stream is being downloaded in a ringbuffer |
198 | * @GST_BUFFERING_LIVE: the stream is a live stream |
199 | * |
200 | * The different types of buffering methods. |
201 | */ |
202 | typedef enum { |
203 | GST_BUFFERING_STREAM, |
204 | GST_BUFFERING_DOWNLOAD, |
205 | GST_BUFFERING_TIMESHIFT, |
206 | GST_BUFFERING_LIVE |
207 | } GstBufferingMode; |
208 | |
209 | #include <gst/gstiterator.h> |
210 | #include <gst/gststructure.h> |
211 | #include <gst/gstformat.h> |
212 | #include <gst/gstpad.h> |
213 | #include <gst/gstallocator.h> |
214 | #include <gst/gsttoc.h> |
215 | #include <gst/gstcontext.h> |
216 | |
217 | GST_API |
218 | const gchar* gst_query_type_get_name (GstQueryType type); |
219 | |
220 | GST_API |
221 | GQuark gst_query_type_to_quark (GstQueryType type); |
222 | |
223 | GST_API |
224 | GstQueryTypeFlags |
225 | gst_query_type_get_flags (GstQueryType type); |
226 | |
227 | |
228 | GST_API |
229 | GType gst_query_get_type (void); |
230 | |
231 | #ifndef GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS |
232 | /* refcounting */ |
233 | static inline GstQuery * |
234 | gst_query_ref (GstQuery * q) |
235 | { |
236 | return GST_QUERY_CAST (gst_mini_object_ref (GST_MINI_OBJECT_CAST (q))); |
237 | } |
238 | |
239 | static inline void |
240 | gst_query_unref (GstQuery * q) |
241 | { |
242 | gst_mini_object_unref (GST_MINI_OBJECT_CAST (q)); |
243 | } |
244 | |
245 | static inline void |
246 | gst_clear_query (GstQuery ** query_ptr) |
247 | { |
248 | gst_clear_mini_object ((GstMiniObject **) query_ptr); |
249 | } |
250 | |
251 | /* copy query */ |
252 | static inline GstQuery * |
253 | gst_query_copy (const GstQuery * q) |
254 | { |
255 | return GST_QUERY_CAST (gst_mini_object_copy (GST_MINI_OBJECT_CONST_CAST (q))); |
256 | } |
257 | #else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */ |
258 | GST_API |
259 | GstQuery * gst_query_ref (GstQuery * q); |
260 | |
261 | GST_API |
262 | void gst_query_unref (GstQuery * q); |
263 | |
264 | GST_API |
265 | void gst_clear_query (GstQuery ** query_ptr); |
266 | |
267 | GST_API |
268 | GstQuery * gst_query_copy (const GstQuery * q); |
269 | #endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */ |
270 | |
271 | /** |
272 | * gst_query_is_writable: |
273 | * @q: a #GstQuery |
274 | * |
275 | * Tests if you can safely write data into a query's structure. |
276 | */ |
277 | #define gst_query_is_writable(q) gst_mini_object_is_writable (GST_MINI_OBJECT_CAST (q)) |
278 | /** |
279 | * gst_query_make_writable: |
280 | * @q: (transfer full): a #GstQuery to make writable |
281 | * |
282 | * Makes a writable query from the given query. |
283 | * |
284 | * Returns: (transfer full): a new writable query (possibly same as @q) |
285 | */ |
286 | #define gst_query_make_writable(q) GST_QUERY_CAST (gst_mini_object_make_writable (GST_MINI_OBJECT_CAST (q))) |
287 | |
288 | #ifndef GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS |
289 | static inline gboolean |
290 | gst_query_replace (GstQuery **old_query, GstQuery *new_query) |
291 | { |
292 | return gst_mini_object_replace (olddata: (GstMiniObject **) old_query, newdata: (GstMiniObject *) new_query); |
293 | } |
294 | |
295 | static inline gboolean |
296 | gst_query_take (GstQuery **old_query, GstQuery *new_query) |
297 | { |
298 | return gst_mini_object_take (olddata: (GstMiniObject **) old_query, |
299 | newdata: (GstMiniObject *) new_query); |
300 | } |
301 | #else /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */ |
302 | GST_API |
303 | gboolean gst_query_replace (GstQuery ** old_query, |
304 | GstQuery * new_query); |
305 | |
306 | GST_API |
307 | gboolean gst_query_take (GstQuery ** old_query, |
308 | GstQuery * new_query); |
309 | #endif /* GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS */ |
310 | |
311 | /* application specific query */ |
312 | |
313 | GST_API |
314 | GstQuery * gst_query_new_custom (GstQueryType type, GstStructure *structure) G_GNUC_MALLOC; |
315 | |
316 | GST_API |
317 | const GstStructure * |
318 | gst_query_get_structure (GstQuery *query); |
319 | |
320 | GST_API |
321 | GstStructure * gst_query_writable_structure (GstQuery *query); |
322 | |
323 | /* position query */ |
324 | |
325 | GST_API |
326 | GstQuery* gst_query_new_position (GstFormat format) G_GNUC_MALLOC; |
327 | |
328 | GST_API |
329 | void gst_query_set_position (GstQuery *query, GstFormat format, gint64 cur); |
330 | |
331 | GST_API |
332 | void gst_query_parse_position (GstQuery *query, GstFormat *format, gint64 *cur); |
333 | |
334 | /* duration query */ |
335 | |
336 | GST_API |
337 | GstQuery* gst_query_new_duration (GstFormat format) G_GNUC_MALLOC; |
338 | |
339 | GST_API |
340 | void gst_query_set_duration (GstQuery *query, GstFormat format, gint64 duration); |
341 | |
342 | GST_API |
343 | void gst_query_parse_duration (GstQuery *query, GstFormat *format, gint64 *duration); |
344 | |
345 | /* latency query */ |
346 | |
347 | GST_API |
348 | GstQuery* gst_query_new_latency (void) G_GNUC_MALLOC; |
349 | |
350 | GST_API |
351 | void gst_query_set_latency (GstQuery *query, gboolean live, GstClockTime min_latency, |
352 | GstClockTime max_latency); |
353 | |
354 | GST_API |
355 | void gst_query_parse_latency (GstQuery *query, gboolean *live, GstClockTime *min_latency, |
356 | GstClockTime *max_latency); |
357 | |
358 | /* convert query */ |
359 | |
360 | GST_API |
361 | GstQuery* gst_query_new_convert (GstFormat src_format, gint64 value, GstFormat dest_format) G_GNUC_MALLOC; |
362 | |
363 | GST_API |
364 | void gst_query_set_convert (GstQuery *query, GstFormat src_format, gint64 src_value, |
365 | GstFormat dest_format, gint64 dest_value); |
366 | |
367 | GST_API |
368 | void gst_query_parse_convert (GstQuery *query, GstFormat *src_format, gint64 *src_value, |
369 | GstFormat *dest_format, gint64 *dest_value); |
370 | /* segment query */ |
371 | |
372 | GST_API |
373 | GstQuery* gst_query_new_segment (GstFormat format) G_GNUC_MALLOC; |
374 | |
375 | GST_API |
376 | void gst_query_set_segment (GstQuery *query, gdouble rate, GstFormat format, |
377 | gint64 start_value, gint64 stop_value); |
378 | |
379 | GST_API |
380 | void gst_query_parse_segment (GstQuery *query, gdouble *rate, GstFormat *format, |
381 | gint64 *start_value, gint64 *stop_value); |
382 | |
383 | /* seeking query */ |
384 | |
385 | GST_API |
386 | GstQuery* gst_query_new_seeking (GstFormat format) G_GNUC_MALLOC; |
387 | |
388 | GST_API |
389 | void gst_query_set_seeking (GstQuery *query, GstFormat format, |
390 | gboolean seekable, |
391 | gint64 segment_start, |
392 | gint64 segment_end); |
393 | |
394 | GST_API |
395 | void gst_query_parse_seeking (GstQuery *query, GstFormat *format, |
396 | gboolean *seekable, |
397 | gint64 *segment_start, |
398 | gint64 *segment_end); |
399 | /* formats query */ |
400 | |
401 | GST_API |
402 | GstQuery* gst_query_new_formats (void) G_GNUC_MALLOC; |
403 | |
404 | GST_API |
405 | void gst_query_set_formats (GstQuery *query, gint n_formats, ...); |
406 | |
407 | GST_API |
408 | void gst_query_set_formatsv (GstQuery *query, gint n_formats, const GstFormat *formats); |
409 | |
410 | GST_API |
411 | void gst_query_parse_n_formats (GstQuery *query, guint *n_formats); |
412 | |
413 | GST_API |
414 | void gst_query_parse_nth_format (GstQuery *query, guint nth, GstFormat *format); |
415 | |
416 | /* buffering query */ |
417 | |
418 | GST_API |
419 | GstQuery* gst_query_new_buffering (GstFormat format) G_GNUC_MALLOC; |
420 | |
421 | GST_API |
422 | void gst_query_set_buffering_percent (GstQuery *query, gboolean busy, gint percent); |
423 | |
424 | GST_API |
425 | void gst_query_parse_buffering_percent (GstQuery *query, gboolean *busy, gint *percent); |
426 | |
427 | GST_API |
428 | void gst_query_set_buffering_stats (GstQuery *query, GstBufferingMode mode, |
429 | gint avg_in, gint avg_out, |
430 | gint64 buffering_left); |
431 | |
432 | GST_API |
433 | void gst_query_parse_buffering_stats (GstQuery *query, GstBufferingMode *mode, |
434 | gint *avg_in, gint *avg_out, |
435 | gint64 *buffering_left); |
436 | |
437 | GST_API |
438 | void gst_query_set_buffering_range (GstQuery *query, GstFormat format, |
439 | gint64 start, gint64 stop, |
440 | gint64 estimated_total); |
441 | |
442 | GST_API |
443 | void gst_query_parse_buffering_range (GstQuery *query, GstFormat *format, |
444 | gint64 *start, gint64 *stop, |
445 | gint64 *estimated_total); |
446 | |
447 | GST_API |
448 | gboolean gst_query_add_buffering_range (GstQuery *query, |
449 | gint64 start, gint64 stop); |
450 | |
451 | GST_API |
452 | guint gst_query_get_n_buffering_ranges (GstQuery *query); |
453 | |
454 | GST_API |
455 | gboolean gst_query_parse_nth_buffering_range (GstQuery *query, |
456 | guint index, gint64 *start, |
457 | gint64 *stop); |
458 | |
459 | /* URI query */ |
460 | |
461 | GST_API |
462 | GstQuery * gst_query_new_uri (void) G_GNUC_MALLOC; |
463 | |
464 | GST_API |
465 | void gst_query_parse_uri (GstQuery *query, gchar **uri); |
466 | |
467 | GST_API |
468 | void gst_query_set_uri (GstQuery *query, const gchar *uri); |
469 | |
470 | GST_API |
471 | void gst_query_parse_uri_redirection (GstQuery *query, gchar **uri); |
472 | |
473 | GST_API |
474 | void gst_query_set_uri_redirection (GstQuery *query, const gchar *uri); |
475 | |
476 | GST_API |
477 | void gst_query_parse_uri_redirection_permanent (GstQuery *query, gboolean * permanent); |
478 | |
479 | GST_API |
480 | void gst_query_set_uri_redirection_permanent (GstQuery *query, gboolean permanent); |
481 | |
482 | /* allocation query */ |
483 | |
484 | GST_API |
485 | GstQuery * gst_query_new_allocation (GstCaps *caps, gboolean need_pool) G_GNUC_MALLOC; |
486 | |
487 | GST_API |
488 | void gst_query_parse_allocation (GstQuery *query, GstCaps **caps, gboolean *need_pool); |
489 | |
490 | /* pools */ |
491 | |
492 | GST_API |
493 | void gst_query_add_allocation_pool (GstQuery *query, GstBufferPool *pool, |
494 | guint size, guint min_buffers, |
495 | guint max_buffers); |
496 | |
497 | GST_API |
498 | guint gst_query_get_n_allocation_pools (GstQuery *query); |
499 | |
500 | GST_API |
501 | void gst_query_parse_nth_allocation_pool (GstQuery *query, guint index, |
502 | GstBufferPool **pool, |
503 | guint *size, guint *min_buffers, |
504 | guint *max_buffers); |
505 | |
506 | GST_API |
507 | void gst_query_set_nth_allocation_pool (GstQuery *query, guint index, |
508 | GstBufferPool *pool, |
509 | guint size, guint min_buffers, |
510 | guint max_buffers); |
511 | |
512 | GST_API |
513 | void gst_query_remove_nth_allocation_pool (GstQuery *query, guint index); |
514 | |
515 | /* allocators */ |
516 | |
517 | GST_API |
518 | void gst_query_add_allocation_param (GstQuery *query, GstAllocator *allocator, |
519 | const GstAllocationParams *params); |
520 | |
521 | GST_API |
522 | guint gst_query_get_n_allocation_params (GstQuery *query); |
523 | |
524 | GST_API |
525 | void gst_query_parse_nth_allocation_param (GstQuery *query, guint index, |
526 | GstAllocator **allocator, |
527 | GstAllocationParams *params); |
528 | |
529 | GST_API |
530 | void gst_query_set_nth_allocation_param (GstQuery *query, guint index, |
531 | GstAllocator *allocator, |
532 | const GstAllocationParams *params); |
533 | |
534 | GST_API |
535 | void gst_query_remove_nth_allocation_param (GstQuery *query, guint index); |
536 | |
537 | /* metadata */ |
538 | |
539 | GST_API |
540 | void gst_query_add_allocation_meta (GstQuery *query, GType api, const GstStructure *params); |
541 | |
542 | GST_API |
543 | guint gst_query_get_n_allocation_metas (GstQuery *query); |
544 | |
545 | GST_API |
546 | GType gst_query_parse_nth_allocation_meta (GstQuery *query, guint index, |
547 | const GstStructure **params); |
548 | |
549 | GST_API |
550 | void gst_query_remove_nth_allocation_meta (GstQuery *query, guint index); |
551 | |
552 | GST_API |
553 | gboolean gst_query_find_allocation_meta (GstQuery *query, GType api, guint *index); |
554 | |
555 | |
556 | /* scheduling query */ |
557 | /** |
558 | * GstSchedulingFlags: |
559 | * @GST_SCHEDULING_FLAG_SEEKABLE: if seeking is possible |
560 | * @GST_SCHEDULING_FLAG_SEQUENTIAL: if sequential access is recommended |
561 | * @GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED: if bandwidth is limited and buffering possible (since 1.2) |
562 | * |
563 | * The different scheduling flags. |
564 | */ |
565 | typedef enum { |
566 | GST_SCHEDULING_FLAG_SEEKABLE = (1 << 0), |
567 | GST_SCHEDULING_FLAG_SEQUENTIAL = (1 << 1), |
568 | GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED = (1 << 2) |
569 | } GstSchedulingFlags; |
570 | |
571 | GST_API |
572 | GstQuery * gst_query_new_scheduling (void) G_GNUC_MALLOC; |
573 | |
574 | GST_API |
575 | void gst_query_set_scheduling (GstQuery *query, GstSchedulingFlags flags, |
576 | gint minsize, gint maxsize, gint align); |
577 | |
578 | GST_API |
579 | void gst_query_parse_scheduling (GstQuery *query, GstSchedulingFlags *flags, |
580 | gint *minsize, gint *maxsize, gint *align); |
581 | |
582 | GST_API |
583 | void gst_query_add_scheduling_mode (GstQuery *query, GstPadMode mode); |
584 | |
585 | GST_API |
586 | guint gst_query_get_n_scheduling_modes (GstQuery *query); |
587 | |
588 | GST_API |
589 | GstPadMode gst_query_parse_nth_scheduling_mode (GstQuery *query, guint index); |
590 | |
591 | GST_API |
592 | gboolean gst_query_has_scheduling_mode (GstQuery *query, GstPadMode mode); |
593 | |
594 | GST_API |
595 | gboolean gst_query_has_scheduling_mode_with_flags (GstQuery * query, GstPadMode mode, |
596 | GstSchedulingFlags flags); |
597 | |
598 | /* accept-caps query */ |
599 | |
600 | GST_API |
601 | GstQuery * gst_query_new_accept_caps (GstCaps *caps) G_GNUC_MALLOC; |
602 | |
603 | GST_API |
604 | void gst_query_parse_accept_caps (GstQuery *query, GstCaps **caps); |
605 | |
606 | GST_API |
607 | void gst_query_set_accept_caps_result (GstQuery *query, gboolean result); |
608 | |
609 | GST_API |
610 | void gst_query_parse_accept_caps_result (GstQuery *query, gboolean *result); |
611 | |
612 | /* caps query */ |
613 | |
614 | GST_API |
615 | GstQuery * gst_query_new_caps (GstCaps *filter) G_GNUC_MALLOC; |
616 | |
617 | GST_API |
618 | void gst_query_parse_caps (GstQuery *query, GstCaps **filter); |
619 | |
620 | GST_API |
621 | void gst_query_set_caps_result (GstQuery *query, GstCaps *caps); |
622 | |
623 | GST_API |
624 | void gst_query_parse_caps_result (GstQuery *query, GstCaps **caps); |
625 | |
626 | /* drain query */ |
627 | |
628 | GST_API |
629 | GstQuery * gst_query_new_drain (void) G_GNUC_MALLOC; |
630 | |
631 | /* context query */ |
632 | |
633 | GST_API |
634 | GstQuery * gst_query_new_context (const gchar * context_type) G_GNUC_MALLOC; |
635 | |
636 | GST_API |
637 | gboolean gst_query_parse_context_type (GstQuery * query, const gchar ** context_type); |
638 | |
639 | GST_API |
640 | void gst_query_set_context (GstQuery *query, GstContext *context); |
641 | |
642 | GST_API |
643 | void gst_query_parse_context (GstQuery *query, GstContext **context); |
644 | |
645 | /* bitrate query */ |
646 | |
647 | GST_API |
648 | GstQuery * gst_query_new_bitrate (void) G_GNUC_MALLOC; |
649 | |
650 | GST_API |
651 | void gst_query_set_bitrate (GstQuery * query, guint nominal_bitrate); |
652 | |
653 | GST_API |
654 | void gst_query_parse_bitrate (GstQuery * query, guint * nominal_bitrate); |
655 | |
656 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstQuery, gst_query_unref) |
657 | |
658 | G_END_DECLS |
659 | |
660 | #endif /* __GST_QUERY_H__ */ |
661 | |
662 | |