Commit graph

316 commits

Author SHA1 Message Date
Wim Taymans
396b49ec4d buffer: add _gst_max_memory() function
Add the a function to query the maximum amount of memory blocks that can be
added to a buffer. Also improve the docs for _insert_memory().
2013-04-11 14:31:01 +01:00
Olivier Crête
ec16d6b0a4 buffer: Add annotations and pygi friendly extraction function
API: gst_buffer_extract_dup
2013-03-27 13:07:03 -04:00
Sebastian Dröge
64affd3e61 buffer: Fix memory copying logic in copy_into()
https://bugzilla.gnome.org/show_bug.cgi?id=695035
2013-03-03 12:06:36 +01:00
Sebastian Dröge
ce1c1cf214 buffer: Gracefully handle gst_memory_copy() returning NULL without crashing
gst_buffer_copy_into() and gst_buffer_resize_range() can now fail.
2013-02-27 10:11:23 +01:00
Sebastian Dröge
2ca0046934 buffer: Fix inverted logic for deciding if memory should be shared or copied
https://bugzilla.gnome.org/show_bug.cgi?id=694717
2013-02-26 09:09:25 +01:00
Sebastian Dröge
209f081ab8 buffer: If sharing a GstMemory fails, fall back to copying it 2013-02-24 09:46:01 +01:00
Wim Taymans
1fcef378bd buffer: add option to deep copy a buffer
Add a buffer copy flag to force a memory copy in all cases.
2013-02-16 14:59:02 +01: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
Tim-Philipp Müller
dddcc31c42 docs: fix up docs a bit 2012-08-11 23:41:33 +01:00
Evan Nemerson
f169081290 buffer: mark gst_buffer_wrapped* data as array
https://bugzilla.gnome.org/show_bug.cgi?id=678301
2012-08-10 15:05:26 +01:00
Evan Nemerson
237f707c75 buffer: convert gst_buffer_* macros to functions
GObject Introspection does not support macros.
This is needed for bindings. We can still add back
macros or inline functions again later if we think
it's worth it.

