After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 449197 - [capsfilter] Should set src pad caps on buffer
[capsfilter] Should set src pad caps on buffer
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.14
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-06-19 17:12 UTC by Edward Hervey
Modified: 2007-07-24 12:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
set source pad caps on the buffer (995 bytes, patch)
2007-06-19 17:13 UTC, Edward Hervey
none Details | Review
Updated patch (2.15 KB, patch)
2007-07-24 12:28 UTC, Edward Hervey
committed Details | Review

Description Edward Hervey 2007-06-19 17:12:39 UTC
Use case where capsfilter acts in a weird fashion (pushes out buffers that don't have the same caps as the src pad causing mad renegotiation).

gst-launch-0.10 -v videotestsrc ! video/x-raw-yuv,width=320,height=240,framerate=5/1 ! gdppay ! gdpdepay ! capsfilter caps=video/x-raw-yuv,width=320,height=240,framerate=5/1,pixel-aspect-ratio=1/1 ! xvimagesink

Since gdpdepay doesn't buffer_alloc() downstream what happens is the following:

* buffer is being pushed on the second capsfilter sink pad
* gst_pad_set_caps() is called on the sink pad with the buffer caps
* basetransform ends up putting the capsfilter caps on the src pad
* gst_pad_set_caps() sets the buffer caps on the sink pad
* the chain function of the sink pad is called
* when the buffer is being pushed out of the capsfilter srcpad, the buffer caps is different from the srcpad caps, therefore calls gst_pad_set_caps() on the srcpad with the buffer caps
* gst_pad_set_caps() sets the buffer caps on the src pad (SWITCHES)

everytime a buffer comes through the src pad caps go ping-pong.

The buffers going through capsfilter should end up with the same caps as what basetransform put on the source pad. It might be the same, but they might also contain additional information (as in this case).
Comment 1 Edward Hervey 2007-06-19 17:13:06 UTC
Created attachment 90282 [details] [review]
set source pad caps on the buffer
Comment 2 Edward Hervey 2007-07-24 12:28:38 UTC
Created attachment 92267 [details] [review]
Updated patch

Since we now have different caps on the source and sink pad, we also need to properly implement ::transform_size()
Comment 3 Edward Hervey 2007-07-24 12:33:27 UTC
2007-07-24  Edward Hervey  <bilboed@bilboed.com>

	* plugins/elements/gstcapsfilter.c: (gst_capsfilter_class_init),
	(gst_capsfilter_transform_size), (gst_capsfilter_prepare_buf):
	Fix capsfilter for cases where the caps set on capsfilter will provide
	additional information.
	Fixes #449197