Question on the element who will have two pad types

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

Question on the element who will have two pad types

Chen, Weian

Hi All,

 

I am thinking to develop an element, who will have two source pad, one is always type, and the other is request type, then how to create these pads?

 

And what will the _chain function look like?

 

Weian Chen

Ultra Mobility Group

Intel Corporation

Tel:  86-21-6116-6478
Fax: 86-21-3429-1915
iNet: 8-821-6478

 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question on the element who will have two pad types

michael smith-6-3
On Tue, Oct 13, 2009 at 7:03 PM, Chen, Weian <[hidden email]> wrote:
> Hi All,
>
>
>
> I am thinking to develop an element, who will have two source pad, one is
> always type, and the other is request type, then how to create these pads?

That's fine - just create the appropriate pad templates, and then
implement the request pad function for your request pad template.


>
>
>
> And what will the _chain function look like?

No way to give advice about that - we don't know anything about your
element. But there's nothing intrinsically difficult about what you've
described - just push data on the pads you have!

Mike

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question on the element who will have two pad types

Chen, Weian


thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009年10月14日 13:27
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on the element who will have two pad types

On Tue, Oct 13, 2009 at 7:03 PM, Chen, Weian <[hidden email]> wrote:
> Hi All,
>
>
>
> I am thinking to develop an element, who will have two source pad, one is
> always type, and the other is request type, then how to create these pads?

That's fine - just create the appropriate pad templates, and then
implement the request pad function for your request pad template.


>
>
>
> And what will the _chain function look like?

No way to give advice about that - we don't know anything about your
element. But there's nothing intrinsically difficult about what you've
described - just push data on the pads you have!

I mean do we need two _chain functions or we can push data to the 2 pads in the same _chain function (the data push to the 2 pads is different).

Mike

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question on the element who will have two pad types

michael smith-6-3
>
> No way to give advice about that - we don't know anything about your
> element. But there's nothing intrinsically difficult about what you've
> described - just push data on the pads you have!
>
> I mean do we need two _chain functions or we can push data to the 2 pads in the same _chain function (the data push to the 2 pads is different).

No - what you've described is just like any normal demuxer. You
wouldn't have multiple chain functions, since you don't have multiple
sinkpads.

Mike

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question on the element who will have two pad types

Chen, Weian

 

Thanks a lot for your information.

 

thanks,

Weian

 

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
1014 13:42
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on the element who will have two pad types

 

> 

> No way to give advice about that - we don't know anything about your

> element. But there's nothing intrinsically difficult about what you've

> described - just push data on the pads you have!

> 

> I mean do we need two _chain functions or we can push data to the 2 pads in the same _chain function (the data push to the 2 pads is different).

 

No - what you've described is just like any normal demuxer. You

wouldn't have multiple chain functions, since you don't have multiple

sinkpads.

 

Mike

 

------------------------------------------------------------------------------

Come build with us! The BlackBerry(R) Developer Conference in SF, CA

is the only developer event you need to attend this year. Jumpstart your

developing skills, take BlackBerry mobile applications to market and stay

ahead of the curve. Join us from November 9 - 12, 2009. Register now!

http://p.sf.net/sfu/devconference

_______________________________________________

gstreamer-devel mailing list

[hidden email]

https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question on the element who will have two pad types

Chen, Weian
In reply to this post by michael smith-6-3

Hi

 

Currently, I will create two src pads, one is ALWAYS, and the other is SOMETIMES, but when both of the pads are created, it will hang on _chain() when calling gst_pad_push for the first src pad, seems something wrong with preproll. But it works well when the SOMETIMES pad is not created.

 

Could anybody here give me some hint?

 

Thanks in advance.

 

 

Following is some of the code:

 

static GstStaticPadTemplate src00_factory = GST_STATIC_PAD_TEMPLATE ("src_00",

        GST_PAD_SRC,

        GST_PAD_ALWAYS,

        GST_STATIC_CAPS ("video/mpeg;"

        "video/x-h264")

        );

 

