Commit graph

267 commits

Author SHA1 Message Date
Wim Taymans
d924c30f5b base: rename allocation vmethods
Name the allocation vmethod on srcpad decide_allocation because source pads will
have to decide what allocation parameters will be used.
Name the allocation vmethod on sinkpads propose_allocation because they will
need to configure the allocation query with a proposed values for upstream.
2011-08-26 14:18:33 +02:00
Wim Taymans
5c8efa9ffe basetransform: remove some unused variables 2011-08-26 12:28:28 +02:00
Wim Taymans
b91a5ab60a basetransform: add vmethod to configure upstream bufferpool
Add a vmethod that can be implemented to influence the bufferpool that upstream
elements will use.
2011-08-26 11:44:12 +02:00
Wim Taymans
f1566e85c0 basetransform: use pad direction like other vmethods 2011-08-26 11:24:42 +02:00
Wim Taymans
31b70ea701 Merge branch 'master' into 0.11
Conflicts:
	libs/gst/base/gstbasetransform.c
	libs/gst/base/gstbasetransform.h
2011-08-26 11:09:07 +02:00
Sjoerd Simons
63a21ca8b1 BaseTransform: Add a query vfunc 2011-08-26 10:39:44 +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
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
Wim Taymans
83e057cdc1 basetransform: add more comments 2011-07-27 12:49:40 +02:00
Wim Taymans
c266912124 basetrans: also pass allocation query in in_place
When we are doing an in_place transform, don't do the allocation query but let
the upstream element decide.
2011-07-27 12:45:17 +01:00
Wim Taymans
2ff17fb622 basetransform: fix sink event handling
Implement the sink event handling like the src event handler. Make the default
implementation parse and forward the event. This makes it possible to actually
return an error value from the event handler.
2011-07-22 21:17:42 +02:00
Wim Taymans
5dde10f0e4 basetransform: handle failures
Handle failure to activate the bufferpool.
2011-07-22 19:19:59 +02:00
Wim Taymans
8059ab109a basetrans: improve debugging. 2011-07-22 19:11:56 +02:00
Wim Taymans
85d2355125 basetrans: Remove ref in passthrough
Remove the requirement to have to return a ref to the input buffer when in
passthrough mode. This saves a few ref/unref cycles and fixes another 0.11
FIXME.
2011-07-21 17:42:08 +02:00
Wim Taymans
70d13ae70e basetransform: make new copy_metadata vmethod
Make a new copy_metadata vmethod and move the code to copy the timestamps, flags
and offsets into a default implementation. This will allow us to give the
subclasses a chance to override the copy method.
2011-07-21 17:29:13 +02:00
Wim Taymans
2763f2bdcd basetrans: avoid intermediate method
Simply call the prepare_output_buffer method instead of calling an intermediate
function.
2011-07-21 16:39:04 +02:00
Wim Taymans
f8e75ce406 basetransform: move the metadata copy code
Move the metadata copy code to the default prepare_output_buffer implementation.
2011-07-21 16:30:07 +02:00
Wim Taymans
5253a52cb2 basetransform: move prepare_output_buffer code
Move the code for prepare_output_buffer to a default implementation. this allows
us to simplify some things and have subclasses call into the default
implementation when needed.
2011-07-21 15:49:00 +02:00
Wim Taymans
560c3d7fbc basetransform: only get size for debug 2011-07-21 15:48:25 +02:00
Wim Taymans
f1f2a2ff18 basetrans: fix comment and warn
Emit a warning in the debug log when something seems weird.
2011-07-21 14:18:30 +02:00
Wim Taymans
3bb167a1bf basetransform: only get caps for size transform
Delay getting the caps until we need to call the transform_size function.
2011-07-21 14:14:58 +02:00
Wim Taymans
e4ee356449 basetrans: remove useless variables from prepare_output_buffer
Remove the caps and size from the prepare_output_buffer function. with
bufferpools and capsnego done differently, we don't need this in most cases and
if we do, we can simply use the transform_size function and get the caps from
the srcpad.
2011-07-21 13:56:11 +02:00
Koop Mast
c1983b9939 basetransform: remove redundant ()
See #653137
2011-06-22 17:09:52 +02:00
Wim Taymans
3884badea6 memory: rename GstMemoryAllocator -> GstAllocator
simplify the name of the allocator object.
2011-06-22 11:42:46 +02:00
Wim Taymans
69409f1ec8 basetransform: activate the bufferpool
always activate the bufferpool, even if we get it from the allocation
query.
2011-06-20 17:32:47 +02:00
Wim Taymans
3822eea7cf basetransform: inprove allocation handling
Add vmethod for subclasses to influence the pool and allocator.
Log when query fails.
Respect negotiated allocator and alignment.
2011-06-20 16:53:04 +02:00
Wim Taymans
6ca5d44704 bufferpool: remove postfix parameter
Remove the postfix parameter, it's not used and can be done differently.
2011-06-11 18:52:42 +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
a767bf2bf9 caps: use the caps event
Use the caps event instead of gst_pad_set_caps() and the setcaps function
2011-06-07 09:43:20 +02:00
Edward Hervey
9b1c84d5ac basetransform: Use local priv variable instead of trans->priv 2011-05-31 18:31:53 +02:00
Sebastian Dröge
7295f3e2f6 basetransform: Pass the complete caps to transform_caps
Instead of passing it structure by structure. This allows
better optimized transform_caps functions and allows better
transformation decisions.

