GNOME Bugzilla – Bug 664818
Autoplugger sink bin receives strange caps while it gets the correct ones in 0.10.35 and earlier
Last modified: 2011-11-28 20:40:56 UTC
I've a pair of auto plugger video sink bins, fluvaautosink and clutterautosink. The code for the clutter one [1] is going to be committed soon in clutter-gst. Today I've been testing them due the code freeze and I've found that it doesn't work. The reason seems to be because with git of today the element receives [3] instead of [2] which are the fixated caps. The convertbin is in pass through and _setcaps is invoked by the new segment event pushed in the identity element. [1] http://cgit.freedesktop.org/~adn770/clutter-gst/tree/clutter-gst/clutter-gst-auto-video-sink.c?h=toward_v2 [2] video/x-fluendo-va, width=(int)1280, height=(int)688, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)500000000/20854199 [3] video/x-fluendo-va, width=(int)1280, height=(int)688, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)500000000/20854199; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AYUV, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y444, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)v308, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y42B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YVYU, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YV12, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y41B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)16, endianness=(int)1234, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)15, endianness=(int)1234, red_mask=(int)31744, green_mask=(int)992, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)16, depth=(int)16, endianness=(int)1234, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y16 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)8, depth=(int)8, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y800, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y8 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)GREY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ], format=(fourcc){ I420, NV12, NV21, YV12, YUY2, Y42B, Y444, YUV9, YVU9, Y41B, Y800, Y8 , GREY, Y16 , UYVY, YVYU, IYU1, v308, AYUV, A420 }; video/x-raw-rgb, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ], bpp=(int)8, depth=(int)8; video/x-raw-gray, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ], bpp=(int)16, depth=(int)16, endianness=(int)4321
I've forgot to mention that it works properly in 0.10.35 and earlier GStreamer versions. So I think this is a regression.
You mean setcaps is called with non-fixed caps now? Or gst_pad_get_caps() on upstream gives these caps instead of fixed caps? In case of the latter this is really a bug, playsinkvideoconvert should only return the video/x-fluendo-va caps because it can't convert this to RGB/YUV.
First at all sorry for giving you erroneous info. The problem is at http://cgit.freedesktop.org/~adn770/clutter-gst/tree/clutter-gst/clutter-gst-auto-video-sink.c?h=toward_v2#n378 Seems that gst_pad_peer_get_caps_reffed (bin->sink_pad) is returning the long list of caps. With gdb I see that this is called at the point that the new segment event is received from the identity. I can just tell you that the behaviour changed compared with 0.10.33 to 0.10.35 which are the releases that I've tested.
Could you attach a debug log with GST_DEBUG=*:5 for this? What are the caps returned by gst_pad_get_caps() on the srcpad of the VA decoder?
Also in your case you should do something different. First check gst_pad_get_negotiated_caps(), if it is NULL you call gst_pad_get_caps() and check if the resulting caps are simple caps (gst_caps_is_simple()). But of course this doesn't mean that there is no bug, the caps you get with get_caps() here might really be wrong.
Created attachment 202198 [details] Requested GStreamer log
Created attachment 202201 [details] Requested GStreamer log Upload the correct log
(In reply to comment #5) > Also in your case you should do something different. First check > gst_pad_get_negotiated_caps(), if it is NULL you call gst_pad_get_caps() and > check if the resulting caps are simple caps (gst_caps_is_simple()). > > But of course this doesn't mean that there is no bug, the caps you get with > get_caps() here might really be wrong. Do you mean something like the following? {{{ GstPad *peer = gst_pad_get_peer (bin->sink_pad); if (peer) { caps = gst_pad_get_negotiated_caps (peer); if (!caps) { caps = gst_pad_get_caps_reffed (peer); } gst_object_unref (peer); } }}}
Yes, but also check if the caps returned by get_caps() are actually fixed caps. This is what is done in all the other autopluggers currently.
Created attachment 202285 [details] A new log with the suggested change I've implemented the suggested change and a partial workaround for the derived issue in my element so uploading a new log to keep you in sync. The root issue is still there because get_pad_get_negotiated_caps returns NULL and code fallback to gst_pad_get_caps_reffed. I've not implemented the check to GST_CAPS_IS_SIMPLE because it fail due the fact that I'm receiving multiple caps. I've filtered the log to not write fluvadec stuff and keep fluvaautosink in order to fit under 1M.
commit f179213aa0ee36476bb6f6ffdc817ea21509cf4b Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon Nov 28 19:06:57 2011 +0100 playsinkconvertbin: Fix stupid mistake in last commit commit c1b1e2b44e59ba79100c70eeee964dde8b48750c Author: Sebastian Dröge <sebastian.droege@collabora.co.uk> Date: Mon Nov 28 19:03:54 2011 +0100 playsinkconvertbin: Only return the converter caps if we actually have raw caps Fixes bug #664818 (hopefully).
Verified that the issue is fixed.