static GstStaticPadTemplate src01_factory = GST_STATIC_PAD_TEMPLATE ("src_01",

        GST_PAD_SRC,

        GST_PAD_SOMETIMES,

        GST_STATIC_CAPS ("video/x-raw-yuv")

        );

………

srcpad_00 = gst_pad_new_from_static_template (&src00_factory, "src_00");

gst_element_add_pad (GST_ELEMENT(filter), srcpad_00);

 

gst_pad_set_caps (srcpad_00, outcaps00);

 

if (create_sometime) {

    srcpad_01 = gst_pad_new_from_static_template (&src01_factory, "src_01");

gst_element_add_pad (GST_ELEMENT(filter), srcpad_01);

gst_pad_set_caps (srcpad_01, outcaps01);

}

…….

 

_chain()

{

………

 

ret = gst_pad_push (mixvideoenc->srcpad_00, out_buf_00);    //if will hang here, if both of the src pad is created.

 

if (srcpad_01 && create_sometim) {

     ret = gst_pad_push (mixvideoenc->srcpad_01, out_buf_01);   

}

………

}

 

thanks,

Weian

 

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
1014 13:42
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on the element who will have two pad types

 

> 

> No way to give advice about that - we don't know anything about your

> element. But there's nothing intrinsically difficult about what you've

> described - just push data on the pads you have!

> 

> I mean do we need two _chain functions or we can push data to the 2 pads in the same _chain function (the data push to the 2 pads is different).

 

No - what you've described is just like any normal demuxer. You

wouldn't have multiple chain functions, since you don't have multiple

sinkpads.

 

Mike

 

------------------------------------------------------------------------------

Come build with us! The BlackBerry(R) Developer Conference in SF, CA

is the only developer event you need to attend this year. Jumpstart your

developing skills, take BlackBerry mobile applications to market and stay

ahead of the curve. Join us from November 9 - 12, 2009. Register now!

http://p.sf.net/sfu/devconference

_______________________________________________

gstreamer-devel mailing list

[hidden email]

https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question on the element who will have two pad types

Thiago Sousa Santos-2


2009/10/14 Chen, Weian <[hidden email]>

Hi

 

Currently, I will create two src pads, one is ALWAYS, and the other is SOMETIMES, but when both of the pads are created, it will hang on _chain() when calling gst_pad_push for the first src pad, seems something wrong with preproll. But it works well when the SOMETIMES pad is not created.

 

Could anybody here give me some hint?

You're probably missing a queue after each of the src pads on your pipeline.
 

 

Thanks in advance.

 

 

Following is some of the code:

 

static GstStaticPadTemplate src00_factory = GST_STATIC_PAD_TEMPLATE ("src_00",

        GST_PAD_SRC,

        GST_PAD_ALWAYS,

        GST_STATIC_CAPS ("video/mpeg;"

        "video/x-h264")

        );

 

static GstStaticPadTemplate src01_factory = GST_STATIC_PAD_TEMPLATE ("src_01",

        GST_PAD_SRC,

        GST_PAD_SOMETIMES,

        GST_STATIC_CAPS ("video/x-raw-yuv")

        );

………

srcpad_00 = gst_pad_new_from_static_template (&src00_factory, "src_00");

gst_element_add_pad (GST_ELEMENT(filter), srcpad_00);

 

gst_pad_set_caps (srcpad_00, outcaps00);

 

if (create_sometime) {

    srcpad_01 = gst_pad_new_from_static_template (&src01_factory, "src_01");

gst_element_add_pad (GST_ELEMENT(filter), srcpad_01);

gst_pad_set_caps (srcpad_01, outcaps01);

}

…….

 

_chain()

