My H.264 encoder cound not work well with the MP4 muxer

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

My H.264 encoder cound not work well with the MP4 muxer

Chen, Weian

Hi All

 

I am developing an H.264 encoder element, and with pipeline: gst-launch videotestsrc ! myencoder ! filesink location=test.264 I can dump the test.264 data, and also I can decoder it.

 

But when I use pipeline: gst-launch videotestsrc ! myencoder ! mp4mux ! filesink location=test.mp4 I could not get any output, and the size of test.mp4 is 0.

 

Could anybody here give me some hint what’s the problem in my encoder? Why my encoder could not work with the MP4 muxer?

 

Thanks in advanced.

 

BTW: I got the warning :  (gst-launch-0.10:17032): GStreamer-CRITICAL **: gst_value_set_fraction: assertion `denominator != 0' failed How to fix it?

Weian Chen

Ultra Mobility Group

Intel Corporation

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

 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: My H.264 encoder cound not work well with the MP4 muxer

michael smith-6-3
On Tue, Aug 11, 2009 at 2:08 AM, Chen, Weian<[hidden email]> wrote:

> Hi All
>
>
>
> I am developing an H.264 encoder element, and with pipeline: gst-launch
> videotestsrc ! myencoder ! filesink location=test.264 I can dump the
> test.264 data, and also I can decoder it.
>
>
>
> But when I use pipeline: gst-launch videotestsrc ! myencoder ! mp4mux !
> filesink location=test.mp4 I could not get any output, and the size of
> test.mp4 is 0.
>
>
>
> Could anybody here give me some hint what’s the problem in my encoder? Why
> my encoder could not work with the MP4 muxer?

You've given far too little information for us to help. What caps are
produced by your encoder? What's set on the buffers you push? Etc.


>
>
>
> Thanks in advanced.
>
>
>
> BTW: I got the warning :  (gst-launch-0.10:17032): GStreamer-CRITICAL **:
> gst_value_set_fraction: assertion `denominator != 0' failed How to fix it?


Something's trying to set a fraction (possibly a framerate) with a
denominator of 0 - if you set G_DEBUG=fatal_warnings, you can run in
gdb and see what's triggering this, and thus debug it.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: My H.264 encoder cound not work well with the MP4 muxer

Chen, Weian

 

Hi,

 

Thanks a lot for the reply, my chain function is as following:

 

gst_video_enc_chain (GstPad * pad, GstBuffer * buf)

{

  GstVideoEnc *videoenc = GST_VIDEO_ENC (GST_OBJECT_PARENT (pad));

 

  GstClockTime timestamp, duration;

  gboolean discont;

  GstBuffer *out_buf = NULL;   

  GstFlowReturn ret = GST_FLOW_OK;

  guint width, height;

  guint size;

  guint outsize;

 

  guint8 * buffer = GST_BUFFER_DATA (buf);

  size = GST_BUFFER_SIZE (buf)

 

  timestamp = GST_BUFFER_TIMESTAMP (buf);

  duration = GST_BUFFER_DURATION (buf);

  discont = GST_BUFFER_IS_DISCONT (buf); 

 

  outsize = encode_one_picture (videoenc, buffer, &codedbuf);  //encode one picture

 

   out_buf = gst_buffer_new_and_alloc (outsize); 

   memcpy (GST_BUFFER_DATA (out_buf), coded_buf, outsize);

   GST_BUFFER_SIZE (out_buf) = outsize;

   GST_BUFFER_TIMESTAMP (out_buf) = timestamp;

   GST_BUFFER_DURATION (out_buf) = duration;

   gst_buffer_set_caps (out_buf, GST_PAD_CAPS (videoenc->srcpad));

 

   gst_buffer_unref (buf);

 

   gst_pad_push (videoenc->srcpad, out_buf);

  return ret;

}

 

 

And the srccaps set function is as following:

 

gst_video_enc_set_src_caps (GstVideoEnc * videoenc, GstPad * pad)

{

  GstCaps *outcaps;

  gboolean res;

 

    outcaps = gst_caps_new_simple ("video/x-h264",

      "width", G_TYPE_INT, videoenc->width,

      "height", G_TYPE_INT, videoenc->height,

      "framerate", GST_TYPE_FRACTION, videoenc->fps_num, videoenc->fps_den, NULL);

  res = gst_pad_set_caps (pad, outcaps);

  gst_caps_unref (outcaps);

}

 

Is my info enough? If yes, what’s the problem?

 

Could you please give me some help?

 

Thanks in advanced.

 

 

thanks,

Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
811 19:56
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] My H.264 encoder cound not work well with the MP4 muxer

 

On Tue, Aug 11, 2009 at 2:08 AM, Chen, Weian<[hidden email]> wrote:

> Hi All

> 

> 

> 

