NDK-Socket-IPC icon indicating copy to clipboard operation
NDK-Socket-IPC copied to clipboard

AHardwareBuffer resource is not release

Open doleszki opened this issue 4 years ago • 3 comments

You need to call AHardwareBuffer_release(h_buffer) on the receiver to release the hardware buffer otherwise the receiver runs out of file descriptors and will stop working after receiving a limited quantity of frames. For me this was at around ~512 received buffers; slightly less since I had some other files open.

doleszki avatar Aug 28 '20 03:08 doleszki

hmm, guess I did forget that, accept PR's ;)

sjfricke avatar Aug 30 '20 05:08 sjfricke

I’m new’ish to android development and it took me a few hours to figure this one out. Didn’t mean to be pedantic for a demo repo, but just wanted to save others the time I spent if they use your example.

Thanks, your code helped me a lot .

Sent from my iPhone

On Aug 29, 2020, at 10:52 PM, Spencer [email protected] wrote:

hmm, guess I did forget that, accept PR's ;)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

doleszki avatar Aug 30 '20 18:08 doleszki

No totally understand, but figure it would be faster for you to make a PR of the quick change compared to me cloning, building, and testing it on my end. Totally agree should be fixed for future stragglers

sjfricke avatar Aug 30 '20 18:08 sjfricke