android / ndk-samples

Android NDK samples with Android Studio
http://developer.android.com/ndk
Apache License 2.0
10.06k stars 4.18k forks source link

[camera] .onImageAvailable is not called for executable #924

Closed Dan-YK closed 5 months ago

Dan-YK commented 1 year ago

Hello,

I was able to get basic camera applications to work successfully. When running android_main under the application, I see it calling .onImageAvailable after the capture. Afterward, I stripped a lot of code off to a bare minimum.

I tried to do the same for a standalone cpp executable (int main) using root.

I'm able to open the camera and capture and everything, but .onImageAvailable is not called at the end.

I'm assuming there is something special about the way the application utilizes the camera that allows it to call .onImageAvailable.

Does a standalone executable have the capability to capture a picture?

Thanks

DanAlbert commented 5 months ago

No, standalone executables have no access to the Android Framework. You have to make an app to do app things. Standalone executables are typically only useful for building debug tools like strace.