Commit graph

163 commits

Author SHA1 Message Date
Robert Swain
9b6f93dcf3 basetransform: Implement QoS message posting
And some more for bug #322947
2010-03-18 16:57:17 +01:00
Thiago Santos
a6a3c129d1 basetransform: Accept non-fixed caps suggestions
When doing pad_allocs, use non-fixed caps suggestions and
try to fixate them before using. This makes possible to
have suggested buffer size with 0 in basetransform just
to signal upstream a renegotiation is needed

Fixes #576234
Fixes #609046
2010-03-16 17:12:37 -03:00
Sebastian Dröge
743cde4b49 basetransform: Only use suggested caps in buffer allocation if a size was suggested too 2010-01-17 08:23:48 +01:00
Sebastian Dröge
0a0c32ef88 basetransform: Handle buffers with NULL caps correctly
This means that the caps didn't change so don't try to handle
the NULL caps as the new caps.
2010-01-14 20:19:05 +01:00
Stefan Kost
f63ecd04a8 pad: rename new api from _refed to _reffed.
Due to popular demand rename the new api as we still can.
API: gst_pad_get_caps_reffed(), gst_pad_peer_get_caps_reffed()
2009-11-05 12:54:32 +02:00
Tim-Philipp Müller
daecaf0e8a Remove GST_DEBUG_FUNCPTR where they're pointless
There's not much point in using GST_DEBUG_FUNCPTR with GObject
virtual functions such as get_property, set_propery, finalize and
dispose, since they'll never be used by anyone anyway. Saves a
few bytes and possibly a tenth of a polar bear.
2009-10-28 00:44:24 +00:00
Stefan Kost
fcc5d783df pad: add variants of gst_pad_get_caps() that don't copy caps. Fixes #590941
In most places in core and baseclasses we just need the caps to do caps-
intersections. In that case ref'ed caps are enough (no need to copy).
This patch also switches the code to use the new functions.
API: gst_pad_get_caps_refed(), gst_pad_peer_get_caps_refed()
2009-10-07 22:41:30 +03:00
Thijs Vermeir
0dd051eeb3 Check suggested caps for proxy alloc
Because we are trying to resolve a suggestion here we don't need
to check on caps for proxy_alloc but we need to check on the
suggested caps instead.
2009-08-28 18:04:50 +02:00
Stefan Kost
04470fc794 basetransform: use new _caps_can_intersect() 2009-08-06 15:30:33 +03:00
Stefan Kost
cfacd2cbb3 basetransform: only check caps_is_fixed() if they changed
The previous code could call gst_caps_is_fixed() for the same caps many times.
2009-08-06 15:30:33 +03:00
Wim Taymans
a2a973eafd basetransform: clarify _caps_is_equal() 2009-08-06 10:53:25 +02:00
Wim Taymans
ec4d259b67 basetransform: refactor metadata modifications
Check when we need to touch the metadata of the output buffer after selecting
the output buffer so that we have everything in one place.
Also take flags and timestamp modifications into account.
2009-08-06 10:53:22 +02:00
Wim Taymans
db6ce33e3a basetransform: enable optimisation
When we have the same input as output caps, reuse the input caps object. After
the caps refcounting has been sorted out now, we can finally enable this
optimisation.
2009-08-06 10:53:07 +02:00
Wim Taymans
6cf64beb79 basetransform: fix refcounting problem
Add some more debug info.
Make sure that the output buffer has writable metadata before we attempt to set
caps on it.

fixes #583999
2009-08-06 10:52:34 +02:00
Kipp Cannon
6bc2bf8307 basetransform: Improve debug output in gst_base_transform_acceptcaps()
Fixes bug #589524.
2009-08-06 06:41:57 +02:00
Sebastian Dröge
6fd97a6d64 basetransform: Don't unset GAP flag if working in passthrough mode
Fixes bug #589314.
2009-08-06 06:41:57 +02:00
Stefan Kost
3ce0c64b45 basetransform: take size once 2009-07-14 08:32:24 +02:00
Stefan Kost
2288f9f6ec basetransform: make comment a FIXME comment 2009-07-06 19:52:44 +01:00
Stefan Kost
e778c5fd8b logging: fix unused variable warning when disabling debug logs.
The var was NULL anyway, bacause of the ifdefs there, the message makes no
sense including it.
2009-04-15 23:35:35 +03:00
Sebastian Dröge
d12034ab4b gst: Use g_once_init* or G_DEFINE_TYPE 2009-04-04 10:59:39 +02:00
Edward Hervey
9bf1d7247a basetransform: move unused variable in the #if 0 block.
That variable is only used by the code which has been if 0'd
2009-04-03 12:57:24 +02:00
Edward Hervey
00cbbc87c7 Remove unused variables detected by LLVM's Clang static analyzer. 2009-04-03 12:56:48 +02:00
Thijs Vermeir
8a080229c7 Force reconfigure of basetransform to recheck alloc request
While reconfiguring a basetransform element we need also to recheck
the alloc request. Because it's possible that due to caps changes
the proxy_alloc state is not correct anymore.
(Re-commit after discusion with Wim on IRC)
2009-02-02 18:23:41 +01:00
Wim Taymans
c786c5224a Revert "Check suggested caps for proxy alloc"
This reverts commit 50afd45957.

It breaks the interactive test-scale unit test.
2009-01-30 10:45:17 +01:00
Wim Taymans
a371ea6e5f Revert "Force reconfigure of basetransform to recheck alloc request"
This reverts commit 3a4602d771.

