request pad issue

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

request pad issue

Zoltan Seress
Hi dev!

I' m working on a source element, which is designed for a grabber card. In this state of progress, the element has only one request pad (of course a source pad). This pad can give out a special h264 or raw stream. But I would like to create additional (1 or 2 more) request pads, that would deliver the mentioned grabbed stream with different framerate and/or image format. I looked into the description of GstCollectPads, which might can be used to handle more pads, but I noticed one line:
"... Pads are added to the collection with gst_collect_pads_add_pad()/ gst_collect_pads_remove_pad(). The pad has to be a sinkpad...."

I need source pads. Can my problem be solved with GstCollectPads? If it is yes, can you show me an element or an example that I can use as a reference?

Thanks in advance,
Zoli


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: request pad issue

Arnout Vandecappelle
On Wednesday 15 October 2008 14:38:51 Zoltan Seress wrote:

> I' m working on a source element, which is designed for a grabber card. In
> this state of progress, the element has only one request pad (of course a
> source pad). This pad can give out a special h264 or raw stream. But I
> would like to create additional (1 or 2 more) request pads, that would
> deliver the mentioned grabbed stream with different framerate and/or image
> format. I looked into the description of GstCollectPads, which might can be
> used to handle more pads, but I noticed one line: "... Pads are added to
> the collection with gst_collect_pads_add_pad()/
> gst_collect_pads_remove_pad(). The pad has to be a sinkpad...."
>
> I need source pads. Can my problem be solved with GstCollectPads? If it is
> yes, can you show me an element or an example that I can use as a
> reference?

 The tee element has source request pads, and it's relatively simple.

 Regards,
 Arnout


--
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  D206 D44B 5155 DF98 550D  3F2A 2213 88AA A1C7 C933

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: request pad issue

Zoltan Seress

Hi!
I have already had a look at tee, but at first sight it didn't seem so simple. Then I will give a second look.

I ran into a problem.

static GstStaticPadTemplate hikvision_src_template = GST_STATIC_PAD_TEMPLATE ("src%d",
    GST_PAD_SRC,
    GST_PAD_REQUEST,
    GST_STATIC_CAPS_ANY);

base_init:
gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&hikvision_src_template));

class_init:
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR (gst_hikvision_src_request_new_pad);

static GstPad *
gst_hikvision_src_request_new_pad (GstElement * element, GstPadTemplate * templ,
    const gchar * unused)
{
    GstPad *srcpad;
    gchar *name;
    GstHikvisionSrc *hiksrc;
    GstElementClass *klass;
   
    //g_return_val_if_fail (templ != NULL, NULL);
    //g_return_val_if_fail (GST_HIKVISION_SRC (element), NULL);
   
    hiksrc = GST_HIKVISION_SRC (element);
    klass = GST_ELEMENT_GET_CLASS (element);

    name = g_strdup_printf ("src%d", hiksrc->pad_counter++);
    fprintf(stderr, "name: %s", name);
    srcpad = gst_pad_new_from_template (templ, name);
    g_free (name);

    gst_element_add_pad (element, srcpad);
   
    return srcpad;   
}

If I do the request pad creation, I am given the following error message:

** (gst-launch-0.10:24734): CRITICAL **: gst_base_src_init: assertion `pad_template != NULL' failed

Although GST_DEBUG says that src0 is created and was succesfully linked with the sinkpad of the next element in the pipeline.


If I define the pad template like this:

static GstStaticPadTemplate hikvision_src_template = GST_STATIC_PAD_TEMPLATE ("src",
    GST_PAD_SRC,
    GST_PAD_REQUEST,
    GST_STATIC_CAPS_ANY);

And use it in the new_request_pad function like this:

srcpad = gst_pad_new_from_template (templ, "src");

In this case, there is no problem, but I need more pads with specific names. What can be the solution?

Thanks,
Zoli

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: request pad issue

Wim Taymans
On Wed, 2008-10-22 at 17:19 +0200, Zoltan Seress wrote:

>
> Hi!
> I have already had a look at tee, but at first sight it didn't seem so
> simple. Then I will give a second look.
>
> I ran into a problem.
>
> static GstStaticPadTemplate hikvision_src_template =
> GST_STATIC_PAD_TEMPLATE ("src%d",
>     GST_PAD_SRC,
>     GST_PAD_REQUEST,
>     GST_STATIC_CAPS_ANY);
>
> base_init:
> gst_element_class_add_pad_template (element_class,
> gst_static_pad_template_get (&hikvision_src_template));
>
> class_init:
> gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR
> (gst_hikvision_src_request_new_pad);
>
> static GstPad *
> gst_hikvision_src_request_new_pad (GstElement * element,
> GstPadTemplate * templ,
>     const gchar * unused)
> {
>     GstPad *srcpad;
>     gchar *name;
>     GstHikvisionSrc *hiksrc;
>     GstElementClass *klass;
>    
>     //g_return_val_if_fail (templ != NULL, NULL);
>     //g_return_val_if_fail (GST_HIKVISION_SRC (element), NULL);
>    
>     hiksrc = GST_HIKVISION_SRC (element);
>     klass = GST_ELEMENT_GET_CLASS (element);
>
>     name = g_strdup_printf ("src%d", hiksrc->pad_counter++);
>     fprintf(stderr, "name: %s", name);
>     srcpad = gst_pad_new_from_template (templ, name);
>     g_free (name);
>
>     gst_element_add_pad (element, srcpad);
>    
>     return srcpad;    
> }
>
> If I do the request pad creation, I am given the following error
> message:
>
> ** (gst-launch-0.10:24734): CRITICAL **: gst_base_src_init: assertion
> `pad_template != NULL' failed

You can't currently add request pads to basesrc. You will need to extend
your source from GstElement and copy the relevant basesrc code.

Wim

>
> Although GST_DEBUG says that src0 is created and was succesfully
> linked with the sinkpad of the next element in the pipeline.
>
>
> If I define the pad template like this:
>
> static GstStaticPadTemplate hikvision_src_template =
> GST_STATIC_PAD_TEMPLATE ("src",
>     GST_PAD_SRC,
>     GST_PAD_REQUEST,
>     GST_STATIC_CAPS_ANY);
>
> And use it in the new_request_pad function like this:
>
> srcpad = gst_pad_new_from_template (templ, "src");
>
> In this case, there is no problem, but I need more pads with specific
> names. What can be the solution?
>
> Thanks,
> Zoli
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: request pad issue

Zoltan Seress



You can't currently add request pads to basesrc. You will need to extend
your source from GstElement and copy the relevant basesrc code.

Hi!

I found it in the description of GstBaseSrc;
"There is only support in GstBaseSrc for exactly one source pad, which should be named "src"."

But my source element is exended from GstPushSrc. If I simply modify my boilerplate, that is simply not good, becouse the source has GstBaseSrc specific functions like create, start, etc. How can I do that exactly? I'm not pro in gstreamer.
And another question: is there any element which has 2 or more always src pads?

Zoli


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: request pad issue

Zoltan Seress

Can someone give a hand who is experienced in this issue?

Zoli

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel