Discussion:
[gst-devel] Where is the data in the Pad
(too old to reply)
karmendra jain
2007-10-04 08:25:06 UTC
Permalink
Hi All
i was trying to access the data from the pad in my pipeline
**** pipeline***
filesrc->parser->decoder->conv->sink
***
now i used gst_pad_add_data_probe to a element (say sink)

its calling the function i want whenever a "have-data" signal is there
and i get the address of the pad ..
but the PROBLEM IS
which is the data in the pad ???
i read the structure of the pad but was not able to find any such
variable/ptr/buffer

Can anyone please help ??
i basically want to access the processed data from the pipeline and
pass it to some other api of my own .. how can i do that ???


Regards
karmendra jain
2007-10-04 12:01:04 UTC
Permalink
with gst_pad_add_buffer_probe we can know when there is buffer in the
pad .. and call out own function but how to access the content of that
buffer in that function ?????
Post by karmendra jain
Hi All
i was trying to access the data from the pad in my pipeline
**** pipeline***
filesrc->parser->decoder->conv->sink
***
now i used gst_pad_add_data_probe to a element (say sink)
its calling the function i want whenever a "have-data" signal is there
and i get the address of the pad ..
but the PROBLEM IS
which is the data in the pad ???
i read the structure of the pad but was not able to find any such
variable/ptr/buffer
Can anyone please help ??
i basically want to access the processed data from the pipeline and
pass it to some other api of my own .. how can i do that ???
Regards
René Stadler
2007-10-04 12:21:04 UTC
Permalink
Post by karmendra jain
with gst_pad_add_buffer_probe we can know when there is buffer in the
pad .. and call out own function but how to access the content of that
buffer in that function ?????
Use GST_BUFFER_DATA (buffer) to access the data pointer, which points to
a region of size GST_BUFFER_SIZE (buffer).

The core reference has everything you need to know about what to do with
GstBuffer objects:

http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html
Post by karmendra jain
Post by karmendra jain
Hi All
i was trying to access the data from the pad in my pipeline
**** pipeline***
filesrc->parser->decoder->conv->sink
***
now i used gst_pad_add_data_probe to a element (say sink)
its calling the function i want whenever a "have-data" signal is there
and i get the address of the pad ..
but the PROBLEM IS
which is the data in the pad ???
i read the structure of the pad but was not able to find any such
variable/ptr/buffer
Can anyone please help ??
i basically want to access the processed data from the pipeline and
pass it to some other api of my own .. how can i do that ???
Regards
--
Regards,
René Stadler
karmendra jain
2007-10-04 12:36:26 UTC
Permalink
Thanks Rene
i was aware of this .. but how to get the buffer ?? i mean
i can get the address of the pad (gst_element_get_pad)
and set the callback for buffer(gst_pad_add_buffer_probe).. but how to
get the buffer ??
GST_BUFFER_DATA(buffer) needs buffer to be defined ie .. the address
of buffer needs to be known . .how will i do that .. i am confused
If u dont mind ..can u please explain it a little more

Thanks
Post by René Stadler
Post by karmendra jain
with gst_pad_add_buffer_probe we can know when there is buffer in the
pad .. and call out own function but how to access the content of that
buffer in that function ?????
Use GST_BUFFER_DATA (buffer) to access the data pointer, which points to
a region of size GST_BUFFER_SIZE (buffer).
The core reference has everything you need to know about what to do with
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html
Post by karmendra jain
Post by karmendra jain
Hi All
i was trying to access the data from the pad in my pipeline
**** pipeline***
filesrc->parser->decoder->conv->sink
***
now i used gst_pad_add_data_probe to a element (say sink)
its calling the function i want whenever a "have-data" signal is there
and i get the address of the pad ..
but the PROBLEM IS
which is the data in the pad ???
i read the structure of the pad but was not able to find any such
variable/ptr/buffer
Can anyone please help ??
i basically want to access the processed data from the pipeline and
pass it to some other api of my own .. how can i do that ???
Regards
--
Regards,
René Stadler
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
René Stadler
2007-10-04 12:44:13 UTC
Permalink
Post by karmendra jain
Thanks Rene
i was aware of this .. but how to get the buffer ?? i mean
i can get the address of the pad (gst_element_get_pad)
and set the callback for buffer(gst_pad_add_buffer_probe).. but how to
get the buffer ??
GST_BUFFER_DATA(buffer) needs buffer to be defined ie .. the address
of buffer needs to be known . .how will i do that .. i am confused
If u dont mind ..can u please explain it a little more
Thanks
<snip>

The docs say somewhere that the probe callback has the same signature as
a handler for the have-data signal of GstPad, so the function you pass
to add_buffer_probe looks like:

static gboolean
my_probe (GstPad *pad, GstMiniObject *obj, gpointer user_data)
{
GstBuffer *buffer = GST_BUFFER (obj);
...
--
Regards,
René Stadler
karmendra jain
2007-10-04 13:07:43 UTC
Permalink
Thanks a lot
Its working .. i read that line but didn't understand wat to do ..

If possible(whenever u got time ..) .. Can u explain how its happning
****what i have done now is ****
gst_pad_add_buffer_probe(mypad,G_CALLBACK(mycallback), mypad)

and static gboolean mycallback(GstPad *pad, GstMiniObject *obj,
gpointer user_data)

**so my doubt it *** ---->how the GstMiniObject is gettin filled ???
ie who passes the address to obj and how ???
Post by René Stadler
Post by karmendra jain
Thanks Rene
i was aware of this .. but how to get the buffer ?? i mean
i can get the address of the pad (gst_element_get_pad)
and set the callback for buffer(gst_pad_add_buffer_probe).. but how to
get the buffer ??
GST_BUFFER_DATA(buffer) needs buffer to be defined ie .. the address
of buffer needs to be known . .how will i do that .. i am confused
If u dont mind ..can u please explain it a little more
Thanks
<snip>
The docs say somewhere that the probe callback has the same signature as
a handler for the have-data signal of GstPad, so the function you pass
static gboolean
my_probe (GstPad *pad, GstMiniObject *obj, gpointer user_data)
{
GstBuffer *buffer = GST_BUFFER (obj);
...
--
Regards,
René Stadler
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
gstreamer-devel mailing list
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
René Stadler
2007-10-04 15:50:36 UTC
Permalink
Post by karmendra jain
Thanks a lot
Its working .. i read that line but didn't understand wat to do ..
If possible(whenever u got time ..) .. Can u explain how its happning
I'm not sure that I understand what you want me to tell you. In
GStreamer, data flows around between elements by pushing (and pulling)
GstBuffer objects between pads. Pad probes allow you to get notified
exactly when this happens, letting you peek at the data.

You can also use an identity or fakesink element to get hold of the
buffers; these elements provide a "handoff" signal, which is a bit
easier to use since you don't need to mock around with pads.
Post by karmendra jain
****what i have done now is ****
gst_pad_add_buffer_probe(mypad,G_CALLBACK(mycallback), mypad)
and static gboolean mycallback(GstPad *pad, GstMiniObject *obj,
gpointer user_data)
**so my doubt it *** ---->how the GstMiniObject is gettin filled ???
ie who passes the address to obj and how ???
<snip>

For any details you might want, look at who calls the internal function
gst_pad_emit_have_data_signal in gst/gstpad.c:

http://webcvs.freedesktop.org/gstreamer/gstreamer/gst/gstpad.c?revision=1.560&view=markup
--
Regards,
René Stadler
Continue reading on narkive:
Loading...