It breaks the interactive test-scale unit test.
2009-01-30 10:45:16 +01:00
Stefan Kost
45a17154b7 Add logging in failure case. Add more details to a todo comment. 2009-01-29 17:46:52 +02:00
Thijs Vermeir
50afd45957 Check suggested caps for proxy alloc
Because we are trying to resolve a suggestion here we don't need
to check on caps for proxy_alloc but we need to check on the suggested
caps instead.
2009-01-29 13:58:55 +01:00
Thijs Vermeir
3a4602d771 Force reconfigure of basetransform to recheck alloc request
While reconfiguring a basetransform element we need also to recheck
the alloc request. Because it's possible that due to caps changes
the proxy_alloc state is not correct anymore.
2009-01-29 13:53:01 +01:00
Thijs Vermeir
3f054f1bae Fix typo 2009-01-25 18:06:44 +01:00
Stefan Kost
7dd8b92448 gst/gstdebugutils.c: Add some ideas, how to make the graph smaller.
Original commit message from CVS:
* gst/gstdebugutils.c:
Add some ideas, how to make the graph smaller.
* gst/gstutils.c:
Add a comment from a debug session.
* libs/gst/base/gstbasetransform.c:
Log more context.
* libs/gst/controller/gstinterpolationcontrolsource.c:
Indet.
* plugins/elements/gstcapsfilter.c:
Fix typo in docs.
2009-01-01 21:27:06 +00:00
Wim Taymans
b90bef8ee5 libs/gst/base/gstbasetransform.*: Add vmethod that is called before we start the transform and which can be used to c...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer),
(gst_base_transform_getrange), (gst_base_transform_chain):
* libs/gst/base/gstbasetransform.h:
Add vmethod that is called before we start the transform and which can
be used to configure the transform, such as dynamic properties.
2008-12-08 18:35:44 +00:00
Wim Taymans
c577a143b9 libs/gst/base/gstbasetransform.c: Revert quick accepcaps attempt, it's not fully equivalent to the old behaviour and ...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_acceptcaps):
Revert quick accepcaps attempt, it's not fully equivalent to the old
behaviour and thus causes regressions.
2008-11-24 15:27:55 +00:00
Wim Taymans
0cca473acf libs/gst/base/gstbasetransform.c: Rename a variable to make the code clearer.
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_acceptcaps):
Rename a variable to make the code clearer.
2008-11-22 15:09:20 +00:00
Wim Taymans
c0e491cdca libs/gst/base/gstbasetransform.c: Add beginnings of a more optimized acceptcaps function than the default core one.
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c: (gst_base_transform_init),
(gst_base_transform_getcaps), (gst_base_transform_find_transform),
(gst_base_transform_acceptcaps), (gst_base_transform_getrange):
Add beginnings of a more optimized acceptcaps function than the default
core one.
2008-11-21 17:14:48 +00:00
Wim Taymans
8798ea2cca libs/gst/base/gstbasetransform.c: If we have a fixate function, call it even if we already have fixed caps because th...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_find_transform), (gst_base_transform_getrange):
If we have a fixate function, call it even if we already have fixed caps
because the subclass might add some caps. Makes audioconvert add a
default channel layout.
2008-10-27 15:02:48 +00:00
Wim Taymans
8d871b9c1d libs/gst/base/gstbasetransform.c: Clear the output buffer variable.
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer),
(gst_base_transform_getrange):
Clear the output buffer variable.
Cleanups to the error path in the getrange function.
Fixes #557649.
2008-10-24 09:41:19 +00:00
Wim Taymans
f59b56f75d libs/gst/base/gstbasetransform.c: Protect sink_alloc caps with the sinkpad lock to avoid nasty caps refcount problems...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer),
(gst_base_transform_buffer_alloc), (gst_base_transform_suggest):
Protect sink_alloc caps with the sinkpad lock to avoid nasty caps
refcount problems as seen in banshee and maybe also in farsight2.
Remove atomic int now that we need to take the lock anyways.
2008-10-21 16:30:41 +00:00
Wim Taymans
b8609a7a76 libs/gst/base/gstbasesrc.c: Update comment.
Original commit message from CVS:
* libs/gst/base/gstbasesrc.c: (gst_base_src_perform_seek):
Update comment.
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_handle_buffer),
(gst_base_transform_reconfigure):
Add some debug info.
* win32/common/libgstbase.def:
Add new method.
2008-10-20 13:29:06 +00:00
Jan Schmidt
86db1f680c Fix assertion in basetransform when the subclass chooses not to allocate a buffer in prepare_buffer(), and make capsf...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
* plugins/elements/gstcapsfilter.c:
* tests/check/Makefile.am:
* tests/check/elements/.cvsignore:
* tests/check/elements/capsfilter.c:
Fix assertion in basetransform when the subclass chooses not to
allocate a buffer in prepare_buffer(), and make capsfilter error out
cleanly if requested to apply caps that don't completely specify the
buffer. Fixes #551509
2008-09-28 21:19:15 +00:00
Wim Taymans
c2552e7d0d libs/gst/base/gstbasetransform.c: Take new caps ref because our old one might have been gone when the subclass perfor...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer):
Take new caps ref because our old one might have been gone when the
subclass performs a gst_pad_set_caps() on the srcpad. See #548764.
2008-09-24 15:03:40 +00:00
Wim Taymans
8337ce91aa Implement method for reconfiguring basetransform.
Original commit message from CVS:
* docs/libs/gstreamer-libs-sections.txt:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_handle_buffer), (gst_base_transform_getrange),
(gst_base_transform_chain), (gst_base_transform_suggest),
(gst_base_transform_reconfigure):
* libs/gst/base/gstbasetransform.h:
Implement method for reconfiguring basetransform.
API: GstBaseTransform::gst_base_transform_reconfigure()
2008-08-20 10:52:09 +00:00
Wim Taymans
077d96dec3 libs/gst/base/gstbasetransform.c: If the element is configured in passthrough mode but the prepare_output_buffer gave...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer):
If the element is configured in passthrough mode but the
prepare_output_buffer gave us a new output buffer, discard that buffer
and reuse the input buffer.
2008-08-18 09:59:18 +00:00
Wim Taymans
e580f95831 libs/gst/base/gstbasetransform.c: Go over the buffer_alloc function again and make sure we always end up allocating a...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_prepare_output_buffer),
(gst_base_transform_buffer_alloc):
Go over the buffer_alloc function again and make sure we always end up
allocating a buffer.
Add some more docs.
Avoid doing pad alloc when we have a pending suggestion because we
cannot yet deal with changing caps in that case. Fixes #547728
2008-08-14 16:37:29 +00:00
Wim Taymans
dc9983cbea libs/gst/base/gstbasetransform.c: Don't overwrite the outsize when calculating the expected size of a new buffer beca...
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_transform_caps),
(gst_base_transform_prepare_output_buffer),
(gst_base_transform_buffer_alloc), (gst_base_transform_suggest):
Don't overwrite the outsize when calculating the expected size of a new
buffer because we still need it in case we cannot process the new
buffer.
When converting the size of the new buffer to an upstream size, actually
use the expected size of the buffer, not some other random value.
Use an atomic int to signal that a new upstream caps suggestion is
available.
When we can convert the current buffer to a new format, check if the
buffer size is of the expected size and allocate a new buffer of the
expected size when this is not the case.
* tests/check/libs/transform1.c: (GST_START_TEST):
remove ifdeffed code from the unit test.
2008-08-14 13:57:58 +00:00
Stefan Kost
4711f2c4fa libs/gst/base/: Fix headings in docs and gtk-doc warnings.
Original commit message from CVS:
* libs/gst/base/gstbasesrc.c:
* libs/gst/base/gstbasetransform.c:
Fix headings in docs and gtk-doc warnings.
2008-08-12 06:16:02 +00:00
Edward Hervey
6b16636203 libs/gst/base/gstbasetransform.c: Fix a "may be used unitialized" warning.
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_buffer_alloc):
Fix a "may be used unitialized" warning.
2008-08-11 15:14:28 +00:00
Wim Taymans
30f8603645 docs/libs/gstreamer-libs-sections.txt: Add new function:
Original commit message from CVS:
* docs/libs/gstreamer-libs-sections.txt:
Add new function:
API: GstBaseTransform::gst_base_transform_suggest()
* libs/gst/base/gstbasetransform.c: (gst_base_transform_finalize),
(gst_base_transform_init), (gst_base_transform_transform_caps),
(gst_base_transform_transform_size),
(gst_base_transform_configure_caps),
(gst_base_transform_can_transform),
(gst_base_transform_find_transform), (gst_base_transform_setcaps),
(gst_base_transform_prepare_output_buffer),
(gst_base_transform_buffer_alloc),
(gst_base_transform_handle_buffer), (gst_base_transform_getrange),
(gst_base_transform_chain), (gst_base_transform_activate),
(gst_base_transform_set_passthrough),
(gst_base_transform_is_passthrough),
(gst_base_transform_set_in_place),
(gst_base_transform_is_in_place), (gst_base_transform_update_qos),
(gst_base_transform_set_qos_enabled),
(gst_base_transform_is_qos_enabled),
(gst_base_transform_set_gap_aware), (gst_base_transform_suggest),
(gst_base_transform_reconfigure):
* libs/gst/base/gstbasetransform.h:
Rewrite of basetransform to perform negotiation outside of the
buffer_alloc functions.  Fixes #545853.
* tests/check/libs/transform1.c: (GST_START_TEST),
(buffer_alloc_ct2):
Update unit test.
2008-08-05 11:11:00 +00:00
Wim Taymans
1380508f53 libs/gst/base/gstbasetransform.c: Add debug info.
Original commit message from CVS:
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_class_init), (gst_base_transform_init),
(gst_base_transform_transform_caps),
(gst_base_transform_prepare_output_buffer):
Add debug info.
When a buffer is writable, its metadata is also writable so we don't
need to subbuffer (which then makes the buffer not-writable anymore).
2008-06-20 08:14:23 +00:00
Tim-Philipp Müller
b4636b46bb libs/gst/base/gstbasetransform.c: Unref events that the GstBaseTransform::event vfunc didn't want to have forwarded b...
Original commit message from CVS:
Patch by: Tim-Philipp Müller  <tim.muller at collabora co uk>
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_sink_event):
Unref events that the GstBaseTransform::event vfunc didn't want to
have forwarded by the base class. Closes a leak in identity.
Fixes bug #446763.
2008-05-20 08:28:24 +00:00
Sjoerd Simons
af64309f63 libs/gst/base/gstbasetransform.c: Check the caps of the buffer returned by gst_pad_alloc_buffer() and fall back to de...
Original commit message from CVS:
Patch by: Sjoerd Simons <sjoerd at luon dot net>
* libs/gst/base/gstbasetransform.c:
(gst_base_transform_buffer_alloc):
Check the caps of the buffer returned by gst_pad_alloc_buffer() and
fall back to default negotiation in the chain function if the caps
are different from what was requested. Fixes bug #526768.
2008-05-13 07:11:05 +00:00