Skip to main content

Interface IPolyCameraService

com.poly.polyos.camera

Interface IPolyCameraService


public interface IPolyCameraService

Camera service exposed for PolyOS Clients

Since:
3.0.11

Field Summary

Modifier and TypeField and Description
static intDEVICE_TYPE_CAMERA
Indicates that the device is a camera
static intDEVICE_TYPE_DEFAULT
Indicates that this is a default device
static intDEVICE_TYPE_HDMI_INPUT
Indicates that the device is an HDMI input camera
static intIMAGE_DATA_FORMAT_NV12
Indicates the NV12 format
static intIMAGE_DATA_FORMAT_YUV_420_888
Indicates the YUV_420_888 format

Method Summary

Modifier and TypeMethod and Description
booleandeletePreset(java.lang.String cameraId, int preset)
Deletes the preset for the specified camera. Presets are available and managed per camera.
CameragetCamera(java.lang.String cameraId)
Returns the Camera with the given id
CameraCapabilitygetCameraCapability(java.lang.String cameraId)
Returns the CameraCapability for given camera
intgetCameraDeviceType(java.lang.String cameraId)
Gets camera device type CameraDeviceType
intgetCameraImageDataFormat(java.lang.String cameraId)
Gets the camera image data format that is only for camera 2 API now
java.util.List<Camera>getCameras(CameraType filter)
Returns all the Camera of the given filter type
intgetMaxVirtualCameras()
Returns the maximum number of virtual cameras that can be created on the entire system.
intgetNumberOfPresets(java.lang.String cameraId)
Returns the number of presets for the given camera
java.lang.StringgetPresetImageURL(java.lang.String cameraId, int preset)
Gets the URL for the preset image if set, or an empty string otherwise. This is an internal API that is not currently supported on partner applications.
CameraTrackingModegetTrackingMode(java.lang.String cameraId)
Returns the CameraTrackingMode for the given camera
booleangoToPreset(java.lang.String cameraId, int preset)
Go to the given preset for the specified camera. Presets are specific to each camera.
booleanisAutoFramingOn(java.lang.String cameraId)
Returns whether auto framing is on for given camera
booleanisCameraShutterOpen(java.lang.String cameraId)
Gets the status of the shutter for camera
booleanisPresetSaved(java.lang.String cameraId, int preset)
Checks if the preset for the given camera has been saved
boolean`isVirtualCamerasEnabled(java.lang.String cameraId)
Returns whether virtual cameras are enabled for the specified camera.
booleanmoveToHomePosition(java.lang.String cameraId)
Moves the camera's pan, tilt, and zoom position back to its home/center coordinates.
voidregisterCameraListener(IPolyCameraListener cameraListener)
Registers IPolyCameraListener
voidselectCamera(java.lang.String cameraId)
Set the given camera as selected
booleansetAutoFraming(java.lang.String cameraId, boolean on)
Enable/disable auto framing
booleansetMaxVirtualCameras(int max)
Sets the global maximum number of virtual cameras to be created across all logical cameras.
booleansetPreset(java.lang.String cameraId, int preset)
Sets the position for the given camera to the specified preset. Presets are set per camera.
booleansetTrackingMode(java.lang.String cameraId, java.lang.String trackingMode)
Sets tracking mode of the given camera.
booleansetVirtualCamerasEnabled(java.lang.String cameraId, boolean enabled)
Enables/Disables virtual camera support for the given logical camera.
voidstartMoving(java.lang.String cameraId, cameraMoveDirection direction)
Start moving the camera in the given direction
voidstopMoving(java.lang.String cameraId)
Stop moving the camera
voidunRegisterCameraListener(IPolyCameraListener cameraListener)
Unregisters IPolyCameraListener

Field Detail

IMAGE_DATA_FORMAT_YUV_420_888

static final int IMAGE_DATA_FORMAT_YUV_420_888
Indicates the YUV_420_888 format

See Also:
Constant Field Values

IMAGE_DATA_FORMAT_NV12

static final int IMAGE_DATA_FORMAT_NV12
Indicates the NV12 format

See Also:
Constant Field Values

DEVICE_TYPE_DEFAULT

static final int DEVICE_TYPE_DEFAULT
Indicates that this is a default device

See Also:
Constant Field Values

DEVICE_TYPE_CAMERA

static final int DEVICE_TYPE_CAMERA
Indicates that the device is a camera

See Also:
Constant Field Values

DEVICE_TYPE_HDMI_INPUT

static final int DEVICE_TYPE_HDMI_INPUT
Indicates that the device is an HDMI input camera

See Also:
Constant Field Values

Method Detail

getCameras

java.util.List<Camera> getCameras(CameraType filter)
Returns all the Camera of the given filter type

Parameters:
filter - If null, returns all cameras, if not returns cameras of given type

getCamera

Camera getCamera(java.lang.String cameraId)
Returns the Camera with the given id

Parameters:
cameraId - ID of the camera

Returns:
Returns the camera if found, otherwise null

startMoving

void startMoving(java.lang.String cameraId,
CameraMoveDirection direction)
throws CameraException

Starts moving the camera in the given direction

Parameters:
cameraId -
direction -

Throws:
CameraException

stopMoving

void stopMoving(java.lang.String cameraId)
throws CameraException

Stop moving the camera

Throws:
CameraException

getNumberOfPresets

int getNumberOfPresets(java.lang.String cameraId)
Returns the number of presets for the given camera

setPreset

boolean setPreset(java.lang.String cameraId,
int preset)
throws CameraException

Sets the position for the given camera to the specified preset.
Presets are set per camera. Each camera can have presets from 0-MAX-1, where MAX for that camera is getNumberOfPresets(String)
To check whether a preset is set for a given camera, use isPresetSaved(String, int).

Throws:
CameraException

goToPreset

boolean goToPreset(java.lang.String cameraId,
int preset)
throws CameraException

Go to the given preset for the specified camera.
Each camera can have presets from 0-MAX-1, where MAX for that camera is getNumberOfPresets(String)
To check whether a preset is set for a given camera, use isPresetSaved(String, int).

Throws:
CameraException

setAutoFraming

 boolean setAutoFraming(java.lang.String cameraId,
boolean on)

Enable/disable auto framing

Parameters:
cameraId - The id of camera. Pass null to set on current selected camera
on - Whether to enable or disable

isAutoFramingOn

boolean isAutoFramingOn(java.lang.String cameraId)
Returns whether auto framing is on for given camera

Parameters:
cameraId - Camera id. Pass null to find status on current selected camera.

getCameraCapability

CameraCapability getCameraCapability(java.lang.String cameraId)
Returns the CameraCapability for given camera

getCameraDeviceType

int getCameraDeviceType(java.lang.String cameraId)
Gets camera device type CameraDeviceType

getCameraImageDataFormat

int getCameraImageDataFormat(java.lang.String cameraId)
Gets the camera image data format that is only for camera 2 API now

isCameraShutterOpen

boolean isCameraShutterOpen(java.lang.String cameraId)
Gets the status of the shutter for camera

Parameters:
cameraId - the ID of the camera

Returns:
True: the shutter is opened.
False: the shutter is closed.

registerCameraListener

void registerCameraListener(IPolyCameraListener cameraListener)
Registers IPolyCameraListener

unRegisterCameraListener

void unRegisterCameraListener(IPolyCameraListener cameraListener)
Unregisters IPolyCameraListener

moveToHomePosition

boolean moveToHomePosition(java.lang.String cameraId)
Moves the camera's pan, tilt, and zoom position back to its home/center coordinates.
This will only be functional for cameras that have pan, tilt, and/or zoom capabilities, and that have automatic tracking configuration disabled.

Parameters:
cameraId - the ID of the camera to move

Returns:
True if the operation is successful

Since:
3.2.6

selectCamera

void selectCamera(java.lang.String cameraId)
throws CameraException

Sets the given camera as selected

Parameters:
cameraId - ID of the camera to select

Throws:
CameraException

Since:
3.2.6

isPresetSaved

boolean isPresetSaved(java.lang.String cameraId,
int preset)
throws CameraException

Checks if the preset for the given camera has been saved

Throws:
CameraException

Since:
3.2.6

deletePreset

boolean deletePreset(java.lang.String cameraId,
int preset)
throws CameraException

Deletes the preset for the specified camera.
Presets are available and managed per camera. Each camera can have presets from 0-MAX-1, where MAX for that camera is getNumberOfPresets(String).

Throws:
CameraException

Since:
3.2.6

getPresetImageURL

java.lang.String getPresetImageURL(java.lang.String cameraId,
int preset)
throws CameraException

Gets the URL for the preset image if set, or an empty string otherwise. This is an internal API that is not currently supported on partner applications.

Throws:
CameraException

Since:
3.2.11

getTrackingMode

CameraTrackingMode getTrackingMode(java.lang.String cameraId)
throws CameraException

Returns the CameraTrackingMode for the given camera.

Parameters:
cameraId - Camera ID.

Returns:
CameraTrackingMode for the given camera if it supports tracking. Returns null if the camera doesn't support tracking.

Throws:
CameraException - Throws for invalid camera id

Since:
3.2.2.0-4

setTrackingMode

boolean setTrackingMode(java.lang.String cameraId,
java.lang.String trackingMode)
throws CameraException

Sets tracking mode of the given camera

Parameters:
cameraId - Camera ID whose tracking mode has to be set.
trackingMode - The tracking mode to set to. Should be one of the options in CameraTrackingMode.availableTrackingModes.

Returns:
Whether successfully set the mode.

Throws:
CameraException - Throws for invalid camera id, or invalid #trackingMode option

Since:
3.2.2.0-4

setVirtualCamerasEnabled

boolean setVirtualCamerasEnabled(java.lang.String cameraId,
boolean enabled)
throws CameraException

Enables/disables virtual camera support for the given logical camera.

Parameters:
cameraId - The logical camera for which virtual camera should be enabled/disabled. enabled - Whether to enable or disable

Returns:
True if successfully enabled/disabled

Throws:
CameraException - If camera is not capable of supporting virtual camera.

Since:
3.5.0.0-3

isVirtualCamerasEnabled

boolean isVirtualCamerasEnabled(java.lang.String cameraId)
throws CameraException

Returns whether virtual cameras are enabled for the specified camera.

Parameters:
cameraId - The logical camera id

Returns:
True if enabled

Throws:
CameraException

Since:
3.5.0.0-3

setMaxVirtualCameras

boolean setMaxVirtualCameras(int max)
Sets the global maximum number of virtual cameras to be created across all logical cameras.

Parameters:
max - The max number

Returns:
True if successful.

Since:
3.5.0.0-3

getMaxVirtualCameras()

int getMaxVirtualCameras()
Returns the maximum number of virtual cameras that can be created on the entire system.

Since:
3.5.0.0-3