Commit graph

26 commits

Author SHA1 Message Date
Sebastian Dröge
fc3602aec8 queuearray: Only clear dropped item if it is not returned 2018-10-15 18:47:16 +03:00
Sebastian Dröge
2481e542c7 queuearray: Clear items when dropping them and a clear function was defined 2018-10-15 15:28:35 +03:00
Vivia Nikolaidou
22d0f40716 queuearray: Add set_clear_func and clear functions
gst_queue_array_clear will clear the GstQueueArray,
gst_queue_array_set_clear_func will set a clear function for each
element to be called on _clear and on _free.

https://bugzilla.gnome.org/show_bug.cgi?id=797218
2018-09-27 19:32:54 +03:00
Tim-Philipp Müller
57c8e0146f libs: figure out right export define in configure
Add new GST_API_EXPORT in config.h and use that for GST_*_API
decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:39:37 +01:00
Mathieu Duponchelle
03e27aa5f0 API: gst_queue_array_peek_nth
https://bugzilla.gnome.org/show_bug.cgi?id=795157
2018-04-14 00:14:56 +02:00
Mathieu Duponchelle
68761eecae gstqueuearray: make find() return a 0-based index
And make the drop() functions expect a 0-based index too,
this addresses a longstanding FIXME. This will not break
backward compatibility, because the drop() functions
were previously only meant to be used with the index
returned by find().

https://bugzilla.gnome.org/show_bug.cgi?id=795156
2018-04-14 00:01:35 +02:00
Sebastian Dröge
89eac59e92 queuearray: Implement pop_tail_struct() for completeness
All other variants of {peek,pop}_{head,tail}_{,struct} were already
implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=794035
2018-03-05 09:39:57 +02:00
Olivier Crête
23b32d5600 queue: Ignore thresholds if a query is queued
The queue gets filled by the tail, so a query will always be the tail
object, not the head object. Also add a _peek_tail_struct() method to the
GstQueueArray to enable looking at the tail.

With unit test to prevent future regression.

https://bugzilla.gnome.org/show_bug.cgi?id=762875
2018-03-01 16:31:57 -05:00
Tim-Philipp Müller
bbf8f50cde queuearray: add _peek_tail() and _pop_tail()
API: gst_queue_array_pop_tail()
API: gst_queue_array_peek_tail()

These will be needed later for appsrc.
2018-02-19 15:44:04 +00:00
Ashish Kumar
250d3e7284 queuearray: Fix for possible crashes due to null pointer dereferencing
https://bugzilla.gnome.org/show_bug.cgi?id=788838
2017-10-16 14:04:58 +03:00
Thibault Saunier
a87b4551a6 Port gtk-doc comments to their equivalent markdown syntax
Modernizing our documentation and preparing a possible move to hotdoc.
This commits also adds missing @title metadatas to all SECTIONs
2017-01-27 16:36:38 -03:00
Tim-Philipp Müller
d0f85838ab queuearray: allow storing of structs in addition to pointers
This way we don't have to allocate/free temporary structs
for storing things in the queue array.

API: gst_queue_array_new_for_struct()
API: gst_queue_array_push_tail_struct()
API: gst_queue_array_peek_head_struct()
API: gst_queue_array_pop_head_struct()
API: gst_queue_array_drop_struct()

https://bugzilla.gnome.org/show_bug.cgi?id=750149
2015-07-04 11:03:51 +01:00
Tim-Philipp Müller
828ceacc68 queuearray: remove duplicate assignment
We've already done this earlier in the function,
and nothing has changed since we first read it.
2015-05-30 12:40:44 +01:00
Sebastian Dröge
0d5177b5fe queuearray: Hide from bindings
Other languages have their own data structures that are more convenient to use.

https://bugzilla.gnome.org/show_bug.cgi?id=731350
2014-06-26 19:32:18 +02:00
Evan Nemerson
1cd4bd64b0 queuearray: fix expanding size of queue from 1
Without we would not actually expand and access
memory beyond the allocated region for the array.

https://bugzilla.gnome.org/show_bug.cgi?id=731349
2014-06-07 09:45:39 +01:00
Tim-Philipp Müller
a6010a9155 docs: fix docs for gst_queue_array_peek_head() 2013-12-14 18:31:38 +00:00
Sebastian Rasmussen
53ae1b2c9c docs: Fix typos in function/object descriptions
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=720029
2013-12-07 17:11:12 +00:00
Sebastian Rasmussen
b40fa2b8c3 docs: cosmetic changes in references/decriptions
* fix typo GstBufferFlag -> GstBufferFlags
 * fix typo GstFeatures -> GstCapsFeatures
 * fix typo GstAllocatorParams -> GstAllocationParams
 * fix typo GstContrlSources -> GstControlSource
 * do not refer to gstcheck as an object
 * make references gtk_init() and tcase_set_timeout() not be references
 * gst_element_get_pad() renamed gst_element_get_static_pad()
 * gst_clock_id_wait_async_full() renamed gst_clock_id_wait_async()
 * _drop_element() is really gst_queue_array_drop_element()
 * gst_pad_accept_caps() was removed, do not refer to it
 * separate GST_META_TAG_MEMORY_STR declaration from description
 * do not describe removed gst_collect_pads_collect()
 * correctly link to GstElementClass' virtual set_context()

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=719614
2013-12-02 21:01:08 +00:00
Tim-Philipp Müller
9f669e5ea5 docs: cosmetic since marker fixes 2013-11-16 16:09:40 +00:00
Tim-Philipp Müller
ae8940e6f7 queuearray: make _find() find the value if no compare function is provided
Allow NULL as compare function for direct value lookup.

https://bugzilla.gnome.org/show_bug.cgi?id=692691
2013-01-30 12:07:52 +00:00
Alexander Schrab
5a7c1b56dc queuearray: fix gst_queue_array_find()
https://bugzilla.gnome.org/show_bug.cgi?id=692691
2013-01-30 11:24:55 +00:00
Alexander Schrab
af8ff1bed8 queuearray: fix gst_queue_array_drop_element()
https://bugzilla.gnome.org/show_bug.cgi?id=692691

Conflicts:
	libs/gst/base/gstqueuearray.c
2013-01-30 11:24:35 +00:00
Tim-Philipp Müller
666c8c11c6 Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 20:44:48 +00:00
Sebastian Dröge
09982c3c13 dataqueue/queuearray: Make public API again
These are actually used outside of coreelements nowadays.
Also hide lots of internals and add padding and documentation.
2012-10-25 14:03:01 +02:00
Tim-Philipp Müller
94f6ba9c0b base: make GstQueueArray private to coreelements for now
Keep it private until we have a reason to make it public.
2012-07-14 19:36:02 +01:00
Edward Hervey
588cdcd369 libs: New growing-only queue.
This is a queue which has the same API as GQueue, except that:
* It uses an array, instead of a doubled-linked-list
* The array can only grow.

This code is not-threadsafe. It is up to the owner to make sure the
proper locking is taken before calling this API.
2012-07-04 17:46:53 +02:00