Add zero-copy camera pipeline sample using NDK Camera2 and OpenGL ES
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- android, cpp
- Domain
- build-system, computer-graphics, mobile-dev
Research direction
Review the existing camera sample in android/ndk-samples and compare the standalone zerostallcam prototype linked in the issue. Check the repository's Gradle, CMake, documentation, and Google CLA conventions first; done means a self-contained sample demonstrating the proposed zero-copy camera-to-OpenGL ES pipeline and conforming to those project conventions.
Written by the indexing model from the issue text.
Description
Hi NDK Team,
I would like to propose adding a new sample demonstrating a high-performance, zero-copy camera rendering pipeline using the NDK camera2 APIs, AImageReader, and OpenGL ES.
Motivation
While the existing camera sample effectively demonstrates basic Native Camera2 usage, developers frequently face bottlenecks when attempting low-latency preview rendering, zero-copy frame processing, and synchronization between camera capture streams and the rendering thread.
What the Sample Demonstrates
- Zero-Copy Architecture: Leveraging native buffers (AHardwareBuffer / AImageReader) with OpenGL ES external textures (GL_OES_EGL_image_external) to avoid CPU-memory copy overhead.
- Low-Latency Rendering: Clean separation of camera capture threads and rendering loops using standard Android NDK synchronization primitives.
- Modern Best Practices: Minimal overhead, leak-free buffer recycling, and lifecycle-aware lifecycle management purely in C++ and NDK.
I have already implemented a working prototype in a standalone repository:
https://github.com/MohammadNouri5700/zerostallcam
Question
Would the maintainers be open to accepting this as a new standalone sample in android/ndk-samples?
If so, I am ready to refactor the project to strictly align with this repository's structure, Gradle/CMake conventions, documentation style, and Google CLA requirements before submitting a Pull Request.
Thank you for your time and feedback!
- Dominant language
- C++
- Stars
- 10.5k
- Forks
- 4.2k
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/ndk-samples
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
android/ndk-samples#1170 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
android/ndk-samples#1166 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
android/ndk-samples#1094 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
android/ndk-samples#1087 · 4 comments ·
-
resurrect PGO sampleMay be free again @DanAlbert claimed this 864 days ago, and no pull request is open. Open
android/ndk-samples#1070 · 1 assignee ·
All issues in android/ndk-samples
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cp-algorithms/cp-algorithms#1774 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
telefonicaid/fiware-orion#4836 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SanderMertens/flecs#2463 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days
-
nixd exits at startup when its parent process belongs to another userPossibly taken @conao3 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
nix-community/nixd#930 ·
Maintainers usually reply within 2 days