kalyan chowdary
kalyanc007 at gmail.com
Mon Jul 23 07:51:03 PDT 2012
Thank you for reply Tim.
why I have written because aacparse plugin is not giving profile.It is only
giving rate,channels,stream-format,mpegversion and framed=true.
I put the profile/level into the caps. But when I query the caps I am
getting CAPS which are set in GST_STATIC_PAD_TEMPLATE.(I am getting ANY).
I am setting the caps in the chain function only.Is it correct way of doing?
Do I have to use gst_set_src_caps()?I am not using gst_set_src_caps() in my
plugin.
Also can u please tell me about gst_set_src_caps() function why it should
be used?
Below is the code what I am using(template and chain function which parse
only header information and push the buffer at it is).
static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY
);
and,
static GstFlowReturn
gst_MyParser_chain (GstPad * pad, GstBuffer * buf)
{
Myfilter *filter;
filter = GST_MYPARSER (GST_OBJECT_PARENT (pad));
if (filter->silent == FALSE)
g_print ("I'm plugged, therefore I'm in.\n");
GstCaps *caps=NULL;
gint8 profile;
GstBuffer * tempBuffer = buf;
profile = ( tempBuffer->data[2] & 0xc0 ) >> 6;
switch(profile)
{
case AAC_MAIN_PROFILE:
caps = gst_caps_new_simple("audio/mpeg",
"profile",G_TYPE_STRING,"HE-AAC",
NULL);
break;
case AAC_LOW_COMPLEXITY_PROFILE:
caps = gst_caps_new_simple(
"audio/mpeg",
"profile",G_TYPE_STRING,"LC",
NULL);
break;
case AAC_SCALABLE_SAMPLING_RATE_PROFILE:
break;
case AAC_RESERVED:
printf("\nAAC_RESERVED\n");
break;
}
//Sets the capabilities of this source pad.
if (FALSE == gst_pad_set_caps(filter->srcpad, caps))
{
return GST_FLOW_ERROR;
}
if ( caps != NULL)
{
gst_caps_unref(caps);
caps = NULL;
}
//setting the source pad caps to out buffer
gst_buffer_set_caps(buf, GST_PAD_CAPS(filter->srcpad));
/* just push out the incoming buffer without touching it */
return gst_pad_push (filter->srcpad, buf);
}
I put the profile/level into the caps. But when I query the caps
On Mon, Jul 23, 2012 at 7:34 PM, Tim-Philipp Müller <t.i.m at zen.co.uk> wrote:
> On Mon, 2012-07-23 at 19:17 +0530, kalyan chowdary wrote:
>
> Hi,
>
> In future you might want to consider using an actual subject line that
> describes your question/problem, so people interested in that area can
> spot it right away. Mails with empty subject often get ignored or sorted
> to /dev/null.
>
> > On Fri, Jul 20, 2012 at 8:50 PM, kalyan chowdary
> > <kalyanc007 at gmail.com> wrote:
>
> > I have written parser kind of plugin(aacparser) in which I
> > have parsed the header name.And I linked it to the decoder
> > plugin.
>
> Out of curiosity - why have you written another aacparser in addition to
> the existing aacparse? What does it do that aacparse doesn't do?
>
> > My question is how to get the profile name in gstreamer
> > application.Based on that I have to link my parser to decoder.
> > Ex:
> > filesrc ! parser ! faad ! alsasink
> > filesrc ! parser ! MyDecoder ! alsasink
> >
> > If I set it as property in my parser plugin,will I be able to
> > read it from gstreamer application?
>
> You can put the profile/level into the caps, as aacparse does. The
> application can then either query the caps after the pipeline is
> prerolled, or it could use
>
> g_signal_connect(pipeline, "deep-notify::caps" ...)
>
> to get notified of caps changes on pads (this will be called from a
> streaming thread then usually).
>
> If it's just between your element and your application, you could also
> post a custom element message with the information you want the app to
> know. It will then get the element message on the GstBus.
>
> Cheers
> -Tim
>
> _______________________________________________
> 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/20120723/91ced71f/attachment.html>
More information about the gstreamer-devel
mailing list