> I am developing an H.264 encoder element, and with pipeline: gst-launch

> videotestsrc ! myencoder ! filesink location=test.264 I can dump the

> test.264 data, and also I can decoder it.

> 

> 

> 

> But when I use pipeline: gst-launch videotestsrc ! myencoder ! mp4mux !

> filesink location=test.mp4 I could not get any output, and the size of

> test.mp4 is 0.

> 

> 

> 

> Could anybody here give me some hint what’s the problem in my encoder? Why

> my encoder could not work with the MP4 muxer?

 

You've given far too little information for us to help. What caps are

produced by your encoder? What's set on the buffers you push? Etc.

 


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: My H.264 encoder cound not work well with the MP4 muxer

michael smith-6-3
2009/8/11 Chen, Weian <[hidden email]>:

>
>
> Hi,
>
>
>
> Thanks a lot for the reply, my chain function is as following:
>    gst_pad_push (videoenc->srcpad, out_buf);
>
>   return ret;

Well, this is obviously wrong - you discard the return value of
gst_pad_push, and unconditionally return GST_FLOW_OK.

That's probably not the cause of your problem though - I don't know
what is. You'll need to do some debugging yourself; hopefully the
GST_DEBUG output will be helpful.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: My H.264 encoder cound not work well with the MP4 muxer

Chen, Weian

Thanks a lot for your help. :)

thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009年8月12日 8:47
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] My H.264 encoder cound not work well with the MP4 muxer

2009/8/11 Chen, Weian <[hidden email]>:

>
>
> Hi,
>
>
>
> Thanks a lot for the reply, my chain function is as following:
>    gst_pad_push (videoenc->srcpad, out_buf);
>
>   return ret;

Well, this is obviously wrong - you discard the return value of
gst_pad_push, and unconditionally return GST_FLOW_OK.

That's probably not the cause of your problem though - I don't know
what is. You'll need to do some debugging yourself; hopefully the
GST_DEBUG output will be helpful.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

How to send data to next elemnet before calling _chain()

Chen, Weian
In reply to this post by Chen, Weian

Hi All,

 

I need to send some data to the next element before calling the _chain function (such as send the data from src element to encoder element), does it possible?

 

If yes, how?

 

Thanks in advanced.

 

Weian


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

michael smith-6-3
On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Chen, Weian

The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009年8月20日 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Sudarshan Bisht
      Hi  ,
             I think you can send such extradata using caps . 
                
So on demuxer side do :---
 
           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----
 
 
        GstBuffer    *codec_data = NULL;
    
         guint8* extradata =NULL;

        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    
        codec_data = gst_value_get_buffer(value);
      
        extradata =GST_BUFFER_DATA(codec_data);
 
        // now u can parse extradata to get your fields .
 

2009/8/20 Chen, Weian <[hidden email]>

The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian
-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009年8月20日 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Chen, Weian

 

Thanks a lot for your help.

 

Then in demuxer side, where (or which function) these code should put?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 12:32
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

      Hi  ,

             I think you can send such extradata using caps . 
                

So on demuxer side do :---

 

           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----

 

 

        GstBuffer    *codec_data = NULL;
    

         guint8* extradata =NULL;


        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    

        codec_data = gst_value_get_buffer(value);

      

        extradata =GST_BUFFER_DATA(codec_data);

 

        // now u can parse extradata to get your fields .

 

 

2009/8/20 Chen, Weian <[hidden email]>


The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
820 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Sudarshan Bisht
   Do it as soon as you get extradata , before calling gst_pad_push .  
 

 
2009/8/20 Chen, Weian <[hidden email]>

 

Thanks a lot for your help.

 

Then in demuxer side, where (or which function) these code should put?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 12:32


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

      Hi  ,

             I think you can send such extradata using caps . 
                

So on demuxer side do :---

 

           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----

 

 

        GstBuffer    *codec_data = NULL;
    

         guint8* extradata =NULL;


        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    

        codec_data = gst_value_get_buffer(value);

      

        extradata =GST_BUFFER_DATA(codec_data);

 

        // now u can parse extradata to get your fields .

 

 

2009/8/20 Chen, Weian <[hidden email]>


The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
820 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Chen, Weian

 

Sorry, actually I should do it in the source element.

 

So the problem is different, because maybe the source element will not call gst_pad_push at all.

 

Could you give me some hints?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 13:37
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

   Do it as soon as you get extradata , before calling gst_pad_push .  

 


 

2009/8/20 Chen, Weian <[hidden email]>

 

Thanks a lot for your help.

 

Then in demuxer side, where (or which function) these code should put?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 12:32


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

      Hi  ,

             I think you can send such extradata using caps . 
                

So on demuxer side do :---

 

           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----

 

 

        GstBuffer    *codec_data = NULL;
    

         guint8* extradata =NULL;


        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    

        codec_data = gst_value_get_buffer(value);

      

        extradata =GST_BUFFER_DATA(codec_data);

 

        // now u can parse extradata to get your fields .

 

 

2009/8/20 Chen, Weian <[hidden email]>


The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
820 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Sudarshan Bisht
  what is the source element ?  what it reads ? without pushing data how it will stream buffers to next element ?


 
2009/8/20 Chen, Weian <[hidden email]>

 

Sorry, actually I should do it in the source element.

 

So the problem is different, because maybe the source element will not call gst_pad_push at all.

 

Could you give me some hints?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 13:37


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

   Do it as soon as you get extradata , before calling gst_pad_push .  

 


 

2009/8/20 Chen, Weian <[hidden email]>

 

Thanks a lot for your help.

 

Then in demuxer side, where (or which function) these code should put?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 12:32


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

      Hi  ,

             I think you can send such extradata using caps . 
                

So on demuxer side do :---

 

           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----

 

 

        GstBuffer    *codec_data = NULL;
    

         guint8* extradata =NULL;


        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    

        codec_data = gst_value_get_buffer(value);

      

        extradata =GST_BUFFER_DATA(codec_data);

 

        // now u can parse extradata to get your fields .

 

 

2009/8/20 Chen, Weian <[hidden email]>


The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
820 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Chen, Weian

 

Take V4l2src as an example, it read data from camera.

 

 

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 13:56
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

  what is the source element ?  what it reads ? without pushing data how it will stream buffers to next element ?



 

2009/8/20 Chen, Weian <[hidden email]>

 

Sorry, actually I should do it in the source element.

 

So the problem is different, because maybe the source element will not call gst_pad_push at all.

 

Could you give me some hints?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 13:37


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

   Do it as soon as you get extradata , before calling gst_pad_push .  

 


 

2009/8/20 Chen, Weian <[hidden email]>

 

Thanks a lot for your help.

 

Then in demuxer side, where (or which function) these code should put?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 12:32


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

      Hi  ,

             I think you can send such extradata using caps . 
                

So on demuxer side do :---

 

           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----

 

 

        GstBuffer    *codec_data = NULL;
    

         guint8* extradata =NULL;


        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    

        codec_data = gst_value_get_buffer(value);

      

        extradata =GST_BUFFER_DATA(codec_data);

 

        // now u can parse extradata to get your fields .

 

 

2009/8/20 Chen, Weian <[hidden email]>


The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
820 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Sudarshan Bisht
 Actually i am not very sure where to do it in such elements . 

2009/8/20 Chen, Weian <[hidden email]>

 

Take V4l2src as an example, it read data from camera.

 

 

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 13:56


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

  what is the source element ?  what it reads ? without pushing data how it will stream buffers to next element ?



 

2009/8/20 Chen, Weian <[hidden email]>

 

Sorry, actually I should do it in the source element.

 

So the problem is different, because maybe the source element will not call gst_pad_push at all.

 

Could you give me some hints?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 13:37


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

   Do it as soon as you get extradata , before calling gst_pad_push .  

 


 

2009/8/20 Chen, Weian <[hidden email]>

 

Thanks a lot for your help.

 

Then in demuxer side, where (or which function) these code should put?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 12:32


To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

      Hi  ,

             I think you can send such extradata using caps . 
                

So on demuxer side do :---

 

           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----

 

 

        GstBuffer    *codec_data = NULL;
    

         guint8* extradata =NULL;


        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    

        codec_data = gst_value_get_buffer(value);

      

        extradata =GST_BUFFER_DATA(codec_data);

 

        // now u can parse extradata to get your fields .

 

 

2009/8/20 Chen, Weian <[hidden email]>


The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
820 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Chen, Weian
In reply to this post by Sudarshan Bisht

Hi,

 

I have another question, could you help to answew:

 

In your code, for stream->caps, whose caps is it?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820 12:32
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

      Hi  ,

             I think you can send such extradata using caps . 
                

So on demuxer side do :---

 

           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----

 

 

        GstBuffer    *codec_data = NULL;
    

         guint8* extradata =NULL;


        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    

        codec_data = gst_value_get_buffer(value);

      

        extradata =GST_BUFFER_DATA(codec_data);

 

        // now u can parse extradata to get your fields .

 

 

2009/8/20 Chen, Weian <[hidden email]>


The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
820 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: How to send data to next elemnet before calling _chain()

Sudarshan Bisht
 
Hi ,
  
 You would be setting some caps on the buffer before passing it to next element .   It is that buffer.

2009/8/20 Chen, Weian <[hidden email]>

Hi,

 

I have another question, could you help to answew:

 

In your code, for stream->caps, whose caps is it?

 

thanks,

Weian


From: sudarshan bisht [mailto:[hidden email]]
Sent: 2009
820
12:32

To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

 

      Hi  ,

             I think you can send such extradata using caps . 
                

So on demuxer side do :---

 

           GstBuffer *=buf;

            buf = gst_buffer_new_and_alloc (size);

            memcpy (GST_BUFFER_DATA (buf), the data u want to pass as an extradata (should be guint8*) , size);

           gst_caps_set_simple (stream->caps,"codec_data", GST_TYPE_BUFFER, buf, NULL);

           gst_buffer_unref (buf);

 On Decoder side in _setcaps function u can do :----

 

 

        GstBuffer    *codec_data = NULL;
    

         guint8* extradata =NULL;


        capStruct = gst_caps_get_structure(caps,0);

       /* Read extra data passed via demuxer. */
        value = gst_structure_get_value(capStruct, "codec_data");
    

        codec_data = gst_value_get_buffer(value);

      

        extradata =GST_BUFFER_DATA(codec_data);

 

        // now u can parse extradata to get your fields .

 

 

2009/8/20 Chen, Weian <[hidden email]>


The data I want to send is couple of bytes (some information of current element)  which will be used in next element's _setcap() funct. So we could not wait the gst_pad_push() function to send.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009
820 1:35
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] How to send data to next elemnet before calling _chain()

On Wed, Aug 19, 2009 at 4:41 AM, Chen, Weian<[hidden email]> wrote:
> Hi All,
>
> I need to send some data to the next element before calling the _chain
> function (such as send the data from src element to encoder element), does
> it possible?

Can you explain in a bit more detail what you want to do?

You normally should call gst_pad_push() to send data to the next
element in your pipeline - but that calls the chain function in that
next element, so it sounds like you're asking for something different?

What data do you want to send? Why do you want to avoid calling the
chain function when sending this data?

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel




--
Regards,

Sudarshan Bisht

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

who will call x264enc's _setcap function?

Chen, Weian
In reply to this post by Chen, Weian

Hi All

 

Who will call the override function gst_x264_enc_sink_set_caps (GstPad * pad, GstCaps * caps) in gstx264enc? the gstreamer core? Then which func?

 

And if I want to add some codec_data into caps (above caps), where should I modify, suppose it should be modified in the upstream element such as v4l2src (we can take it as an example)?

 

In another word, where is the caps form?

 

Thanks in advanced.

 

thanks,

Weian


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: who will call x264enc's _setcap function?

michael smith-6-3
On Thu, Aug 20, 2009 at 5:35 AM, Chen, Weian<[hidden email]> wrote:
> Hi All
>
>
>
> Who will call the override function gst_x264_enc_sink_set_caps (GstPad *
> pad, GstCaps * caps) in gstx264enc? the gstreamer core? Then which func?

The core will call this when the caps get set on the peer pad (by the
upstream element).

>
> And if I want to add some codec_data into caps (above caps), where should I
> modify, suppose it should be modified in the upstream element such as
> v4l2src (we can take it as an example)?

Yes, in the upstream element. However, don't do this arbitrarily - for
your example, x264enc has as its input raw video. Raw video has well
defined caps, adding arbitrary other things to those caps would be a
bad idea.

You should explain, with _specific details_, what you want to do, so
that we can suggest a better approach for what you're trying to do.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: who will call x264enc's _setcap function?

Chen, Weian

Thanks Michael.

I have some information (couple of bytes) has to be passed to next element before it call _set_caps.

Now I add codec_data to the caps of upstream element's srcpad, and then set this caps to the buffer which will be sent to next element, with this, I can get the codec_data in next element's _set_caps function. Thanks for sudarshan's hint.

thanks,
Weian

-----Original Message-----
From: Michael Smith [mailto:[hidden email]]
Sent: 2009年8月21日 2:46
To: Discussion of the development of GStreamer
Subject: Re: [gst-devel] who will call x264enc's _setcap function?

On Thu, Aug 20, 2009 at 5:35 AM, Chen, Weian<[hidden email]> wrote:
> Hi All
>
>
>
> Who will call the override function gst_x264_enc_sink_set_caps (GstPad *
> pad, GstCaps * caps) in gstx264enc? the gstreamer core? Then which func?

The core will call this when the caps get set on the peer pad (by the
upstream element).

>
> And if I want to add some codec_data into caps (above caps), where should I
> modify, suppose it should be modified in the upstream element such as
> v4l2src (we can take it as an example)?

Yes, in the upstream element. However, don't do this arbitrarily - for
your example, x264enc has as its input raw video. Raw video has well
defined caps, adding arbitrary other things to those caps would be a
bad idea.

You should explain, with _specific details_, what you want to do, so
that we can suggest a better approach for what you're trying to do.

Mike

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
12