GNOME Bugzilla – Bug 449197
[capsfilter] Should set src pad caps on buffer
Last modified: 2007-07-24 12:33:27 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).
Created attachment 90282 [details] [review] set source pad caps on the buffer
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()
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