Commit graph

128 commits

Author SHA1 Message Date
Mathieu Duponchelle
4456792218 adapter: port the buffer list from GSList to GstQueueArray
Significantly reduces the amount of memory allocation operations.

https://bugzilla.gnome.org/show_bug.cgi?id=795167
2018-04-14 01:20:38 +02:00
Sebastian Dröge
733de3190b adapter: Check if meta transform_func is NULL before using it
https://bugzilla.gnome.org/show_bug.cgi?id=782050
2017-05-02 14:27:14 +03:00
Tim-Philipp Müller
519d64881f Don't use deprecated g_object_newv()
Use g_object_new() instead which nowadays has a shortcut for the
no-properties check. It still does an extra GType check in the
function guard, but there's a pending patch to remove that
and it's hardly going to be a performance issue in practice,
even less so on a system that's compiled without run-time checks.

Alternative would be to move to the new g_object_new_properties()
with a fallback define for older glib versions, but it makes the
code look more unwieldy and doesn't seem worth it.

Fixes deprecation warnings when building against newer GLib versions.

https://bugzilla.gnome.org/show_bug.cgi?id=780903
2017-04-08 09:49:59 +01: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
Nicolas Huet
9cd2677791 adapter: fix distance when getting prev pts/dts at offset
https://bugzilla.gnome.org/show_bug.cgi?id=765662
2016-11-11 18:18:23 +00:00
Jesper Larsen
9ae7f465a5 adapter: Fix mix-up between DTS and PTS
https://bugzilla.gnome.org/show_bug.cgi?id=773319
2016-10-21 16:47:22 +03:00
Sebastian Dröge
8c7da1d426 adapter: Rename functions and implement new functions, update test
We don't do calculations with different units (buffer offsets and bytes)
anymore but have functions for:
1) getting the number of bytes since the last discont
2) getting the offset (and pts/dts) at the last discont

and the previously added function to get the last offset and its distance from
the current adapter position.

https://bugzilla.gnome.org/show_bug.cgi?id=766647
2016-06-10 09:49:33 +03:00
Edward Hervey
67ae0ad225 adapter: Add methods to query current offset
API: gst_buffer_prev_offset
API: gst_buffer_get_offset_from_discont

The gst_buffer_get_offset_from_discont() method allows retrieving the current
offset based on the GST_BUFFER_OFFSET of the buffers that were pushed in.

The offset will be set initially by the GST_BUFFER_OFFSET of
DISCONT buffers, and then incremented by the sizes of the following
buffers.

The gst_buffer_prev_offset() method allows retrievent the previous
GST_BUFFER_OFFSET regardless of flags. It works in the same way as
the other gst_buffer_prev_*() methods.

https://bugzilla.gnome.org/show_bug.cgi?id=766647
2016-06-10 09:49:33 +03:00
Evan Nemerson
d11e657412 docs: annotate C examples as such
https://bugzilla.gnome.org/show_bug.cgi?id=731292
2016-02-15 17:45:15 +00:00
Hyunjun Ko
427400be1d adapter: change log message properly
https://bugzilla.gnome.org/show_bug.cgi?id=752116
2015-07-10 10:46:38 +03:00
Hyunjun Ko
af62e2874f adapter: fix to get valid (buffer_)list
get_list/get_buffer_list should be done with buffers in adapter remaining
while take_list/take_buffer_list flushes each buffer one by one.

https://bugzilla.gnome.org/show_bug.cgi?id=752116
2015-07-08 18:59:31 +03:00
Sebastian Dröge
fefd4622a3 adapter: Also copy POOL metas and make sure to copy over metas when creating subbuffers
POOL meta just means that this specific instance of the meta is related to a
pool, a copy should be made when reasonable and the flag should just not be
set in the copy.
2015-07-01 10:45:01 +02:00
Sebastian Dröge
866f9ace5c adapter: Add get variants of the buffer based take functions
Main difference to gst_adapter_map() for all practical purposes is that
GstMeta of the buffers will be preserved.

