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 664818 - Autoplugger sink bin receives strange caps while it gets the correct ones in 0.10.35 and earlier
Autoplugger sink bin receives strange caps while it gets the correct ones in ...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal blocker
: 0.10.36
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-11-25 15:45 UTC by Josep Torra Valles
Modified: 2011-11-28 20:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Requested GStreamer log (481.43 KB, application/x-bzip)
2011-11-26 18:41 UTC, Josep Torra Valles
Details
Requested GStreamer log (557.48 KB, application/x-bzip)
2011-11-26 18:56 UTC, Josep Torra Valles
Details
A new log with the suggested change (791.95 KB, application/x-bzip)
2011-11-28 11:59 UTC, Josep Torra Valles
Details

Description Josep Torra Valles 2011-11-25 15:45:00 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
Comment 1 Josep Torra Valles 2011-11-25 15:47:19 UTC
I've forgot to mention that it works properly in 0.10.35 and earlier GStreamer versions. So I think this is a regression.
Comment 2 Sebastian Dröge (slomo) 2011-11-25 23:36:13 UTC
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.
Comment 3 Josep Torra Valles 2011-11-26 09:18:04 UTC
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.
Comment 4 Sebastian Dröge (slomo) 2011-11-26 09:32:12 UTC
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?
Comment 5 Sebastian Dröge (slomo) 2011-11-26 09:34:40 UTC
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.
Comment 6 Josep Torra Valles 2011-11-26 18:41:05 UTC
Created attachment 202198 [details]
Requested GStreamer log
Comment 7 Josep Torra Valles 2011-11-26 18:56:42 UTC
Created attachment 202201 [details]
Requested GStreamer log

Upload the correct log
Comment 8 Josep Torra Valles 2011-11-26 19:21:18 UTC
(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);
    }
}}}
Comment 9 Sebastian Dröge (slomo) 2011-11-27 12:41:06 UTC
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.
Comment 10 Josep Torra Valles 2011-11-28 11:59:54 UTC
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.
Comment 11 Sebastian Dröge (slomo) 2011-11-28 18:06:57 UTC
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).
Comment 12 Josep Torra Valles 2011-11-28 20:40:56 UTC
Verified that the issue is fixed.