{

………

 

ret = gst_pad_push (mixvideoenc->srcpad_00, out_buf_00);    //if will hang here, if both of the src pad is created.

 

if (srcpad_01 && create_sometim) {

     ret = gst_pad_push (mixvideoenc->srcpad_01, out_buf_01);   

}

………

}

 

thanks,

Weian

 

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
1014 13:42
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on the element who will have two pad types

 

> No way to give advice about that - we don't know anything about your

> element. But there's nothing intrinsically difficult about what you've

> described - just push data on the pads you have!

> I mean do we need two _chain functions or we can push data to the 2 pads in the same _chain function (the data push to the 2 pads is different).

 

No - what you've described is just like any normal demuxer. You

wouldn't have multiple chain functions, since you don't have multiple

sinkpads.

 

Mike

 

------------------------------------------------------------------------------

Come build with us! The BlackBerry(R) Developer Conference in SF, CA

is the only developer event you need to attend this year. Jumpstart your

developing skills, take BlackBerry mobile applications to market and stay

ahead of the curve. Join us from November 9 - 12, 2009. Register now!

http://p.sf.net/sfu/devconference

_______________________________________________

gstreamer-devel mailing list

[hidden email]

https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Thiago Sousa Santos

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question on the element who will have two pad types

Chen, Weian

 

Thanks a lot for your replay.

 

I already add queue after each of the pads, but the pipeline will hang after running for a while, the log information said: queue is full, waiting for free space.

 

What’s the problem?

 

thanks,

Weian


From: thiagoss [mailto:[hidden email]]
Sent: 2009
1014 22:12
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on the element who will have two pad types

 

 

2009/10/14 Chen, Weian <[hidden email]>

Hi

 

Currently, I will create two src pads, one is ALWAYS, and the other is SOMETIMES, but when both of the pads are created, it will hang on _chain() when calling gst_pad_push for the first src pad, seems something wrong with preproll. But it works well when the SOMETIMES pad is not created.

 

Could anybody here give me some hint?

You're probably missing a queue after each of the src pads on your pipeline.

 

 

Thanks in advance.

 

 

Following is some of the code:

 

static GstStaticPadTemplate src00_factory = GST_STATIC_PAD_TEMPLATE ("src_00",

        GST_PAD_SRC,

        GST_PAD_ALWAYS,

        GST_STATIC_CAPS ("video/mpeg;"

        "video/x-h264")

        );

 

static GstStaticPadTemplate src01_factory = GST_STATIC_PAD_TEMPLATE ("src_01",

        GST_PAD_SRC,

        GST_PAD_SOMETIMES,

        GST_STATIC_CAPS ("video/x-raw-yuv")

        );

………

srcpad_00 = gst_pad_new_from_static_template (&src00_factory, "src_00");

gst_element_add_pad (GST_ELEMENT(filter), srcpad_00);

 

gst_pad_set_caps (srcpad_00, outcaps00);

 

if (create_sometime) {

    srcpad_01 = gst_pad_new_from_static_template (&src01_factory, "src_01");

gst_element_add_pad (GST_ELEMENT(filter), srcpad_01);

gst_pad_set_caps (srcpad_01, outcaps01);

}

…….

 

_chain()

{

………

 

ret = gst_pad_push (mixvideoenc->srcpad_00, out_buf_00);    //if will hang here, if both of the src pad is created.

 

if (srcpad_01 && create_sometim) {

     ret = gst_pad_push (mixvideoenc->srcpad_01, out_buf_01);   

}

………

}

 

thanks,

Weian

 

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
1014 13:42
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on the element who will have two pad types

 

> No way to give advice about that - we don't know anything about your

> element. But there's nothing intrinsically difficult about what you've

> described - just push data on the pads you have!

> I mean do we need two _chain functions or we can push data to the 2 pads in the same _chain function (the data push to the 2 pads is different).

 

No - what you've described is just like any normal demuxer. You

wouldn't have multiple chain functions, since you don't have multiple

sinkpads.

 

Mike

 

