Class ARCoreCameraDevice
ARCoreCameraDevice implements an ARCore-based camera device and outputs InputFrame (including image, camera parameters, timestamp, 6DOF position information, and tracking status). Before use, java.lang.System.loadLibrary must be used to load libarcore_sdk_c.so. After creation, start/stop can be called to start and stop collecting video stream data. When the device is no longer needed, close can be called to close it. It should not be used after close. ARCoreCameraDevice outputs InputFrame through inputFrameSource, and inputFrameSource should be connected to InputFrameSink for use. bufferCapacity represents the capacity of the InputFrame buffer. If more than this number of InputFrame are output from the device and not released, the device will stop outputting new InputFrame until previous InputFrame are released. This may cause issues such as the image freezing. Note: The current ARCore (v1.13.0) implementation has a memory leak when creating and destroying sessions. Creating and destroying repeatedly will cause memory usage to keep increasing and not be released 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 whether it is available. Returns true only on Android systems with ARCore installed. Calling it without loading libarcore_sdk_c.so returns false. Note: If the device does not support ARCore but the ARCore apk is installed by sideloading, this function will return true, but ARCore cannot work properly.
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 whether 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
Capacity of the InputFrame buffer. The 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. It should not be used after close.
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
Clockwise rotation angle required for displaying the camera image in the natural orientation of the device.
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