ARCoreCameraDevice Class¶
Description¶
ARCoreCameraDevice implements a camera device based on ARCore, which outputs InputFrame (including image, camera parameters, timestamp, 6DOF location, and tracking status).
Loading of libarcore_sdk_c.so with java.lang.System.loadLibrary is required.
After creation, start/stop can be invoked to start or stop video stream capture.
When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
ARCoreCameraDevice outputs InputFrame from inputFrameSource. inputFrameSource shall be connected to InputFrameSink for use. Refer to Overview .
bufferCapacity is the capacity of InputFrame buffer. If the count of InputFrame which has been output from the device and have not been released is more than this number, the device will not output new InputFrame , until previous InputFrame have been released. This may cause screen stuck. Refer to Overview .
Caution: Currently, ARCore(v1.13.0) has memory leaks on creating and destroying sessions. Repeated creations and destructions will cause an increasing and non-reclaimable memory footprint.
Constructor¶
- C
void easyar_ARCoreCameraDevice__ctor(easyar_ARCoreCameraDevice * * Return)
- C++
ARCoreCameraDevice()
- Java
public ARCoreCameraDevice()
- Kotlin
constructor()
- Objective-C
+ (easyar_ARCoreCameraDevice *) create
- Swift
public convenience init()
- C#
public ARCoreCameraDevice()
isAvailable¶
Checks if the component is available. It returns true only on Android when ARCore is installed.
If called with libarcore_sdk_c.so not loaded, it returns false.
Notice: If ARCore is not supported on the device but ARCore apk is installed via side-loading, it will return true, but ARCore will not function properly.
- C
bool easyar_ARCoreCameraDevice_isAvailable(void)
- C++
static bool isAvailable()
- Java
public static boolean isAvailable()
- Kotlin
companion object fun isAvailable(): Boolean
- Objective-C
+ (bool)isAvailable
- Swift
public static func isAvailable() -> Bool
- C#
public static bool isAvailable()
isDeviceSupported¶
Checks if the current device is supported.
- C
bool easyar_ARCoreCameraDevice_isDeviceSupported(void)
- C++
static bool isDeviceSupported()
- Java
public static boolean isDeviceSupported()
- Kotlin
companion object fun isDeviceSupported(): Boolean
- Objective-C
+ (bool)isDeviceSupported
- Swift
public static func isDeviceSupported() -> Bool
- C#
public static bool isDeviceSupported()
bufferCapacity¶
InputFrame buffer capacity. The default is 8.
- C
int easyar_ARCoreCameraDevice_bufferCapacity(const easyar_ARCoreCameraDevice * This)
- C++
int bufferCapacity()
- Java
public int bufferCapacity()
- Kotlin
fun bufferCapacity(): Int
- Objective-C
- (int)bufferCapacity
- Swift
public func bufferCapacity() -> Int32
- C#
public virtual int bufferCapacity()
setBufferCapacity¶
Sets InputFrame buffer capacity.
- C
void easyar_ARCoreCameraDevice_setBufferCapacity(easyar_ARCoreCameraDevice * This, int capacity)
- C++
void setBufferCapacity(int capacity)
- Java
public void setBufferCapacity(int capacity)
- Kotlin
fun setBufferCapacity(capacity: Int): Unit
- Objective-C
- (void)setBufferCapacity:(int)capacity
- Swift
public func setBufferCapacity(_ capacity: Int32) -> Void
- C#
public virtual void setBufferCapacity(int capacity)
inputFrameSource¶
InputFrame output port.
- C
void easyar_ARCoreCameraDevice_inputFrameSource(easyar_ARCoreCameraDevice * This, easyar_InputFrameSource * * Return)
- C++
std::shared_ptr<InputFrameSource> inputFrameSource()
- Java
public @Nonnull InputFrameSource inputFrameSource()
- Kotlin
fun inputFrameSource(): InputFrameSource
- Objective-C
- (easyar_InputFrameSource *)inputFrameSource
- Swift
public func inputFrameSource() -> InputFrameSource
- C#
public virtual InputFrameSource inputFrameSource()
setFocusMode¶
Sets focus mode to focusMode. Call before start.
- C
void easyar_ARCoreCameraDevice_setFocusMode(easyar_ARCoreCameraDevice * This, easyar_ARCoreCameraDeviceFocusMode focusMode)
- C++
void setFocusMode(ARCoreCameraDeviceFocusMode focusMode)
- Java
public void setFocusMode(int focusMode)
- Kotlin
fun setFocusMode(focusMode: Int): Unit
- Objective-C
- (void)setFocusMode:(easyar_ARCoreCameraDeviceFocusMode)focusMode
- Swift
public func setFocusMode(_ focusMode: ARCoreCameraDeviceFocusMode) -> Void
- C#
public virtual void setFocusMode(ARCoreCameraDeviceFocusMode focusMode)
start¶
Starts video stream capture.
- C
bool easyar_ARCoreCameraDevice_start(easyar_ARCoreCameraDevice * This)
- C++
bool start()
- Java
public boolean start()
- Kotlin
fun start(): Boolean
- Objective-C
- (bool)start
- Swift
public func start() -> Bool
- C#
public virtual bool start()
stop¶
Stops video stream capture.
- C
void easyar_ARCoreCameraDevice_stop(easyar_ARCoreCameraDevice * This)
- C++
void stop()
- Java
public void stop()
- Kotlin
fun stop(): Unit
- Objective-C
- (void)stop
- Swift
public func stop() -> Void
- C#
public virtual void stop()
close¶
Close. The component shall not be used after calling close.
- C
void easyar_ARCoreCameraDevice_close(easyar_ARCoreCameraDevice * This)
- C++
void close()
- Java
public void close()
- Kotlin
fun close(): Unit
- Objective-C
- (void)close
- Swift
public func close() -> Void
- C#
public virtual void close()
type¶
Camera type.
- C
easyar_CameraDeviceType easyar_ARCoreCameraDevice_type(const easyar_ARCoreCameraDevice * This)
- C++
CameraDeviceType type()
- Java
public int type()
- Kotlin
fun type(): Int
- Objective-C
- (easyar_CameraDeviceType)type
- Swift
public func type() -> CameraDeviceType
- C#
public virtual CameraDeviceType type()
cameraOrientation¶
Angles rotation required to rotate clockwise and display camera image on device with natural orientation.
- C
int easyar_ARCoreCameraDevice_cameraOrientation(const easyar_ARCoreCameraDevice * This)
- C++
int cameraOrientation()
- Java
public int cameraOrientation()
- Kotlin
fun cameraOrientation(): Int
- Objective-C
- (int)cameraOrientation
- Swift
public func cameraOrientation() -> Int32
- C#
public virtual int cameraOrientation()
size¶
Gets the current preview size.
frameRateRangeLower¶
Gets lower bound of current frame rate range.
- C
double easyar_ARCoreCameraDevice_frameRateRangeLower(const easyar_ARCoreCameraDevice * This)
- C++
double frameRateRangeLower()
- Java
public double frameRateRangeLower()
- Kotlin
fun frameRateRangeLower(): Double
- Objective-C
- (double)frameRateRangeLower
- Swift
public func frameRateRangeLower() -> Double
- C#
public virtual double frameRateRangeLower()
frameRateRangeUpper¶
Gets upper bound of current frame rate range.
- C
double easyar_ARCoreCameraDevice_frameRateRangeUpper(const easyar_ARCoreCameraDevice * This)
- C++
double frameRateRangeUpper()
- Java
public double frameRateRangeUpper()
- Kotlin
fun frameRateRangeUpper(): Double
- Objective-C
- (double)frameRateRangeUpper
- Swift
public func frameRateRangeUpper() -> Double
- C#
public virtual double frameRateRangeUpper()