https://bugzilla.gnome.org/show_bug.cgi?id=742385
2015-06-30 18:40:28 +02:00
Sebastian Dröge
e6757269db adapter: Copy over GstMeta from the input buffers to the output
All functions that return a GstBuffer or a list of them will now copy
all GstMeta from the input buffers except for meta with GST_META_FLAG_POOLED
flag or "memory" tag.

This is similar to the existing behaviour that the caller can't assume
anything about the buffer flags, timestamps or other metadata. And it's
also the same that gst_adapter_take_buffer_fast() did before, and what
gst_adapter_take_buffer() did if part of the first buffer or the complete
first buffer was requested.

https://bugzilla.gnome.org/show_bug.cgi?id=742385
2015-06-30 18:40:28 +02:00
Tim-Philipp Müller
2b4d066355 adapter: minor optimisation for gst_adapter_take_buffer_list()
Try to allocate buffer list with a suitable size from the
beginning to avoid having to re-alloc the buffer list array.
2015-03-14 21:09:45 +00:00
Tim-Philipp Müller
e6a0f52e3c adapter: add gst_adapter_take_buffer_list()
API: gst_adapter_take_buffer_list()
2015-03-14 17:22:22 +00:00
Tim-Philipp Müller
4a1cee3c44 adapter: avoid multiple calls to gst_buffer_get_size() in macro 2015-03-14 16:02:03 +00:00
Luis de Bethencourt
c42b525848 doc: Do not use deprecated gtk-doc 'Rename to' tag
GObject introspection GTK-Doc tag "Rename to" has been deprecated, changing to
rename-to annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=739514
2014-11-02 15:17:57 +00:00
Evan Nemerson
eebff7b048 base: assorted introspection fixes and additions
https://bugzilla.gnome.org/show_bug.cgi?id=731542
2014-06-26 18:55:26 +02:00
Evan Nemerson
c38f3254f8 base: add (nullable) annotations to return values
https://bugzilla.gnome.org/show_bug.cgi?id=731542
2014-06-26 18:55:25 +02:00
Evan Nemerson
25af4ad652 base: use correct syntax in documentation more consistently
Previously, many constants were prefixed with # or unprefixed,
some functions and macros were prefixed with # instead of suffixed
with (), etc.

https://bugzilla.gnome.org/show_bug.cgi?id=731293
2014-06-06 15:09:21 -04:00
Tim-Philipp Müller
6eb6d9ec38 docs: remove outdated and pointless 'Last reviewed' lines from docs
They are very confusing for people, and more often than not
also just not very accurate. Seeing 'last reviewed: 2005' in
your docs is not very confidence-inspiring. Let's just remove
those comments.
2014-04-26 21:21:51 +01:00
Edward Hervey
456f28cc61 adapter: Remove always-true-checks
a gsize is guaranteed to be positive on all systems since it's an
unsigned value.

CID #1037145
CID #1037146
2014-04-05 11:44:01 +02:00
Sebastian Rasmussen
3de939cb5b adapter: Adapt gst_adapter_copy() for bindings
This is done by introducing a new gst_adapter_copy_bytes() call that
returns a GBytes structure.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=725476
2014-03-15 13:16:16 +01:00
Olivier Crête
915f418cc4 adapter: Take account of the skip in gst_adapter_take_buffer_fast()
Include regression test
2013-07-16 15:38:11 -04:00
Olivier Crête
5920491597 adapter: Add function to return buffer composed of multiple memories
API: gst_adapter_take_fast()
2013-07-16 14:07:48 -04:00
David Schleef
da68b74b5d adapter: Add gst_adapter_prev_[pd]ts_at_offset()
Original patch written by Michael Smith <msmith@rdio.com>.

