Problems defining application specific caps

Tiago Katcipis katcipis at inf.ufsc.br
Sat Jul 19 08:13:31 PDT 2014


Is there any interest on fixing the tutorial to use gst-plugins-bad element
maker ? Or should i fix the gst-template (i already have a fix to the
template pending, and it seems to be abandoned :-).

Best regards,
Tiago Katcipis


On Tue, Jun 3, 2014 at 1:50 PM, Tiago Katcipis <katcipis at inf.ufsc.br> wrote:

>
>
>
> On Tue, Jun 3, 2014 at 4:09 AM, Sebastian Dröge <sebastian at centricular.com
> > wrote:
>
>> 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.
>>
>
> Yeah, the docs make it very clear, since the query is being proxied down,
> when the sink pad has a audio caps it will fail to negotiate, when the caps
> is ANY (the fakesrc) it will work.
>
> Maybe it would be cool to add a /* TODO: MESSAGE */ on the gst-template
> to help future developers see that they need to change this if they are
> writing a plugin like a decode/encoder.
>
> I'm starting to rewrite some plugins from gstreamer 0.10 to 1.0 and i
> don't remember to have any problems with this proxy caps stuff.
>
> But I'm also a little confused if i should invest on gst-template since
> the tutorials talk about it and then redirects you to a project on gst-
> plugins-bad (an element maker).
>
> Thanks for the help Sebastian.
>
>
>>
>> --
>> Sebastian Dröge, Centricular Ltd - http://www.centricular.com
>> Expertise, Straight from the Source
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140719/c795ff02/attachment-0001.html>


More information about the gstreamer-devel mailing list