Commit graph

259 commits

Author SHA1 Message Date
Wim Taymans a46f0862cd gst: improve debugging 2012-02-06 09:46:47 +01:00
Wim Taymans d8c12ceb2b memory: add some performce debug info
Add some PERFORMANCE debug lines where we copy and do other suboptimal things.
2012-02-02 12:07:28 +01:00
Wim Taymans af2fc026fc memory: make the allocator refcounted
Add refcounting to the GstAllocator object.
Remove const from functions because the allocator is refcounted now.
Rename the vmethods for consistency
Expose the constructor for GstAllocator and add a destroy notify for the
user_data. This should make it possible to create allocators that are not
registered and shared globally along with the possibility to destroy them
properly.
Update defs with new symbols.
2012-01-30 13:20:36 +01:00
Wim Taymans 93074b899c memory: add method to create mapped memory
Add a method to create a GstMemory with the desired mapping. Makes a copy of the
memory if it is currently in use.
2012-01-25 11:54:23 +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
Wim Taymans a1d7bd02e4 memory improvements
Make the memory object simply manage the data pointer and the maxsize and move
the offset and size handling to common functionality.
Use the READONLY flag to set a readonly lock.
Remove the data and size fields from the unmap method. We need an explicit
resize operation instead of using the unmap function.
Make internal helper lock and unlock functions.
Update unit test and users of the old API.
2012-01-19 12:51:41 +01:00
Wim Taymans c96d5a330c memory: make writability check into a method
Use a method to check for writability instead of a macro so that we can change
the implementation more easily.
2012-01-16 15:57:35 +01:00
Wim Taymans 0ca5115722 buffer: improve docs 2012-01-16 12:24:20 +01:00
Wim Taymans ad9450e1c0 buffer: ensure writable memory in memset 2012-01-06 13:32:55 +01:00
Wim Taymans 87ada5664a buffer: add foreach function for the metadata 2011-12-22 16:02:05 +01:00
Wim Taymans 4bc7ff8e3e meta: add metadata flags
Add metadata flags so that we can set extra properties of the metadata
2011-12-22 16:02:05 +01:00
Wim Taymans dc23684b12 buffer: add copy flag for meta
Add a flag to control if the meta should be copied or not instead of always
copying.
2011-12-01 15:34:06 +01:00
Wim Taymans 5be6ad56a5 buffer: avoid < -1 sizes 2011-11-11 10:00:35 +01:00
Tim-Philipp Müller 541d79d886 buffer, memory: make size arguments where -1 is allowed signed 2011-11-11 01:47:30 +00:00
Vincent Penquerc'h 86a45f236e gstbuffer: remove incorrect assertion
Offset and sizes have no bearing on each other here.
2011-11-10 14:17:33 +00:00
Edward Hervey 7a285354d2 gst: More introspection annotations 2011-11-10 13:54:03 +01:00
Wim Taymans 79aeef49b8 buffer: update docs 2011-11-08 13:13:55 +01:00
Stefan Sauer 93941a2517 buffer: improve parameter docs 2011-11-08 09:15:30 +01:00
Wim Taymans 80fc568747 buffer: add pts/dts to buffers 2011-10-28 12:15:44 +02:00
Wim Taymans 90a4f75650 buffer: improve docs 2011-10-04 18:55:09 +02:00
Wim Taymans 8a1f401dfd docs: fix docs 2011-09-26 20:47:35 +02:00
Wim Taymans a952de69dd miniobject: change to GST_DEFINE_MINI_OBJECT_TYPE
Append _TYPE to the macro for consistency with other similar macros.
2011-08-29 17:06:18 +02:00
Wim Taymans f3b0d3cdbe init: add _get_type() functions
Remove gst_mini_object_register() and add a GST_DEFINE_MINI_OBJECT macro to
define a _get_type() function for the boxed miniobject.
Remove a bunch of custom _get_type() functions and replace them with the
miniobject macro.
Rename some _init method to _priv_*_initialize() like the rest of them.

