Commit graph

254 commits

Author SHA1 Message Date
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
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
Wim Taymans
7f24a48387 event: _qos_full -> _qos 2011-05-09 18:48:55 +02:00
Wim Taymans
c07b57fc05 segment: remove _full version
Rename the _full versions of the functions to the normal function names.
2011-05-09 17:51:07 +02:00
Wim Taymans
4eed658be1 basetransform: Use CAPs event
Use the caps event to configure basetransform.
Remove force_alloc hack, we don't need this in 0.11 with new upstream
negotiation.
Avoid getting some pad caps.
2011-05-09 15:08:51 +02:00
Wim Taymans
ba6b915651 base: avoid using buffer caps
Comment all code using buffer caps.
Rework capsfilter code a little.
Fix some unit tests
2011-05-08 12:46:17 +02:00
Wim Taymans
02e5feb2bf pad: avoid using the old GST_PAD_CAPS
Don't use GST_PAD_CAPS but instead use the new gst_pad_get_current_caps()
method.
Avoid setting caps on buffers.
2011-05-06 19:04:54 +02:00
Sebastian Dröge
0069dc08ec basetransform: Don't get the parent twice in the setcaps function 2011-05-05 18:21:21 +02:00
Sebastian Dröge
aebe4a3c13 basetransform: In getcaps() prefer the caps order and caps of downstream if possible 2011-05-05 15:22:08 +02:00
Sebastian Dröge
a6c1cbe69a basetransform: Prefer caps order given by the subclass of the template caps order 2011-05-05 15:20:10 +02:00
Sebastian Dröge
1cc95da945 basetransform: Use new reconfigure flag on the pads instead of the reconfigure event 2011-05-05 15:19:56 +02:00
Sebastian Dröge
24cef7aa2f basetransform: Also call gst_base_transform_reconfigure() on renegotiate events 2011-05-05 15:02:56 +02:00
Thiago Santos
3baed25383 basetransform: Handle the new renegotiate event
Let basetransform push a renegotiate event upstream
when it gets a new suggestion
2011-05-05 15:02:46 +02:00
Wim Taymans
c4751ec8c1 Revert "context: use context on buffers instead of caps"
This reverts commit 9ef1346b1f.

Way to much for one commit and I'm not sure we want to get rid of the pad caps
just like that. It's nice to have the buffer and its type in onw nice bundle
without having to drag the complete context with it.
2011-05-05 13:17:08 +02:00
Sebastian Dröge
de5ce36dd1 basetransform: Remove nowadays unused and uninitialized setcaps variable 2011-05-05 12:28:02 +02:00