------------------------------------------------------------------------------

Come build with us! The BlackBerry(R) Developer Conference in SF, CA

is the only developer event you need to attend this year. Jumpstart your

developing skills, take BlackBerry mobile applications to market and stay

ahead of the curve. Join us from November 9 - 12, 2009. Register now!

http://p.sf.net/sfu/devconference

_______________________________________________

gstreamer-devel mailing list

[hidden email]

https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Thiago Sousa Santos


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Question on the element who will have two pad types

Thiago Sousa Santos-2


2009/10/15 Chen, Weian <[hidden email]>

 

Thanks a lot for your replay.

 

I already add queue after each of the pads, but the pipeline will hang after running for a while, the log information said: queue is full, waiting for free space.

 

What’s the problem?

Erm, the queue is full and it blocks. It has properties for setting its size (check with gst-inspect queue). Set them to a larger value or unlimited.
 

 

thanks,

Weian


From: thiagoss [mailto:[hidden email]]
Sent: 2009
1014 22:12


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on the element who will have two pad types

 

 

2009/10/14 Chen, Weian <[hidden email]>

Hi

 

Currently, I will create two src pads, one is ALWAYS, and the other is SOMETIMES, but when both of the pads are created, it will hang on _chain() when calling gst_pad_push for the first src pad, seems something wrong with preproll. But it works well when the SOMETIMES pad is not created.

 

Could anybody here give me some hint?

You're probably missing a queue after each of the src pads on your pipeline.

 

 

Thanks in advance.

 

 

Following is some of the code:

 

static GstStaticPadTemplate src00_factory = GST_STATIC_PAD_TEMPLATE ("src_00",

        GST_PAD_SRC,

        GST_PAD_ALWAYS,

        GST_STATIC_CAPS ("video/mpeg;"

        "video/x-h264")

        );

 

static GstStaticPadTemplate src01_factory = GST_STATIC_PAD_TEMPLATE ("src_01",

        GST_PAD_SRC,

        GST_PAD_SOMETIMES,

        GST_STATIC_CAPS ("video/x-raw-yuv")

        );

………

srcpad_00 = gst_pad_new_from_static_template (&src00_factory, "src_00");

gst_element_add_pad (GST_ELEMENT(filter), srcpad_00);

 

gst_pad_set_caps (srcpad_00, outcaps00);

 

if (create_sometime) {

    srcpad_01 = gst_pad_new_from_static_template (&src01_factory, "src_01");

gst_element_add_pad (GST_ELEMENT(filter), srcpad_01);

gst_pad_set_caps (srcpad_01, outcaps01);

}

…….

 

_chain()

{

………

 

ret = gst_pad_push (mixvideoenc->srcpad_00, out_buf_00);    //if will hang here, if both of the src pad is created.

 

if (srcpad_01 && create_sometim) {

     ret = gst_pad_push (mixvideoenc->srcpad_01, out_buf_01);   

}

………

}

 

thanks,

Weian

 

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
1014 13:42
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] Question on the element who will have two pad types

 

> No way to give advice about that - we don't know anything about your

> element. But there's nothing intrinsically difficult about what you've

> described - just push data on the pads you have!

> I mean do we need two _chain functions or we can push data to the 2 pads in the same _chain function (the data push to the 2 pads is different).

 

No - what you've described is just like any normal demuxer. You

wouldn't have multiple chain functions, since you don't have multiple

sinkpads.

 

Mike

 

------------------------------------------------------------------------------

Come build with us! The BlackBerry(R) Developer Conference in SF, CA

is the only developer event you need to attend this year. Jumpstart your

developing skills, take BlackBerry mobile applications to market and stay

ahead of the curve. Join us from November 9 - 12, 2009. Register now!

http://p.sf.net/sfu/devconference

_______________________________________________

gstreamer-devel mailing list

[hidden email]

https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Thiago Sousa Santos


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Thiago Sousa Santos

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel