FFMPEG and JNI – pass AVFrame data to Java and Back

I have some C code that decodes a video frame by frame. I get to a point where i have an AVFrame in BGR32 and would like to send it back to Java for editing.

I have a ByteBuffer object in my C code that was created in Java using AllocateDirect but i struggle to write the content of the AVFrame->data[0] (of uint8_t type) to it and read it back. I have tried memcpy with no luck. Does anyone have an idea how to achieve this?


Source: c#

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.