Hi TI experts,
I'm recently trying to understand the project of edgeai-gst-apps and to do some custom modification of it. Then I have tried to setup a pipeline of
src_pipe_1 = gst_parse_launch("v4l2src device=/dev/video3 io-mode=5 ! video/x-bayer, width=2592, height=1944, format=bggi10 ! appsink name=sen_1 max-buffers=2 drop=true", NULL); sen_1 = gst_bin_get_by_name(GST_BIN(src_pipe_1), "sen_1");
and then to use
m_pipe.getBuffer("sen_1",m_buf_1,false,false,m_pipe.sen_1);
to pull raw image into gst_wrapper.c . But the trying failed because gst_wrapper doesn't support io-mode=dmabuf-import for now. But if I remove "io-mode=5" from the pipeline, the frame rate dropped from 30 to 8.
I have also noticed you left the annotation in the code says that GstPool could improve performance.
int32_t GstPipe::allocBuffer(GstWrapperBuffer &buf,
uint32_t width,
uint32_t height,
const string format)
{
GstSample *sample = nullptr;
GstBuffer *buffer = nullptr;
GstCaps *caps = nullptr;
int32_t size;
int32_t ret;
int32_t status = 0;
freeBuffer(buf);
size = width * height;
if (format == "RGB")
{
/* 3 * size * width. */
size *= 3;
}
else if (format == "NV12")
{
/* 1.5 * size * width. */
size += size/2;
}
else if (format == "UYVY")
{
/* 2 * size * width. */
size *= 2;
}
/* TODO: When optimizing performance, this should be allocated from the
* GstPool passed by appsrc's peer element so that kmssink can allocate
* physically contiguous buffer so as to avoid doig a buffer copy
*/
buffer = gst_buffer_new_allocate(NULL, size, NULL);
I wonder if you have some sample code of the GstPool realization of here.
Sincerely,
Yizhe Fan