RCP SDK Java Wrapper  6.61.0
com.red.rcp.RCPCamera Class Reference

RCPCamera is the class that opens, maintains and closes a connection to a specific camera. More...

Inheritance diagram for com.red.rcp.RCPCamera:
com.red.rcp.RCPCameraListener

Public Member Functions

 RCPCamera (RCPCameraListener pListener)
 Class constructor specifying the parent RCPCameraListener. More...
 
void registerCommInterface (RCPCommInterface commInterface)
 
int open (String pin, String ipaddress, final String client_name, final String client_version, final String client_user)
 Opens a camera connection. More...
 
void close ()
 Closes a camera connection. More...
 
String getID ()
 Returns the camera ID for the object instance. More...
 
void toggleRecordState ()
 Toggles the record state of the camera. More...
 
void setParameter (String parameterName)
 Send a argument-less RCP parameter to the camera. More...
 
void setParameter (String parameterName, int value)
 Sets an integer parameter on the camera. More...
 
void setParameterString (String parameterName, String value)
 Sets a string parameter on the camera. More...
 
void getParameter (String parameterName)
 Gets a parameter from the camera. More...
 
void getList (String listName)
 Gets a list from the camera. More...
 
void setList (String listName, String listStrings, String listValues)
 Sets a list in the camera. More...
 
String getParameterLabel (String parameterName)
 Gets a camera parameter label. More...
 
int menuIsSupported ()
 Check if menu tree is supported by connected camera. More...
 
int menuGetChildren (int menuNodeId)
 Requests menu tree children for given parent mode. More...
 
int menuNodeStatusIsSupported ()
 Check if menu tree node status is supported by connected camera. More...
 
int menuNodeGetStatus (int menuNodeId)
 Requests menu status for the given mode. More...
 
int notificationGet ()
 Get current notification. More...
 
int notificationTimeout (String notificationId)
 Notifies the API that the timeout associated with the current notification has expired and that the notification should be closed. More...
 
int notificationResponse (String notificationId, int response)
 Sends response for current notification. More...
 
int getCameraConnectionStats (int statsType)
 Gets stats regarding camera connection. More...
 
int getstatus (String parameterName)
 Requests RCP parameter status from the camera. More...
 
void onUpdate (final String id, final String param)
 Invoked when a formatted integer string is updated from the camera. More...
 
void onUpdateInt (final String id, final String param, final int value)
 Invoked when an integer value is updated from the camera. More...
 
void onUpdateString (final String id, final String param)
 Invoked when an string parameter is updated from the camera. More...
 
void onUpdateStringEditInfo (final String id, final String paramName, final int[] intParams, final String[] strParams)
 Invoked when edit info of a string parameter is updated from the camera. More...
 
void onUpdateClipList (final String id, final int status, final String clipList)
 Invoked when a clip list is updated from the camera. More...
 
void onUpdateEditInfo (final String id, final String editInfo)
 Invoked when edit info of a parameter is updated from the camera. More...
 
void onUpdateListStrings (final String id, final String listHeader, final String listFlags, final String[] listStrings, final int[] listValues)
 Invoked when a list is updated from the camera. More...
 
void onUpdateHistogram (final String id, final int[] red, final int[] green, final int[] blue, final int[] luma, final int bottom_clip, final int top_clip, final String text)
 Invoked when the histogram is updated from the camera. More...
 
void onConnectionError (final String id, final String msg)
 Invoked when the connection error has occurred in the SDK. More...
 
void onStateChange (final String id, final String param)
 Invoked when a state change is detected in the connection to the camera. More...
 
void onStatusUpdate (final String id, final String param, final int isEnabled, final int isEnabledValid, final int isSupported, final int isSupportedValid)
 Invoked when the status of a parameter is updated. More...
 
void onNotificationUpdate (final String id, final String nID, final String title, final String message, final String notificationInfo)
 Invoked when a camera notification is opened, updated, or closed. More...
 
void onAudioVuUpdate (final String id, final String audioVu)
 Invoked when audio input and output volumes are updated on the camera. More...
 
void onMenuNodeListUpdate (final String id, final int nodeId, final String[] childList, final String[] ancestorList)
 Invoked when menu node list is updated on the camera. More...
 