https://bugzilla.gnome.org/show_bug.cgi?id=678301
2012-08-10 15:04:12 +01:00
Tim-Philipp Müller
579d1a3eca buffer, defaultmem: add option to poison memory before freeing it
Might be useful to track down certain bugs.
2012-08-04 13:37:32 +01:00
Jens Georg
d89219eba3 buffer: Update annotations
https://bugzilla.gnome.org/show_bug.cgi?id=680805
2012-07-30 16:07:38 +01:00
Wim Taymans
8c864712e6 buffer: make _foreach_meta more powerful
Make _foreach_meta return FALSE when the foreach function returned FALSE.
2012-07-17 12:57:59 +02:00
Wim Taymans
c8e83cde78 buffer: add more debug 2012-07-17 12:50:24 +02:00
Wim Taymans
070f7c4e1c buffer:fix debug category 2012-07-05 11:19:16 +02:00
Wim Taymans
3b16efa1d1 miniobject: add lock functionality to GstMiniObject
Move the locking methods from GstMemory to GstMiniObject.
Add a miniobject flag to enable LOCKABLE objects. LOCKABLE objects can
use the lock/unlock API to control the access to the object.
Add a minobject flag that allows you to lock an object in readonly mode.
Modify the _is_writable() method to check the shared counter for LOCKABLE
objects. This allows us to control writability separately from the refcount for
LOCKABLE objects.
2012-07-05 11:19:16 +02:00
Wim Taymans
703683f51b buffer: fix resize
Correctly update the exclusive locks
2012-07-05 11:19:16 +02:00
Wim Taymans
76b30712f5 buffer: lock memory EXCLUSIVE
lock the memory that the buffer references as EXCLUSIVE. This makes sure that
when we share the memory with other buffers that it becomes unwritable.
2012-07-05 11:19:15 +02:00
Wim Taymans
db65bfa129 buffer: fix the _get_mapped function
Fix the internal _get_mapped function. gst_memory_make_mapped() takes ownership
of the memory so we need to keep an additional ref until we are done.
2012-07-03 12:42:44 +02:00
Wim Taymans
2c88afb992 buffer: add more debug log 2012-07-03 12:42:44 +02:00
Wim Taymans
4c6228224f buffer: add _append_region function
Make a gst_buffer_append_region() function that allows you to append a memory
region from one buffer to another. This is a more general version of
gst_buffer_append().
2012-06-28 11:02:19 +02:00
Tim-Philipp Müller
1be934f0dd miniobjects: pass copy, dispose and free function to gst_mini_object_init()
So mini objects don't have to poke into the GstMiniObject part
of the structure. Saves lines of code, and seems slightly cleaner.
We don't have proper OO hierarchies or methods here after all.
2012-06-23 20:02:02 +01:00
Evan Nemerson
b70aefdb85 introspection: add missing return value annotations 2012-06-19 17:33:45 -07:00
Wim Taymans
2cab15c9f6 docs: improve API docs 2012-06-15 12:57:24 +02:00
Wim Taymans
12aefaa078 miniobject: remove the size field
The size field is used by subclasses to store the total allocated size of the
memory for this miniobject. Because miniobject doesn't really do anything with
this field we can move it to the subclasses.
2012-06-14 17:11:11 +02:00
Wim Taymans
a1c5b00e72 memory: make GstMemory a miniobject 2012-06-14 16:34:28 +02:00
Wim Taymans
6fae137027 meta: add LOCKED flag
Add a new LOCKED flag to the metadata. Refuse removing LOCKED metadata from
a buffer.
Mark the metadata from the bufferpool LOCKED.
Add unit test for LOCKED flag
2012-04-17 15:55:10 +02:00
Wim Taymans
2503dcddfb buffer: improve debug 2012-04-14 10:23:49 +02:00
Wim Taymans
82c92a9c7c buffer: improve arg checking
Allow idx == 0 and length == -1 on empty buffers for the _range methods.
2012-04-12 11:53:00 +02:00
Sreerenj Balachandran
fd2ebb5365 buffer: Clean up header files 2012-04-11 09:53:45 +02:00
Alessandro Decina
e603d08e87 gstbuffer: fix compile warning 2012-04-05 09:07:18 +02:00
Wim Taymans
8428d3e295 buffer: make get_sizes and _resize with ranges
Make the _get_sizes and _resize methods work on a range of memory to make them
more powerfull.
2012-04-04 09:33:13 +02:00
Wim Taymans
f3aad8b430 buffer: reuse more code 2012-04-01 12:02:40 +02:00
Wim Taymans
0e9241cfc6 buffer: make function to find memory in a buffer
Make a function to find the memory blocks for a region in a buffer.
2012-04-01 12:02:40 +02:00
Wim Taymans
113b9dc535 buffer: add peek_memory method
Add a peerk_memory method that simply fetches the memory at an offset without
refcounting or merging.
2012-03-31 17:10:35 +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
Edward Hervey
31ca9f9216 gstbuffer: Fix unitialized variable
gcc 4.5 complains otherwise :(
2012-03-29 15:18:33 +02:00
Wim Taymans
9aa9751938 review some docs 2012-03-28 18:12:23 +02:00
Wim Taymans
3e6238135d buffer: simplify and refactor _span and _merge
Unify the _span and _merge code paths and simplify now that we only use this
internally.
2012-03-28 16:48:51 +02:00
Wim Taymans
315e77bf81 buffer: we always call _span with the buffer size 2012-03-28 16:48:51 +02:00
Wim Taymans
127074986c buffer: move some code around 2012-03-28 16:48:51 +02:00
Wim Taymans
8fc290a27f buffer: we call _span always with 0 offset 2012-03-28 16:48:51 +02:00
Wim Taymans
a4c861a4d3 buffer: remove always FALSE function argument 2012-03-28 16:48:50 +02:00
Mark Nauwelaerts
1af261169c buffer: delay buffer unref until buffer no longer needed 2012-03-28 16:39:54 +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
a137002ef1 buffer: re-enable _span offset calculations
when we _span two complete buffers, we can copy offsets and timestamps.
2012-03-27 15:16:55 +02:00
Wim Taymans
8ff7a0978d buffer: add more _is_writable checks
Add some checks to assert on writability for functions that modify metadata.
2012-03-27 14:59:06 +02:00
Wim Taymans
7bcc3baf64 buffer: improve gst_buffer_new_wrapped_full()
Make it possible to wrap all kinds of memory by exposing all properties to
gst_buffer_new_wrapped_full(). This makes it possible to also create writable
memory without a free function or memory with extra padding.
2012-03-20 10:20:29 +01:00
Wim Taymans
85c9543841 memory: group allocation parameters in a struct
Group the extra allocation parameters in a GstAllocationParams structure to make
it easier to deal with them and so that we can extend them later if needed.
Make gst_buffer_new_allocate() take the GstAllocationParams for added
functionality.
Add boxed type for GstAllocationParams.
2012-03-15 13:42:17 +01:00