Commit graph

6660 commits

Author SHA1 Message Date
Fabrizio (Misto) Milo
31c450a5d5 caps: spelling fixes 2012-03-29 15:46:15 +02:00
Edward Hervey
2d95de113e gstelement: lower GST_ELEMENT_FLAG_LAST
It wouldn't leave that much room for subclass users
2012-03-29 15:28:44 +02:00
Edward Hervey
31ca9f9216 gstbuffer: Fix unitialized variable
gcc 4.5 complains otherwise :(
2012-03-29 15:18:33 +02:00
Wim Taymans
ce67b0e539 docs: update more documentation 2012-03-29 13:34:50 +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
Olivier Crête
fd675fa385 gstpad: Fix typo in docstring 2012-03-27 15:25:58 -04: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
a080b81808 trace: add refcount to trace debug 2012-03-27 15:00:38 +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
08f33d8d93 bufferpool: remove const from get/set_param
Remove the const from the GstCaps in get/set_param. set_param modifies
the refcount of the caps.
Don't increment the refcount of the caps result of get_param like we
do with other objects.
Update some annotiations.
2012-03-27 12:48:59 +02:00
Wim Taymans
f09ab3b007 bufferpool: fix annotation for _release
_release takes ownership of the buffer
2012-03-27 12:48:59 +02:00
Sebastian Dröge
9c4c9e3b6b bus: Change the timeout argument type of gst_bus_poll() from GstClockTimeDiff to GstClockTime
This is more consistent with the other GstBus methods that have a timeout.
2012-03-27 12:31:18 +02:00
Wim Taymans
e08956907c caps: remove old code
Remove attempt to delay _make_writable
2012-03-26 19:13:21 +02:00
Mark Nauwelaerts
7a7119ec99 caps: ensure writable caps prior to modification 2012-03-26 18:08:10 +02:00
Wim Taymans
3776eb9e25 bufferpool: check min/max_buffers 2012-03-26 17:38:50 +02:00
Wim Taymans
ce90970be2 query:fix copy-and-paste problem 2012-03-26 17:35:18 +02:00
Mark Nauwelaerts
5077f4c958 utils: add and improve debug messages
... so they end up in a more expected debug category rather than oblivion.
2012-03-23 18:52:11 +01:00
Sebastian Dröge
73e91b2ce3 query: Only allow fixed caps in the accept-caps query 2012-03-21 09:00:45 +01:00
Wim Taymans
f9c85a53dc pad: improve docs of get/pull_range
Improve the docs of the get/pull_range functions, define the lifetime of the
buffer in case of errors and short reads.
Make sure the code does what the docs say.
2012-03-20 13:14:55 +01: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
db1318ab4a pad: change the semantics of get/pull_range a little
Make it so that one can specify a buffer for get/pull_range where the downstream
element should write into. When passing NULL, upstream should allocate a buffer,
like in 0.10.
We also need to change the probes a little because before the pull probe, there
could already be a buffer passed. This then allows us to use the same PROBE
macro for before and after pulling.
While we're at the probes, make the query probe more powerful by handling the
GST_PAD_PROBE_DROP return value. Returning _DROP from a query probe will now
return TRUE upstream and will not forward the probe to the peer or handler.
Also handle _DROP for get/pull_range properly by not dispatching to the
peer/handler or by generating EOS when the probe returns DROP and no buffer.
Make filesrc handle the non-NULL buffer passed in the get_range function and
skip the allocation in that case, writing directly into the downstream provided
buffer.
Update tests because now we need to make sure to not pass a random value in the
buffer pointer to get/pull_range
2012-03-16 21:37:10 +01:00
Wim Taymans
6b90850257 event: fix docs a little, alloc_buffer is gone 2012-03-16 18:39:08 +01:00
Wim Taymans
a7e6c7d2a8 bufferpool: split bufferpool configuration
Make separate methods to control the bufferpool and the allocator used by the
bufferpool.
Make it possible to change the allocator of a pool.
2012-03-15 22:09:02 +01:00
Wim Taymans
83af60019e query: rework the ALLOCATION query
Separate the bufferpool and allocator hints in the allocation query, some
of the values don't always make sense together.
Keep the bufferpool and its configuration together.
Keep the allocator and its parameters together.
Allow for multiple bufferpool configurations in the query.
2012-03-15 20:23:59 +01:00
Wim Taymans
c8acf02f23 pad: comment and debug improvement 2012-03-15 16:50:31 +01:00
Wim Taymans
f0084ac8e9 utils: improve debug
also fix a potential memory leak
2012-03-15 16:49:33 +01:00
Wim Taymans
9a1cd17136 GstBufferPoolParams -> GstBufferPoolAcquireParams
Because those flags are not from the bufferpool but for the acquire function.
2012-03-15 14:01:44 +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
Wim Taymans
69e3639c96 query: fix copy function
Copy the structure too.
2012-03-15 13:42:17 +01:00
Wim Taymans
592b5bec39 memory: fix maxsize after align
when we align the data pointer, make sure to update the maxsize.
Add some more debug
2012-03-15 13:42:17 +01:00
Wim Taymans
edd2ffe4d4 memory: Add 0 padding
Change gst_allocator_alloc() so that we can also spicify flags and padding.
Add 2 new flags to mark the memory 0 prefixed/padded. This allows us to
remove some resizes in the base classes.
When allocating memory, memset prefix and padding with 0 when the flags tell
us to.
On resize, clear the zero padding flags if we can't guarantee the memory is
still 0 filled.
Update tests.
2012-03-14 21:32:22 +01:00
Wim Taymans
3d76e6011c query: also include padding in ALLOCATION query
Negotiating padding is needed on second thought so include it in the
ALLOCATION query.
Make the bufferpool take padding into account when allocating.
Make basesrc take padding into account.
Use padding and prefix when allocating in basetransform.
2012-03-14 19:47:10 +01:00
Mark Nauwelaerts
f2d81f4c3d bufferpool: free owned discarded pool config 2012-03-14 17:20:01 +01:00
Wim Taymans
e332862985 pad: implement DRAIN handling
When we forward the DRAIN query and there is nothing to forward it to, assume we
are drained.
When a basesink receives a drain query, reply with TRUE.
2012-03-14 16:27:31 +01:00
Wim Taymans
318baf4cd9 query: add new drain query
With the new serialized downstream queries we can implement a drain query that
makes an element waits until a downstream element replies to the query.
2012-03-14 16:18:02 +01:00
Wim Taymans
05cd564bea pad: make serialized queries push sticky events first
Before we can proceed with a serialized query, we need to be sure that all
sticky events were pushed.
2012-03-14 16:01:15 +01:00
Wim Taymans
fb2fc331de pad: take stream lock on serialized queries 2012-03-14 15:29:12 +01:00
Wim Taymans
cd6693fdc9 pad: enforce correct query direction 2012-03-14 15:16:56 +01:00
Wim Taymans
5a21eb36c7 query: register queries like events
Also register queries with a QueryType that allows us to check if the event is
sent in the right direction. Add a serialized query type because we will need
this for the allocation query.
Remove the QueryTypeDefinition stuff, it is not used anymore and we now use
custom queries and separate API for them.
Update defs.
2012-03-14 14:51:16 +01:00
Wim Taymans
d2d7be7b75 bin: remove old compat mode 2012-03-13 15:40:37 +01:00
Wim Taymans
bcf115a620 caps: small docs update 2012-03-13 15:40:23 +01:00
Wim Taymans
272142089e caps: remove gst_caps_union()
Remove gst_caps_union(), use gst_caps_merge(). This function was not used
anymore and it is unclear what the difference is with _merge().
2012-03-13 10:04:36 +01:00
Wim Taymans
5e719a293a caps: delay _make_writable() until needed in _normalize()
Delay _make_writable() until we actually found a list and need to update the
caps.
2012-03-12 18:34:30 +01:00