See bug #619844.
2011-05-27 11:37:24 +02:00
Wim Taymans
7e6d579301 scheduling: port to new scheduling query 2011-05-24 17:39:56 +02:00
Wim Taymans
7754d8d7ba transform: fixes for bufferpool handling
Don't error out when the allocation query returns success.
Do bufferpool query after we pushed the caps event downstream so that we can get
a good bufferpool suggestion.
Also proxy the bufferpool query downstream when we operate in in_place mode.
2011-05-23 18:15:00 +02:00
Wim Taymans
35cc371363 transform: reset reconfigure state
When we negotiate new caps, reset the reconfigure state.
2011-05-23 16:53:01 +02:00
Wim Taymans
1cb7523efa basetransform: WIP handle bufferpool 2011-05-23 15:38:31 +02:00
Wim Taymans
d33909302e basetransform: remove some more code
Remove some more unused code from basetransform.
Prepare for implementing bufferpools.
2011-05-20 16:01:57 +02:00
Sebastian Dröge
a46c9c2a62 event: Make SEGMENT event parsing API more consistent with the others 2011-05-18 16:56:43 +02:00
Wim Taymans
ad0693f47d basetransform: relax caps check
Also run the caps transform function on ANY caps, like we used to do before.
This makes sure that capsfilter has a chance to filter ANY caps as well.
2011-05-18 16:49:28 +02:00
Sebastian Dröge
5f2cd2b0a3 base: Update for caps/pad template related API changes 2011-05-17 13:14:12 +02:00
Sebastian Dröge
3d2127f865 Revert "query: allow _make_writable on query handlers"
This reverts commit cf4fbc005c.

This change did not improve the situation for bindings because
queries are usually created, then directly passed to a function
and not stored elsewhere, and the writability problem with
miniobjects usually happens with buffers or caps instead.
2011-05-17 11:21:41 +02:00
Wim Taymans
53e4d1a007 basetransform: fix buffer refcounting
When we fail to allocate an output buffer, set the buffer pointer to NULL or
else the calling function will try to unref it.
Remove some old comments
2011-05-16 18:48:20 +02:00
Sebastian Dröge
bdf9022861 base: Improve negotiation with new getcaps() filter 2011-05-16 15:33:10 +02:00
Wim Taymans
bdbc069348 Rework GstSegment handling
Improve GstSegment, rename some fields. The idea is to have the GstSegment
structure represent the timing structure of the buffers as they are generated by
the source or demuxer element.
gst_segment_set_seek() -> gst_segment_do_seek()
Rename the NEWSEGMENT event to SEGMENT.
Make parsing of the SEGMENT event into a GstSegment structure.
Pass a GstSegment structure when making a new SEGMENT event. This allows us to
pass the timing info directly to the next element. No accumulation is needed in
the receiving element, all the info is inside the element.
Remove gst_segment_set_newsegment(): This function as used to accumulate
segments received from upstream, which is now not needed anymore because the
segment event contains the complete timing information.
2011-05-16 11:37:52 +02:00
Sebastian Dröge
e8688b62b2 basetransform: When trying to fixate the sink suggestion prefer its structure order 2011-05-14 11:39:34 +02:00
Sebastian Dröge
f56c6e1225 basetransform: In getcaps() prefer the caps order and caps of downstream if possible 2011-05-14 11:39:34 +02:00
Sebastian Dröge
b4bed6e09e basetransform: Prefer caps order given by the subclass of the template caps order 2011-05-14 11:39:34 +02:00
Wim Taymans
a59bc0ab02 basetransform: remove obsolete code
Remove some obsolete code.
Don't try to reconfigure when we don't have sink caps.
2011-05-11 18:09:03 +02:00
Sebastian Dröge
ef673656b7 basetransform: Implement support for pad reconfiguration again 2011-05-11 15:26:02 +02:00
Wim Taymans
cf4fbc005c query: allow _make_writable on query handlers
Pass a GstQuery ** to the query handlers so that they can make the query
writable before using a setter on it.
Port code to new API.
2011-05-10 18:36:33 +02:00