void onMenuNodeStatusUpdate (final String id, final int nodeId, final int isEnabled, final int isEnabledValid, final int isSupported, final int isSupportedValid)
 Invoked when menu node status is updated. More...
 
void onUpdateTag (final String id, final String param)
 Invoked when tagging information is updated on the camera. More...
 
void onCameraInfo (final String id, final String camInfo)
 Invoked when a connection state change occurs. More...
 
void onRftpStatusUpdate (final String id, final byte[] uuid, final int rftpType, final int rftpError, final int percentComplete, final String[] dirList)
 Invoked to update the progress on previously initiated RFTP transfer. More...
 
int getIsSupported (String parameterName)
 Check if parameter is supported by connected camera. More...
 
int getPropertyIsSupported (String parameterName, int propertyType)
 Check if parameter property of a parameter is supported by connected camera. More...
 
void setParameterUnsigned (String parameterName, long value)
 Sets an unsigned integer parameter on the camera. More...
 
String getAPIVersion ()
 
String getParameterName (int parameterId)
 
void setPeriodicEnable (String parameterName, boolean enable)
 Enable or disable periodic parameter updates. More...
 
int rftpGetIsSupported ()
 
int rftpSendFile (String localFile, String cameraFile, boolean compress, byte[] uuid_out)
 
int rftpRetrieveFile (String localFile, String cameraFile, int maxFileSize, boolean compressionAllowed, byte[] uuid_out)
 
int rftpAbortTransfer (byte[] uuid_in)
 
int rftpDeleteFile (String cameraFile, byte[] uuid_out)
 
int rftpDirectoryList (String path, byte[] uuid_out)
 

Static Public Attributes

static final int RCP_UUID_LEN = 41
 

Detailed Description

RCPCamera is the class that opens, maintains and closes a connection to a specific camera.

The class provides methods for setting camera parameters as well as callbacks for receiving camera status.

The class that instantiates a RCPCamera object must also be a RCPCameraListener. This is because all the callbacks defined in RCPCameraListener are delegated to the parent class. This allows the parent class to handle the camera callbacks directly in its own context. The delegation mechanism is thread safe and allows for the callbacks to be posted to UI threads.

This class implements private JNI calls to and from the RCP SDK. JNI is the mechanism for wrapping the RCP SDK in Java.

Constructor & Destructor Documentation

◆ RCPCamera()

com.red.rcp.RCPCamera.RCPCamera ( RCPCameraListener  pListener)

Class constructor specifying the parent RCPCameraListener.

Parameters
pListenerparent RCPCameraListener

Member Function Documentation

◆ registerCommInterface()

void com.red.rcp.RCPCamera.registerCommInterface ( RCPCommInterface  commInterface)

◆ open()

int com.red.rcp.RCPCamera.open ( String  pin,
String  ipaddress,
final String  client_name,
final String  client_version,
final String  client_user 
)

Opens a camera connection.

The camera connection is specified by the camera PIN and the IP address. If the PIN is unknown, a unique 9 digit pin may be used such as "000-000-001". This must be unique for each unique camera connection. It is recommended that the PIN provided from camera discovery is used as it is the actual PIN from the camera and is guaranteed unique.

Parameters
pinunique 9 digit pin of the camera with format "102-456-789"
ipaddressIP address of camera (e.g. "192.168.1.144")
client_nameA string indicating the name of the client, usually the app name, e.g. "MyAndroidApp"
client_versionA string indicating the version of the client, e.g. "1.2"
client_userOptional unique user defined string, null if not used
Returns
0 if connection was opened successfully; -1 if the connection failed

◆ close()

void com.red.rcp.RCPCamera.close ( )

Closes a camera connection.

◆ getID()

String com.red.rcp.RCPCamera.getID ( )

Returns the camera ID for the object instance.

This ID is the camera PIN, and uniquely identifies the RCPCamera object. This is used by the parent class to identify a specific callback associated with a specific RCPCamera object.

◆ toggleRecordState()

void com.red.rcp.RCPCamera.toggleRecordState ( )

Toggles the record state of the camera.

