Commit graph

104 commits

Author SHA1 Message Date
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
Mark Nauwelaerts
ea2f87d34e adapter: ensure automagic _unmap in some more cases 2012-01-13 14:21:27 +01:00
Vincent Penquerc'h
12757e604a adapter: automatically unmap on clearing
When _clear gets called between _map and _unmap, buffers
will be unreffed. If the adapter was mapped, memory leaks
may occur.
While calling _clear between _map and _unmap does not seem
like such a great idea, this is possible in the audio
encoder base class, as _clear may be called in _finish_frame.
Since the audio encoder relies on flushing to keep track of
timestamps, delaying flushing till after handle_frame seems
dangerous.
So, we unmap on clear, as the next unmap will do nothing.
This makes _clear safe to call between _map and _unmap,
while avoiding leaking the mapped buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=664133
2012-01-13 14:21:27 +01:00
Matej Knopp
f33b1397d3 adapter: fix return type of _map() to gconstpointer
Fixes compiler warnings on OSX:
gstadapter.h:82: warning: type qualifiers ignored on function return type
gstadapter.c:412: warning: type qualifiers ignored on function return type

const gpointer is not the same as gconstpointer or const void *.

https://bugzilla.gnome.org/show_bug.cgi?id=664491
2011-11-22 11:53:42 +00:00
Wim Taymans
4b216bf73a adapter: remove flush from _unmap 2011-11-10 18:18:24 +01:00
Wim Taymans
c5ef50d4de adapter: use gpointer for return types 2011-11-10 11:42:26 +01:00
Wim Taymans
f1b07c580e Merge branch 'master' into 0.11
Conflicts:
	common
	configure.ac
2011-11-02 10:29:04 +01:00
Tim-Philipp Müller
cf69ce1df6 adapter: simplify gst_adapter_take_list()
Use a stack-allocated GQueue to assemble our GList.
2011-11-01 14:17:21 +00:00
Wim Taymans
a495701900 adapter: use pts/dts on buffers 2011-10-28 12:26:28 +02:00
Josep Torra
178bdccb76 Fix and clarify debug statements
Fixes build on MacOSX

Signed-off-by: Edward Hervey <edward.hervey@collabora.co.uk>
2011-08-10 11:01:58 +02:00
Wim Taymans
54fd50bfe1 buffer: add index to _take_memory()
Add an index to gst_buffer_take_memory() so that we can also insert memory at a
certain offset. This is mostly interesting to prepend a header memory block to
the buffer.
2011-06-13 16:31:53 +02:00
Tim-Philipp Müller
4b920eb5d2 docs: update for API changes
Also remove GST_PAD_CHECKGETRANGEFUNC macro
2011-06-05 18:57:56 +01:00
Sebastian Dröge
7da7494adc base: Use G_DEFINE_TYPE instead of GST_BOILERPLATE 2011-04-19 11:45:36 +02:00
Wim Taymans
ebb14d95b2 buffer: more API tweaks
_trim -> _resize
_create_sub -> copy_region
2011-03-30 16:47:55 +02:00
Wim Taymans
beac9c4a95 buffer: fix remaining unit tests 2011-03-28 20:08:46 +02:00
Wim Taymans
121ab46aa6 memory: remove memory metadata again 2011-03-28 20:08:46 +02:00
Wim Taymans
38ffe30745 memory: more work on implementing buffer memory 2011-03-28 20:08:46 +02:00
Wim Taymans
d82c8bd2af memory: port code to new buffer data API 2011-03-28 20:08:45 +02:00
Tim-Philipp Müller
686b16756d docs: libgstbase: more gobject introspection annotations
Many of these are superfluous and were added for clarity.
2010-12-07 18:37:04 +00:00
Wim Taymans
19e5a54c9f adapter: improve docs a little. 2010-12-02 19:10:45 +01:00
Tim-Philipp Müller
5b25761f29 docs: add some gtk-doc Since: markers
Add some gtk-doc Since: markers, fix one Since: marker,
fix typo.
2010-10-16 16:53:49 +01:00
Stefan Kost
ad2e7b1de3 docs: use the gtk-doc shortcuts to get coloured and xrefed example 2010-10-11 16:44:01 +03:00
David Schleef
9dbe690f72 adapter: Add check for pattern bits not in mask 2010-09-18 19:29:09 -07:00
Wim Taymans
1afaa1680f adapter: add function to get a list of buffers
Add a function to retrieve a list of buffers containing the first N bytes from
the adapter. This can be done without a memcpy and should make it possible to
transfer the list to a GstBufferList later.
2010-09-17 17:35:41 +02:00
Wim Taymans
a144882871 adapter: reuse more data in _peek()
Optimize _peek() some more by reusing already assembled data when we can.
2010-09-17 15:07:50 +02:00