Hi mchi, thanks for the response. The issue I’m having isn’t with getting the frame data, I’m already do that successfully. The entire process works just fine dGPU, and on Jetson if I parse the image data in a blocking process (without separate threads) again there’s no issue (it’s just slow/er).
I actually managed to get around the issue by swapping the pointers directly within the function instead of an additional “frameSwap” function. I’m not sure why passing the pointers is an issue on Jetson but not on dGPU, but it seems to be.
This is the updated function:
void custom_parser (guint source_id, gint data_size, std::byte *new_frame) {
// there is locking code here to manage thread safe access
std::byte tmp = *imageData[source_id];
*imageData[source_id] = *new_frame;
new_frame = &tmp;
// notify relevant dedicated thread of new frame data
}
This works perfectly for me. It swaps the pointers so that it takes only about 300-400 nano seconds versus 10ms for a memcpy.
For reference a single millisecond is 10’000 nano seconds. So this process is very efficient.