◆ setParameter() [1/2]

void com.red.rcp.RCPCamera.setParameter ( String  parameterName)

Send a argument-less RCP parameter to the camera.

Parameters
parameterNamename of the RCP parameter

◆ setParameter() [2/2]

void com.red.rcp.RCPCamera.setParameter ( String  parameterName,
int  value 
)

Sets an integer parameter on the camera.

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_SATURATION")
valuevalue to set (e.g. 1200)

◆ setParameterString()

void com.red.rcp.RCPCamera.setParameterString ( String  parameterName,
String  value 
)

Sets a string parameter on the camera.

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_SLATE_SCENE")
valuevalue to set (e.g. "Woods")

◆ getParameter()

void com.red.rcp.RCPCamera.getParameter ( String  parameterName)

Gets a parameter from the camera.

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_SATURATION")

◆ getList()

void com.red.rcp.RCPCamera.getList ( String  listName)

Gets a list from the camera.

Parameters
listNamename of the RCP parameter (e.g. "RCP_PARAM_ISO")

◆ setList()

void com.red.rcp.RCPCamera.setList ( String  listName,
String  listStrings,
String  listValues 
)

Sets a list in the camera.

Parameters
listNamename of the RCP parameter (e.g. "RCP_PARAM_ISO")
listStringslist of strings to be used to set the RCP parameter's list
listValueslist of values to be used to set the RCP parameter's list

◆ getParameterLabel()

String com.red.rcp.RCPCamera.getParameterLabel ( String  parameterName)

Gets a camera parameter label.

This is the label that should be used for display in a UI.

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_ISO")

◆ menuIsSupported()

int com.red.rcp.RCPCamera.menuIsSupported ( )

Check if menu tree is supported by connected camera.

◆ menuGetChildren()

int com.red.rcp.RCPCamera.menuGetChildren ( int  menuNodeId)

Requests menu tree children for given parent mode.

Parameters
menuNodeIdID of the parent node

◆ menuNodeStatusIsSupported()

int com.red.rcp.RCPCamera.menuNodeStatusIsSupported ( )

Check if menu tree node status is supported by connected camera.

◆ menuNodeGetStatus()

int com.red.rcp.RCPCamera.menuNodeGetStatus ( int  menuNodeId)

Requests menu status for the given mode.

Parameters
menuNodeIdID of the node

◆ notificationGet()

int com.red.rcp.RCPCamera.notificationGet ( )

Get current notification.

◆ notificationTimeout()

int com.red.rcp.RCPCamera.notificationTimeout ( String  notificationId)

Notifies the API that the timeout associated with the current notification has expired and that the notification should be closed.

Parameters
notificationIdID of the notification

◆ notificationResponse()

int com.red.rcp.RCPCamera.notificationResponse ( String  notificationId,
int  response 
)

Sends response for current notification.

Parameters
notificationIdID of the notification
responsevalue of response selected

◆ getCameraConnectionStats()

int com.red.rcp.RCPCamera.getCameraConnectionStats ( int  statsType)

Gets stats regarding camera connection.

Parameters
statsTypevalue of stats type selected 0 Tx Packets 1 Tx Bytes 2 Rx Packets 3 Rx Bytes

◆ getstatus()

int com.red.rcp.RCPCamera.getstatus ( String  parameterName)

Requests RCP parameter status from the camera.

The status requested with this call will be returned in the callback: onStatusUpdate

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_SLATE_SCENE")

◆ onUpdate()

void com.red.rcp.RCPCamera.onUpdate ( final String  id,
final String  param 
)

Invoked when a formatted integer string is updated from the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdate

Implements com.red.rcp.RCPCameraListener.

◆ onUpdateInt()

void com.red.rcp.RCPCamera.onUpdateInt ( final String  id,
final String  param,
final int  value 
)

Invoked when an integer value is updated from the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdateInt

Implements com.red.rcp.RCPCameraListener.

◆ onUpdateString()

void com.red.rcp.RCPCamera.onUpdateString ( final String  id,
final String  param 
)

Invoked when an string parameter is updated from the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdateString

Implements com.red.rcp.RCPCameraListener.

