Android Vuforia Native SDK 摄像头方向 Front

Android Vuforia Native SDK camera direction Front

无法使用 Vuforia Native SDK 更改相机方向。

我正在改变

vuforiaAppSession.startAR(CameraDevice.CAMERA_DIRECTION.CAMERA_DIRECTION_DEFAULT);

在 Vuforia 示例应用程序中的 ImageTargets.java。我用前置摄像头得到的结果只是黑屏。

这是错误代码:

VuforiaSamples E/ImageTargets: Unable to open camera device: 2
    com.vuforia.samples.SampleApplication.SampleApplicationException: Unable to open camera device: 2
        at com.vuforia.samples.SampleApplication.SampleApplicationSession.startCameraAndTrackers(SampleApplicationSession.java:153)
        at com.vuforia.samples.SampleApplication.SampleApplicationSession.access0(SampleApplicationSession.java:31)
        at com.vuforia.samples.SampleApplication.SampleApplicationSession$StartVuforiaTask.doInBackground(SampleApplicationSession.java:623)
        at com.vuforia.samples.SampleApplication.SampleApplicationSession$StartVuforiaTask.doInBackground(SampleApplicationSession.java:604)
        at android.os.AsyncTask.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor.run(AsyncTask.java:245)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)

找不到更具体的信息。

据我所知,Vuforia 已弃用此选项。

参见CameraDevice.CAMERA_DIRECTION Class Reference。 C++ 相同 headers:

enum CAMERA_DIRECTION
{ 
    CAMERA_DIRECTION_DEFAULT,   ///< Default camera direction (device-specific,
                                ///  usually maps to back camera) (DEPRECATED)
    CAMERA_DIRECTION_BACK,      ///< The camera is facing in the opposite direction as the screen (DEPRECATED)
    CAMERA_DIRECTION_FRONT,     ///< The camera is facing in the same direction as the screen. (DEPRECATED)
                                ///< Notes: This enum is deprecated.
                                ///< Front camera support will be removed in a future Vuforia release.
                                ///< The front camera is not compatible with DeviceTracker
                                ///< nor with SmartTerrain.
};