Skip to content Skip to sidebar Skip to footer

Android Camera2 Executable Failed To Get Frames

I have one Camera2 NDK code to open the camera and get images. The code work fine via Android Application/Service, but if I compile and run it as executable the camera opened but I

Solution 1:

I have not seen your code. From your description, you have done everything right. If you add the following, it should work.

#include <binder/ProcessState.h>

...
main()
{
...
    android::ProcessState::self()->startThreadPool();
...
    Camera open, AImageReader_new, etc ...
...
    Close Camera
...
}

Also add libbinder to Android.mk LOCAL_SHARED_LIBRARIES.

Solution 2:

In general, the NDK does not support Android shell executables, so its use is probably blocked by your devices SELinux policy in some way.

Post a Comment for "Android Camera2 Executable Failed To Get Frames"