◆ onUpdateStringEditInfo()

void com.red.rcp.RCPCamera.onUpdateStringEditInfo ( final String  id,
final String  paramName,
final int []  intParams,
final String []  strParams 
)

Invoked when edit info of a string parameter is updated from the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdateStringEditInfo

Implements com.red.rcp.RCPCameraListener.

◆ onUpdateClipList()

void com.red.rcp.RCPCamera.onUpdateClipList ( final String  id,
final int  status,
final String  clipList 
)

Invoked when a clip list is updated from the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdateClipList

Implements com.red.rcp.RCPCameraListener.

◆ onUpdateEditInfo()

void com.red.rcp.RCPCamera.onUpdateEditInfo ( final String  id,
final String  editInfo 
)

Invoked when edit info of a parameter is updated from the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdateEditInfo

Implements com.red.rcp.RCPCameraListener.

◆ onUpdateListStrings()

void com.red.rcp.RCPCamera.onUpdateListStrings ( final String  id,
final String  listHeader,
final String  listFlags,
final String []  listStrings,
final int []  listValues 
)

Invoked when a list is updated from the camera.

This version uses arrays The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdateListStrings

Implements com.red.rcp.RCPCameraListener.

◆ onUpdateHistogram()

void com.red.rcp.RCPCamera.onUpdateHistogram ( final String  id,
final int []  red,
final int []  green,
final int []  blue,
final int []  luma,
final int  bottom_clip,
final int  top_clip,
final String  text 
)

Invoked when the histogram is updated from the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdateHistogram

Implements com.red.rcp.RCPCameraListener.

◆ onConnectionError()

void com.red.rcp.RCPCamera.onConnectionError ( final String  id,
final String  msg 
)

Invoked when the connection error has occurred in the SDK.

The method is delegated to the parent listener.

See also
RCPCameraListener::onConnectionError

Implements com.red.rcp.RCPCameraListener.

◆ onStateChange()

void com.red.rcp.RCPCamera.onStateChange ( final String  id,
final String  param 
)

Invoked when a state change is detected in the connection to the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onStateChange

Implements com.red.rcp.RCPCameraListener.

◆ onStatusUpdate()

void com.red.rcp.RCPCamera.onStatusUpdate ( final String  id,
final String  param,
final int  isEnabled,
final int  isEnabledValid,
final int  isSupported,
final int  isSupportedValid 
)

Invoked when the status of a parameter is updated.

The method is delegated to the parent listener.

See also
RCPCameraListener::onStatusUpdate

Implements com.red.rcp.RCPCameraListener.

◆ onNotificationUpdate()

void com.red.rcp.RCPCamera.onNotificationUpdate ( final String  id,
final String  nID,
final String  title,
final String  message,
final String  notificationInfo 
)

Invoked when a camera notification is opened, updated, or closed.

The method is delegated to the parent listener.

See also
RCPCameraListener::onNotificationUpdate

Implements com.red.rcp.RCPCameraListener.

◆ onAudioVuUpdate()

void com.red.rcp.RCPCamera.onAudioVuUpdate ( final String  id,
final String  audioVu 
)

Invoked when audio input and output volumes are updated on the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onAudioVuUpdate

Implements com.red.rcp.RCPCameraListener.

◆ onMenuNodeListUpdate()

void com.red.rcp.RCPCamera.onMenuNodeListUpdate ( final String  id,
final int  nodeId,
final String []  childList,
final String []  ancestorList 
)

Invoked when menu node list is updated on the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onMenuNodeListUpdate

Implements com.red.rcp.RCPCameraListener.

◆ onMenuNodeStatusUpdate()

void com.red.rcp.RCPCamera.onMenuNodeStatusUpdate ( final String  id,
final int  nodeId,
final int  isEnabled,
final int  isEnabledValid,
final int  isSupported,
final int  isSupportedValid 
)

Invoked when menu node status is updated.

See also
RCPCameraListener::onMenuNodeStatusUpdate

Implements com.red.rcp.RCPCameraListener.

◆ onUpdateTag()

void com.red.rcp.RCPCamera.onUpdateTag ( final String  id,
final String  param 
)

