Understanding the example with appsrc

Tim Müller tim at centricular.com
Mon Feb 18 23:23:44 UTC 2019


On Mon, 2019-02-18 at 22:52 +0000, Wudo Balmus wrote:

Hi Wudo,

> It looks like that the component *2 is because in RGB16 1pixel is 2
> bytes, so the 384*288 pixmap requires 384*288*2 bytes.

That's right.

>  Still wondering why there is 385, not 384.

I think it's just a typo, it should probably be 384 as well.

Another/better way would be to use e.g.

GstVideoInfo vinfo;

gst_video_info_set_format (&vinfo, GST_FORMAT_RGB16, 384, 288);

size = GST_VIDEO_INFO_SIZE (&vinfo);

(or even a GstVideoBufferPool).

Cheers
 Tim

-- 
Tim Müller, Centricular Ltd - http://www.centricular.com



More information about the gstreamer-devel mailing list