depthai-core icon indicating copy to clipboard operation
depthai-core copied to clipboard

zero_copy branch example code

Open 0y8w1x opened this issue 1 year ago • 4 comments

I just wanted to ask if there is an example code snippet, on how to use this branch, because I heard I need to use special functions. I got told by @Luxonis-Erik that opening an issue might give me an answer.

0y8w1x avatar Aug 03 '22 17:08 0y8w1x

Thanks. We'll circle back. I don't recall the context of this. Will ask.

Luxonis-Brandon avatar Aug 04 '22 04:08 Luxonis-Brandon

Hi @0y8w1x, if you checkout the branch, all output queues (the return value of the device.getOutputQueue(...)) will automatically have the zero-copy functionality.

I'm not sure how tested it is and if there are any known issues with the implementation, so CC: @themarpe regarding this.

moratom avatar Aug 07 '22 18:08 moratom

@0y8w1x Main thing to note there is that the data isn't available through regular getData means but through packet->data instead. Also, getFrame & getCvFrame and other message helpers aren't available.

This branch is experimental / feature testing branch, and it might or might not be upstreamed one day - it also isn't inteded for regular consumption, but for those working at the very edge of compute / latency / overhead boundaries.

themarpe avatar Aug 07 '22 20:08 themarpe

thanks @themarpe and @moratom for clarifying. I guess I need to go through the commits, to create a working example then 👍

0y8w1x avatar Aug 08 '22 20:08 0y8w1x