inspect caps match, but pad link fails with EMPTY caps

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

inspect caps match, but pad link fails with EMPTY caps

PeterT
Hi,

I have two pipestages (dummyPRE and dummyPOST) that I wrote and am trying to connect.

I'm tryingt o connect them with a custom pad caps field because they share a proprietary encrypted binary stream.

After I compile both pipestages (keep in mind it works fine when I connect them via "ANY" pads), I use gst-inspect to check the source and sink pads I wish to connect. The both list the same custom cap on the proper pads. Cool!

But they fail to connect.

When I look at the GST_DEBUG=6 log and observe the linking phase, the sink pad of the right-hand-side stage (dummyPOST) responds to the linker with the correct cap, but the left-hand-side (dummyPRE) is EMPTY.

How can gst-inspect return the proper caps for both pads, but then gst_pad_link fail to query the cap for only one of the two stages?

0:00:00.464680585 55079 0x55e3d8b3aa00 DEBUG               GST_CAPS gstpad.c:2212:gst_pad_link_check_compatible_unlocked:<dummypre0:src> src caps EMPTY
0:00:00.464786445 55079 0x55e3d8b3aa00 DEBUG               GST_CAPS gstpad.c:2214:gst_pad_link_check_compatible_unlocked:<dummypost0:sink> sink caps ENCRRGBA
0:00:00.464883000 55079 0x55e3d8b3aa00 DEBUG               GST_CAPS gstpad.c:2232:gst_pad_link_check_compatible_unlocked: caps are not compatible

Weirdness.

Thoughts?

Thanks,
PeterT
Reply | Threaded
Open this post in threaded view
|

Re: inspect caps match, but pad link fails with EMPTY caps

Tim Müller
On Thu, 2016-11-10 at 17:09 -0800, PeterT wrote:

Hi Peter,

> How can gst-inspect return the proper caps for both pads, but then
> gst_pad_link fail to query the cap for only one of the two stages?

This is hard to answer without seeing the code of your elements :)

What you see in gst-inspect-1.0 are the "pad template caps". They tell
you all the formats the element can handle in theory. In practice an
element might just be able to handle a smaller subset of what's
advertised in the pad template. So there's a run-time caps query
mechanism as well. Depending on what base class you use, look for a
get_caps or query_caps vfunc or implement a query handler on your pads
and make it handle GST_QUERY_CAPS.

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: inspect caps match, but pad link fails with EMPTY caps

PeterT
Hi Tim,
Thanks for the reply. I'm using the default plugin framework from Github. I'm deriving my elements from the gstplugin class. They are currently very close to the original, and posting them here might make a big mess. I am currently only defining the static templates (below):

static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE (
  "sink",
  GST_PAD_SINK,
  GST_PAD_ALWAYS,
  GST_STATIC_CAPS(GST_VIDEO_CAPS_MAKE("RGBA"))
);

static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE (
  "src",
  GST_PAD_SRC,
  GST_PAD_ALWAYS,
  GST_STATIC_CAPS("ENCRRGBA")
  //GST_STATIC_CAPS ("ANY")
);

And vice-versa for the other elements sink. Other than that I have no query code at all in the elements.

I just added some query code and attached a pad query function during init and can see it being called during the process, so I'll study this and play with it until I understand it better.

Thanks for the nudge! :)
Peter