API: gst_adapter_prev_pts_at_offset()
API: gst_adapter_prev_dts_at_offset()
2013-02-12 12:16:27 -08:00
Tim-Philipp Müller
e90d2710b3 docs: add a note to the gst_adapter_take_buffer() docs about buffer flags
https://bugzilla.gnome.org/show_bug.cgi?id=682110
2013-01-16 17:24:42 +00:00
Wim Taymans
bac5ba632e adapter: handle map failure 2013-01-14 17:00:23 +01:00
Thijs Vermeir
67fab5eaa5 adapter: return gssize from gst_adapter_masked_scan_* functions
As the return value of this function is -1 when the match is not found
2013-01-02 10:40:38 +01:00
Wim Taymans
98d084df69 adapter: fix 0.10 docs to make more sense in 1.0 2012-12-05 14:24:14 +01:00
Wim Taymans
89d6ac116c adapter: fix docs for 1.0
Add parent to chain function signature and use it.
2012-12-05 14:03:27 +01:00
Tim-Philipp Müller
abc805ca95 tests: gst_adapter_prev_timestamp -> gst_adapter_prev_pts
https://bugzilla.gnome.org/show_bug.cgi?id=675598
2012-11-13 23:11:34 +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
Edward Hervey
d3ffa82639 Remove 0.10-related documentation and "Since" markers 2012-07-10 12:03:27 +02:00
Evan Nemerson
4705eb61c3 adapter: add missing element-type annotations 2012-06-18 13:18:32 +02:00
Sreerenj Balachandran
b4ecac2c98 gstadapter: Align the comment description with public api instead of internal one.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=677536
2012-06-06 15:44:36 +02:00
Wim Taymans
1b87a07d8e adapter: remove _try_to_merge_up()
It causes the timestamp to go wrong, should not cause much of a performance
increase and in the cases where it is faster, it is broken in 0.10 as well.
We should try to review this when rewriting the adapter for 0.11 memory
features.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674791
2012-05-01 10:50:32 +02:00
Wim Taymans
aad3812633 adapter: make internals private
Make the adapter fields private.
2012-05-01 09:32:45 +02:00
Mark Nauwelaerts
6a48006c21 adapter: refresh skip following merge_up attempt
... as the latter might now adjust skip as well.
2012-04-23 16:57:21 +02:00
Mark Nauwelaerts
9bcb0ea58e adapter: ensure writable head buffer before skipping part of it 2012-04-17 12:54:45 +02:00
Matej Knopp
4e7cf4c5c1 Remove skipped part of buffer when mapping the adapter
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=674085
2012-04-14 10:25:12 +02:00
Wim Taymans
d89719a4b3 adapter: use buffer_wrap 2012-03-31 18:34:23 +02:00
Wim Taymans
38b96e6c8c buffer: improve the buffer memory methods
gst_buffer_take_memory -> gst_buffer_insert_memory because insert is what the
method does.
Make all methods deal with ranges so that we can replace, merge, remove and map
a certain subset of the memory in a buffer. With the new methods we can make
some code nicer and reuse more code. Being able to deal with a subset of the
buffer memory allows us to optimize more cases later (most notably RTP headers
and payload that could be in different memory objects).
Make some more convenient macros that call the more generic range methods.
2012-03-30 18:15:24 +02:00
Wim Taymans
bb876588ac buffer: unify buffer merge methods
Add gst_buffer_append() which appends the memory blocks from one buffer to
another. Remove the old inefficient _merge() and _join() methods which forced a
premature memcpy in most cases.
Remove the _is_span() and _span() methods they are not needed anymore now that
we can _append(). Merging and spanning will be delayed until mapping or maybe
not at all when the element can deal with the different memory blocks.
2012-03-28 12:51:58 +02:00
Wim Taymans
f3f209c919 adapter: add some performance debug 2012-03-20 17:11:12 +01:00
Wim Taymans
d8578d5c09 adapter: add more debug 2012-03-14 12:42:00 +01:00
Wim Taymans
7b0e4f27fb memory: make _new_wrapped take user_data and notify
Make it possible to configure a GDestroyNotify and user_data for
gst_memory_new_wrapped() this allows for more flexible wrapping of foreign
memory blocks.
2012-02-22 02:10:21 +01:00
Wim Taymans
39c5f0b28a don't do logic in g_assert... 2012-01-31 12:10:21 +01:00
Wim Taymans
a521252845 Add new GstMapInfo
Use a structure to hold info about the mapping. The application then keeps track
of this state and we can use it to unmap the memory again later.
2012-01-25 11:54:23 +01:00