Skip to content

Continuous conversion #52

@superware

Description

@superware

Hello,

I'm successfully running the convert example, but how should libpisp be used for continuous conversion? How to queue the buffers after consumption?

void PiSPConverter::transform(GstBuffer *inbuf)
{
    GstMapInfo map;

    if (!gst_buffer_map(inbuf, &map, GST_MAP_READ)) {

		std::cerr << "gst_buffer_map failed" << std::endl;
		exit(-1);
    }

    auto buffers = _backend_device->GetBuffers();
    auto buffer = buffers.find("pispbe-input");

    memcpy(buffer->second.mem[0], map.data, buffer->second.size[0]);

    int ret = _backend_device->Run();
	if (ret)
	{
		std::cerr << "Job run error!" << std::endl;
		exit(-1);
	}

    gst_buffer_unmap(inbuf, &map);

    buffer = buffers.find("pispbe-output0");

    memcpy(_params.output_data, buffer->second.mem[0], buffer->second.size[0]);
}
Unable to queue buffer: Invalid argument

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions