GNOME Bugzilla – Bug 621190
video sink drops buffers if it's preceded by ffmpegcolorspace, videoscale and a capsfilter
Last modified: 2010-06-18 08:29:00 UTC
Try this and put the window in fullscreen. The sink will drop buffers: gst-launch videotestsrc pattern=1 ! ffmpegcolorspace ! videoscale ! "video/x-raw-rgb,width=(int)500,height=(int)250" ! ximagesink If ffmpegcolorspace is removed from the pipeline everything runs smoothly.
ximagesink keeps on suggesting the new caps on its sinkpad over and over again which causes a lot of caps negotiation. What it should do is check if the new caps are accepted downstream once and if they aren't, never try to suggest these same caps again.
These two patches already solve it but it would be nice if ximagesink also didn't hammer the acceptcaps function of upstream elements. commit d612442fde5f8c55d59de43fc2a1a9d9a4037c10 Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Mon Jun 14 12:39:47 2010 +0200 capsfilter: implement custom accept_caps method Implement a custom acceptcaps function. We can simply check if there is an intersection with the new caps. This makes the accept caps function much faster. See #621190 commit 76f7a001fc4978c0aa5d202be38ca5943ae671ed Author: Wim Taymans <wim.taymans@collabora.co.uk> Date: Mon Jun 14 12:36:54 2010 +0200 basetransform: add accept_caps vmethod Allow subclasses to override the acceptcaps function because in some cases a custom implementation can be much much faster than the default one. See #621190
Created attachment 163614 [details] [review] [ximagesink] Ask pad peer to accept new caps once only In buffer_alloc, if the buffer dimensions are different than the window dimensions, call gst_pad_peer_accept_caps once only, it's useless to call it in the cases where we know it will always fail. Fixes bug #621190
Created attachment 163615 [details] [review] [ximagesink] Ask pad peer to accept new caps once only In buffer_alloc, if the buffer dimensions are different than the window dimensions, call gst_pad_peer_accept_caps once only, it's useless to call it in the cases where we know it will always fail. Fixes bug #621190
Instead of just checking for width/height changes you should probably check for equal caps. xvimagesink does it this way.
Created attachment 163674 [details] [review] [ximagesink] Ask pad peer to accept new caps once only [ximagesink] Ask pad peer to accept new caps once only In buffer_alloc, if the buffer caps are new, call gst_pad_peer_accept_caps once only, it's useless to call it in the cases where we know it will always fail. Fixes bug #621190
I don't think this is correct, you're checking if the last_caps are set and for equality while you should check if the last caps are *not* set or they are inequal
Note that this also breaks your above pipeline if you try to resize the ximagesink video... this will result in a not-negotiated error after your patch (and my proposed changes from comment #7) and before your patch will resize the window and add black borders to the video.
(In reply to comment #8) > Note that this also breaks your above pipeline if you try to resize the > ximagesink video... this will result in a not-negotiated error after your patch > (and my proposed changes from comment #7) and before your patch will resize the > window and add black borders to the video. Right... will check this and do more tests, sorry about the noise :/
Created attachment 163913 [details] [review] [ximagesink] Ask pad peer to accept new caps once only In buffer_alloc, if the buffer caps are new, call gst_pad_peer_accept_caps once only, it's useless to call it in the cases where we know it will always fail. Fixes bug #621190
commit 0ee588a3a6bfb0f0e89fd8f74757b0045b98c923 Author: Philippe Normand <pnormand@igalia.com> Date: Mon Jun 14 12:27:02 2010 +0200 ximagesink: Ask pad peer to accept new caps once only In buffer_alloc, if the buffer caps are new, call gst_pad_peer_accept_caps once only, it's useless to call it in the cases where we know it will always fail. Fixes bug #621190