Class ARCoreCameraDevice
ARCoreCameraDevice implements an ARCore-based camera device that outputs InputFrame (containing images, camera parameters, timestamps, 6DOF position information, and tracking status).
When using it, first use java.lang.System.loadLibrary to load libarcore_sdk_c.so.
After creation, you can call start/stop to begin and stop collecting video stream data.
When the device is no longer needed, call close to shut it down. After close, it should not be used further.
ARCoreCameraDevice outputs InputFrame through inputFrameSource, and inputFrameSource should be connected to InputFrameSink for use.
bufferCapacity represents the buffer capacity of InputFrame. If more than this number of InputFrame are output from this device and not released, the device will stop outputting new InputFrame until the previous ones are released. This may cause issues such as screen freezes.
Note: The current implementation of ARCore (v1.13.0) has memory leaks when creating and destroying sessions. Repeated creation and destruction can lead to continuously growing memory usage that is not released even after destruction.
ARCoreCameraDevice
Constructors
ARCoreCameraDevice
void easyar_ARCoreCameraDevice__ctor(easyar_ARCoreCameraDevice * * Return)
public ARCoreCameraDevice()
+ (easyar_ARCoreCameraDevice *) create
public convenience init()
public ARCoreCameraDevice()
Methods
isAvailable
Checks if available. Returns true only on Android systems with ARCore installed.
Calling without loading libarcore_sdk_c.so will return false.
Note: If the device does not support ARCore, but has the ARCore apk installed via sideloading, this function will return true, but ARCore cannot function normally.
bool easyar_ARCoreCameraDevice_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
public static func isAvailable() -> Bool
public static bool isAvailable()
Returns
isDeviceSupported
Checks if the current device is supported.
bool easyar_ARCoreCameraDevice_isDeviceSupported(void)
static bool isDeviceSupported()
public static boolean isDeviceSupported()
companion object fun isDeviceSupported(): Boolean
+ (bool)isDeviceSupported
public static func isDeviceSupported() -> Bool
public static bool isDeviceSupported()
Returns
bufferCapacity
The buffer capacity of InputFrame, default value is 8.
int easyar_ARCoreCameraDevice_bufferCapacity(const easyar_ARCoreCameraDevice * This)
public int bufferCapacity()
fun bufferCapacity(): Int
public func bufferCapacity() -> Int32
public virtual int bufferCapacity()
Returns
setBufferCapacity
void easyar_ARCoreCameraDevice_setBufferCapacity(easyar_ARCoreCameraDevice * This, int capacity)
void setBufferCapacity(int capacity)
public void setBufferCapacity(int capacity)
fun setBufferCapacity(capacity: Int): Unit
- (void)setBufferCapacity:(int)capacity
public func setBufferCapacity(_ capacity: Int32) -> Void
public virtual void setBufferCapacity(int capacity)
Parameters
| Name |
Type |
Description |
| capacity |
Int32 |
|
Returns
void easyar_ARCoreCameraDevice_inputFrameSource(easyar_ARCoreCameraDevice * This, easyar_InputFrameSource * * Return)
std::shared_ptr<InputFrameSource> inputFrameSource()
public @Nonnull InputFrameSource inputFrameSource()
fun inputFrameSource(): InputFrameSource
- (easyar_InputFrameSource *)inputFrameSource
public func inputFrameSource() -> InputFrameSource
public virtual InputFrameSource inputFrameSource()
Returns
setFocusMode
Sets the focus mode to focusMode.
void easyar_ARCoreCameraDevice_setFocusMode(easyar_ARCoreCameraDevice * This, easyar_ARCoreCameraDeviceFocusMode focusMode)
void setFocusMode(ARCoreCameraDeviceFocusMode focusMode)
public void setFocusMode(int focusMode)
fun setFocusMode(focusMode: Int): Unit
- (void)setFocusMode:(easyar_ARCoreCameraDeviceFocusMode)focusMode
public func setFocusMode(_ focusMode: ARCoreCameraDeviceFocusMode) -> Void
public virtual void setFocusMode(ARCoreCameraDeviceFocusMode focusMode)
Parameters
Returns
start
Starts collecting video stream data.
bool easyar_ARCoreCameraDevice_start(easyar_ARCoreCameraDevice * This)
public func start() -> Bool
public virtual bool start()
Returns
stop
Stops collecting video stream data.
void easyar_ARCoreCameraDevice_stop(easyar_ARCoreCameraDevice * This)
public func stop() -> Void
public virtual void stop()
Returns
close
Closes. After close, it should not be used further.
void easyar_ARCoreCameraDevice_close(easyar_ARCoreCameraDevice * This)
public func close() -> Void
public virtual void close()
Returns
type
easyar_CameraDeviceType easyar_ARCoreCameraDevice_type(const easyar_ARCoreCameraDevice * This)
- (easyar_CameraDeviceType)type
public func type() -> CameraDeviceType
public virtual CameraDeviceType type()
Returns
cameraOrientation
The clockwise rotation angle required to display the camera image in the device's natural orientation.
int easyar_ARCoreCameraDevice_cameraOrientation(const easyar_ARCoreCameraDevice * This)
public int cameraOrientation()
fun cameraOrientation(): Int
public func cameraOrientation() -> Int32
public virtual int cameraOrientation()
Returns
size
Gets the current image size.
easyar_Vec2I easyar_ARCoreCameraDevice_size(const easyar_ARCoreCameraDevice * This)
public @Nonnull Vec2I size()
public func size() -> Vec2I
public virtual Vec2I size()
Returns
frameRateRangeLower
Gets the lower bound of the current frame rate range.
double easyar_ARCoreCameraDevice_frameRateRangeLower(const easyar_ARCoreCameraDevice * This)
double frameRateRangeLower()
public double frameRateRangeLower()
fun frameRateRangeLower(): Double
- (double)frameRateRangeLower
public func frameRateRangeLower() -> Double
public virtual double frameRateRangeLower()
Returns
frameRateRangeUpper
Gets the upper bound of the current frame rate range.
double easyar_ARCoreCameraDevice_frameRateRangeUpper(const easyar_ARCoreCameraDevice * This)
double frameRateRangeUpper()
public double frameRateRangeUpper()
fun frameRateRangeUpper(): Double
- (double)frameRateRangeUpper
public func frameRateRangeUpper() -> Double
public virtual double frameRateRangeUpper()
Returns