Problems defining application specific caps

Sebastian Dröge sebastian at centricular.com
Tue Jun 3 00:09:09 PDT 2014


On Mo, 2014-06-02 at 18:23 -0300, Tiago Katcipis wrote:
> On Sun, Jun 1, 2014 at 5:14 AM, Sebastian Dröge <sebastian at centricular.com>
> wrote:
> 
> > On Sa, 2014-05-31 at 17:51 -0300, Tiago Katcipis wrote:
> > > Hi,
> > >
> > > Sorry if I'm asking something stupid, but i was unable to find anything
> > > about this subject on the docs (about caps it always explaining how the
> > > different negotiation scenarios happens, but not this).
> > >
> > > I want to use a application specific caps on a plugin that I'm writing,
> > it
> > > will basically receive audio and produce a proprietary binary format
> > > (neither audio or video).
> > >
> > > So i create my caps like:
> > >
> > > static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
> > >     GST_PAD_SRC,
> > >     GST_PAD_ALWAYS,
> > >     GST_STATIC_CAPS ("application/vnd.mydata+octet-stream")
> > >     );
> > >
> > > And i run a pipeline with fakesink or filesink (both accepts "any" caps),
> > > but it fails to link it:
> > >
> > > WARNING: erroneous pipeline: could not link myplugin to fakesink0
> > >
> > > if i just change the caps to:
> > >
> > > static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
> > >     GST_PAD_SRC,
> > >     GST_PAD_ALWAYS,
> > >     GST_STATIC_CAPS ("audio/x-raw")
> > >     );
> > >
> > > It works perfectly fine. It makes no sense to me since fakesink/filesink
> > > should accept any type of data.
> > >
> > > Is Gstreamer limited to a fixed set of caps ? I cant define a new
> > > application specific caps ?
> >
> > GStreamer does not limits itself to a fixed set of caps. The only reason
> > why custom caps might not be accepted by another element is if that
> > element does not accept these custom caps.
> >
> 
> I tested a little further and i got this:
> 
> gst-launch-1.0 audiotestsrc ! appspecificcaps ! fakesink
> WARNING: erroneous pipeline: could not link appspecificcaps0 to fakesink0
> 
> gst-launch-1.0 fakesrc ! appspecificcaps ! fakesink
> works fine.
> 
> It seems that changing the source causes the problem, which seems odd since
> a intersection between the source pad and the sink pad is only required
> (and automatically done/checked) on plugins that inherits from
> GstBaseTransform. But my plugin inherits from GstElement (actually i have
> an empty template that reproduces the problem).
> 
> 
> >
> > But you say you directly link your element to a fakesink? That should
> > work just fine, and if it doesn't please provide a debug log with
> > GST_DEBUG=6. It will contain the reason why it doesn't work.
> > If changing the caps to audio/x-raw makes it work in exactly the same
> > pipeline, then this suggests that you have an element between your
> > element and fakesink that only supports raw audio.
> >
> 
> I attached the log. From what i can see it seems that a intersection
> between the sink pad and the src pad of my element is being made, is this
> the default behaviour ?

It's only the default behaviour if you set the GST_PAD_FLAG_PROXY_CAPS
flag on the sinkpad, or of course if your query handler on the sinkpad
does that.

Your debug log suggests that you have the PROXY_CAPS flag set on both
pads.

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140603/2b5d6182/attachment.sig>


More information about the gstreamer-devel mailing list