Inspired by patch from Johan Dahlin and see bug #657603
2011-08-29 15:34:30 +02:00
Wim Taymans 4145598972 gst: add some _priv prefixes to private methods 2011-08-29 13:27:26 +02:00
Wim Taymans b5ef693e88 buffer: always copy all buffer flags when asked
Don't try to be smart and copy only a subset of buffer flag
2011-08-25 16:20:21 +02:00
Wim Taymans aefa1c67f8 buffer: return processed number of bytes
Make _fill, _extract and _memset return the actual number of bytes that were
handled in case the buffer size is less than the specified size.
2011-08-16 18:29:29 +02:00
Wim Taymans 8698a8c94e buffer: rename PREROLL -> LIVE flag
Rename the GST_BUFFER_FLAG_PREROLL to GST_BUFFER_FLAG_LIVE and give the new flag
a meaning. The old PREROLL flag never had a clear meaning.
2011-08-16 17:32:20 +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
Edward Hervey 2d4ddc3a08 gstbuffer: Clarify doc 2011-08-08 11:51:26 +02:00
Wim Taymans ee235a6b07 miniobject: avoid race in bufferpool release
Avoid playing with the refcount to decide when a buffer has been recycled by the
dispose function. The problem is that we then temporarily can have a buffer with
a refcount > 1 being acquired from the pool, which is not writable. Instead use
a simple boolean return value from the dispose function to inform the called
that the object was recycled or not.
2011-07-25 12:53:10 +02:00
Wim Taymans cc16dd8498 buffer: improve debug message 2011-07-15 11:51:54 +02:00
Wim Taymans 1a3f48f427 buffer: fix resize function some more
Don't remove memory blocks from the buffer when we clip and resize, instead set
the memory offset and size to 0. This allows us to make the buffer larger again
later.
2011-07-12 14:07:57 +02:00
Wim Taymans a19baf77e7 buffer: improve size handling
Also handle the case where multiple empty memory blocks are in the buffer.
Add unit test for this.
2011-07-12 13:40:35 +02:00
Wim Taymans a5ee20db3f buffer: fix _resize some more
Add more debug.
Alow resize to 0 bytes.
Do clipping correctly.
Add more unit tests. Also add a failing test: when we resize to 0 and then
try to resize back to the original size it fails because the memory was
removed.
2011-07-12 12:00:58 +02:00
Wim Taymans 8461249f22 buffer: fix negative offsets some more
Allow for negative offsets when doing memory copy and share.
Add fast path in the _get_sizes() function.
Fix resize for negative offset and expanding the buffer.
Add some unit tests.
2011-07-11 18:00:52 +02:00
Wim Taymans 6b3572feab buffer: fix _resize better 2011-07-11 16:42:56 +02:00
Wim Taymans abf6293639 buffer: add api to get the current memory offset
Also return the offset in a GstMemory block with the get_sizes() method. This
allows us to figure out how much prefix there is unused.
Change the resize function so that a negative offset can be given. This would
make it possible to resize the buffer so that the prefix becomes available.
Add gst_buffer_get_sizes() to return the offset and maxsize as well as the size.
Also change the buffer resize method so that we can specify a negative offset
to remove prefix bytes.
2011-07-11 16:24:16 +02:00
Mark Nauwelaerts 21e0d113cf buffer: add some memory wrapped buffer allocation helpers 2011-07-11 14:43:19 +02:00
Tim-Philipp Müller 75c81c2120 buffer: make idx argument to gst_buffer_take_memory() signed
Since -1 is acceptable, it should be signed.
2011-07-08 13:53:35 +01:00
Wim Taymans 806cf03fbc buffer: add memset function 2011-07-07 11:02:09 +02:00
Tim-Philipp Müller a1f6e02149 buffer: fix guards for gst_buffer_take_memory()
Since idx = -1 makes it default to idx=len, len is also
a valid input idx.
2011-07-06 12:09:28 +01:00
Wim Taymans 3884badea6 memory: rename GstMemoryAllocator -> GstAllocator
simplify the name of the allocator object.
2011-06-22 11:42:46 +02:00
Thiago Santos 00c891a823 gstbuffer: Minor fix to docs
Adds missing parameter to docs of gst_buffer_copy_region
2011-06-19 13:17:06 -03: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
Wim Taymans d837268a77 buffer: add more debug 2011-06-13 12:04:28 +02:00
Wim Taymans 468dbbbaaf buffer: pass the allocator as const 2011-06-13 11:50:42 +02:00
Wim Taymans eeb07b3f3d buffer: add support for buffer in memory
Fix the code to support allocating the buffer and memory in one memory block.
Add an extra variable to store the memory of the buffer.
This code is disabled still because of complications.
2011-06-10 16:47:29 +02:00
Wim Taymans 17ff81fc7d memory: respect configured alignment
Move the alignment from GstBuffer to GstMemory.
make sure memory is at least aligned to the configured values.
2011-06-10 13:59:31 +02:00
Wim Taymans b27ee30a35 buffer: make new _buffer_allocate method
Make a new method to allocate a buffer + memory that takes the allocator and the
alignment as parameters. Provide a macro for the old method but prefer to use
the new method to encourage plugins to negotiate the allocator properly.
2011-06-10 13:49:23 +02:00
Wim Taymans 4a424c379f buffer: fix typo in docs 2011-06-09 11:13:55 +02:00