Problem in getting the entire frame from gstbuffer at once

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

Problem in getting the entire frame from gstbuffer at once

Kiran Kumar
Hi,

I am new to gstreamer. I am writing a plugin by referring gstreamer plugin writers guide.

My gst-launch command line looks like  gst-launch-1.0 filesrc location=mandrill.pgm ! image/pgm,width=512,height=512,framerate=1/1 ! mynewplugin ! filesink location=image_out.pgm

I am trying to process the data buffer inside _chain() function of my new plugin.

Problem:
GstMapInfo map;
static GstFlowReturn
gst_mynewplugin_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
{
      [....]

        gst_buffer_map (buf, &map, GST_MAP_READ);
        g_print("buffer size=%d\n", map.size);
        
       [.......]
}

The input image size is 512x512x8(bit depth)=2097152 bits. But, map.size is always = 4096 bytes. 

My requirement:
1. I need the entire frame i.e., 2097152 bits at once and not in the form of series of chunks where each chunk size is 4096 bytes.
2. The filter which I'm using inside my new plugin needs the entire frame as its input and not chunks of the frame.

Questions:
1. How to get the entire image frame at once in "map.data"?
2. What am I missing here?

I really need someones help.

Thanks in advance.

Kiran

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem in getting the entire frame from gstbuffer at once

Nicolas Dufresne-5


Le 2016-06-15 05:31, "Kiran Kumar" <[hidden email]> a écrit :
>
> Hi,
>
> I am new to gstreamer. I am writing a plugin by referring gstreamer plugin writers guide.
>
> My gst-launch command line looks like  gst-launch-1.0 filesrc location=mandrill.pgm ! image/pgm,width=512,height=512,framerate=1/1 ! mynewplugin ! filesink location=image_out.pgm
>
> I am trying to process the data buffer inside _chain() function of my new plugin.
>
> Problem:
> GstMapInfo map;
> static GstFlowReturn
> gst_mynewplugin_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
> {
>       [....]
>
>         gst_buffer_map (buf, &map, GST_MAP_READ);
>         g_print("buffer size=%d\n", map.size);
>         
>        [.......]
> }
>
> The input image size is 512x512x8(bit depth)=2097152 bits. But, map.size is always = 4096 bytes. 
>
> My requirement:
> 1. I need the entire frame i.e., 2097152 bits at once and not in the form of series of chunks where each chunk size is 4096 bytes.
> 2. The filter which I'm using inside my new plugin needs the entire frame as its input and not chunks of the frame.
>
> Questions:
> 1. How to get the entire image frame at once in "map.data"?
> 2. What am I missing here?

I believe your implementing a pgm decoder. Use GstVideoDecoder and implement parse virtual method.

>
> I really need someones help.
>
> Thanks in advance.
>
> Kiran
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problem in getting the entire frame from gstbuffer at once

Kiran Kumar
Hi Nicolas,

Since I am getting the input from filesrc, I had to change the blocksize of filesrc. Now it is working according to my requirement.

On Wed, Jun 15, 2016 at 4:35 AM, Nicolas Dufresne <[hidden email]> wrote:


Le 2016-06-15 05:31, "Kiran Kumar" <[hidden email]> a écrit :
>
> Hi,
>
> I am new to gstreamer. I am writing a plugin by referring gstreamer plugin writers guide.
>
> My gst-launch command line looks like  gst-launch-1.0 filesrc location=mandrill.pgm ! image/pgm,width=512,height=512,framerate=1/1 ! mynewplugin ! filesink location=image_out.pgm
>
> I am trying to process the data buffer inside _chain() function of my new plugin.
>
> Problem:
> GstMapInfo map;
> static GstFlowReturn
> gst_mynewplugin_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
> {
>       [....]
>
>         gst_buffer_map (buf, &map, GST_MAP_READ);
>         g_print("buffer size=%d\n", map.size);
>         
>        [.......]
> }
>
> The input image size is 512x512x8(bit depth)=2097152 bits. But, map.size is always = 4096 bytes. 
>
> My requirement:
> 1. I need the entire frame i.e., 2097152 bits at once and not in the form of series of chunks where each chunk size is 4096 bytes.
> 2. The filter which I'm using inside my new plugin needs the entire frame as its input and not chunks of the frame.
>
> Questions:
> 1. How to get the entire image frame at once in "map.data"?
> 2. What am I missing here?

I believe your implementing a pgm decoder. Use GstVideoDecoder and implement parse virtual method.

>
> I really need someones help.
>
> Thanks in advance.
>
> Kiran
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel