Creating GstCaps for "audio/*" mediatype

Sebastian Dröge slomo at circular-chaos.org
Tue Aug 27 03:57:36 PDT 2013


On Di, 2013-08-27 at 14:09 +0400, 4ernov wrote:
> > On Di, 2013-08-27 at 13:24 +0400, 4ernov wrote:
> > > Hello,
> > >
> > > I'm trying to create caps for some common audio stream without
> > > specifying any details to let decodebin and typefind detect the format
> > > and create proper pipeline. List of defined types
> > > (http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/section-types-definitions.html)
> > > says, that "audio/*" is right for it. But when I'm trying to write
> > >
> > > GstCaps* audio_caps = gst_caps_new_empty_simple("audio/*");
> > >
> > > I receive
> > >
> > > GStreamer-CRITICAL **: gst_structure_new_empty: assertion
> > > `gst_structure_validate_name (name)' failed
> > >
> > > and it's right as a check in gst_structure_validate_name()
> > >
> > > while (*s && (g_ascii_isalnum (*s) || strchr ("/-_.:+", *s) != NULL))
> > >
> > > doesn't contain "*" character and consequently consider it as invalid.
> > >
> > > The same problem is for other ".../*" types (e.g. "video/*").
> > >
> > > Is it something in GstStructure, should I use another notation or such
> > > a general caps simply can't be defined in code?
> >
> > The caps names must be complete and are compared by equality, not by
> > prefix match. "audio/*" is just not possible :)
> >
> > What exactly do you want to do, what's the bigger picture?
> 
> I'm trying to push an audio data stream to pipeline with appsrc. This
> stream is encoded with one of several formats (aac or celt and
> potentially others) and I'd like typefind to detect the actual format
> rather than define it explicitly in caps of appsrc. Still I have to
> set some caps to appsrc itself and the question is what caps should I
> set for this use case.

Just do it like filesrc and set no caps at all.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130827/9b217d44/attachment.pgp>


More information about the gstreamer-devel mailing list