Invoked when tagging information is updated on the camera.

The method is delegated to the parent listener.

See also
RCPCameraListener::onUpdateTag

Implements com.red.rcp.RCPCameraListener.

◆ onCameraInfo()

void com.red.rcp.RCPCamera.onCameraInfo ( final String  id,
final String  camInfo 
)

Invoked when a connection state change occurs.

The camInfo string returns detailed camera information. The format of the camInfo is "[Name];[PIN];[Type];[Version]".

Parameters
ididentifies the RCPCamera object
camInfodetailed camera information as a string

Implements com.red.rcp.RCPCameraListener.

◆ onRftpStatusUpdate()

void com.red.rcp.RCPCamera.onRftpStatusUpdate ( final String  id,
final byte []  uuid,
final int  rftpType,
final int  rftpError,
final int  percentComplete,
final String []  dirList 
)

Invoked to update the progress on previously initiated RFTP transfer.

File I/O is taken care of in native code.

Parameters
ididentifies the RCPCamera object
uuidbyte array containing the UUID. Same format as rcp_uuid_t
rftpTypeindicates what type of command this was (e.g. store). See rftp_types_t
rftpErrorError code. See rftp_error_t
percentCompleteApplicable to STORE and RETRIEVE. From 0 - 100
dirListApplicable to LIST command. Array of strings that contains the results of the listing.

Implements com.red.rcp.RCPCameraListener.

◆ getIsSupported()

int com.red.rcp.RCPCamera.getIsSupported ( String  parameterName)

Check if parameter is supported by connected camera.

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_SATURATION")
Returns
boolean value of whether the RCP parameter is supported by the connected camera

◆ getPropertyIsSupported()

int com.red.rcp.RCPCamera.getPropertyIsSupported ( String  parameterName,
int  propertyType 
)

Check if parameter property of a parameter is supported by connected camera.

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_SATURATION")
propertyTypevalue of property type to be checked 0 get 1 get list 2 get status 3 send 4 set int 5 set uint 6 set str 7 set list 8 edit info 9 update list only on close
Returns
boolean value of whether the RCP parameter is supported by the connected camera

◆ setParameterUnsigned()

void com.red.rcp.RCPCamera.setParameterUnsigned ( String  parameterName,
long  value 
)

Sets an unsigned integer parameter on the camera.

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_SATURATION")
valuevalue to set (e.g. 1200)

◆ getAPIVersion()

String com.red.rcp.RCPCamera.getAPIVersion ( )

◆ getParameterName()

String com.red.rcp.RCPCamera.getParameterName ( int  parameterId)

◆ setPeriodicEnable()

void com.red.rcp.RCPCamera.setPeriodicEnable ( String  parameterName,
boolean  enable 
)

Enable or disable periodic parameter updates.

Parameters
parameterNamename of the RCP parameter (e.g. "RCP_PARAM_HISTOGRAM")
enabletrue to enable, false to disable
Returns
boolean value of whether the RCP parameter is supported by the connected camera

◆ rftpGetIsSupported()

int com.red.rcp.RCPCamera.rftpGetIsSupported ( )

◆ rftpSendFile()

int com.red.rcp.RCPCamera.rftpSendFile ( String  localFile,
String  cameraFile,
boolean  compress,
byte []  uuid_out 
)

◆ rftpRetrieveFile()

int com.red.rcp.RCPCamera.rftpRetrieveFile ( String  localFile,
String  cameraFile,
int  maxFileSize,
boolean  compressionAllowed,
byte []  uuid_out 
)

◆ rftpAbortTransfer()

int com.red.rcp.RCPCamera.rftpAbortTransfer ( byte []  uuid_in)

◆ rftpDeleteFile()

int com.red.rcp.RCPCamera.rftpDeleteFile ( String  cameraFile,
byte []  uuid_out 
)

◆ rftpDirectoryList()

int com.red.rcp.RCPCamera.rftpDirectoryList ( String  path,
byte []  uuid_out 
)

Member Data Documentation

◆ RCP_UUID_LEN

final int com.red.rcp.RCPCamera.RCP_UUID_LEN = 41
static

The documentation for this class was generated from the following file: