RCPCamera is the class that opens, maintains and closes a connection to a specific camera.
More...
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 |
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.
| com.red.rcp.RCPCamera.RCPCamera | ( | RCPCameraListener | pListener | ) |
Class constructor specifying the parent RCPCameraListener.
| pListener | parent RCPCameraListener |
| void com.red.rcp.RCPCamera.registerCommInterface | ( | RCPCommInterface | commInterface | ) |
| 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.
| pin | unique 9 digit pin of the camera with format "102-456-789" |
| ipaddress | IP address of camera (e.g. "192.168.1.144") |
| client_name | A string indicating the name of the client, usually the app name, e.g. "MyAndroidApp" |
| client_version | A string indicating the version of the client, e.g. "1.2" |
| client_user | Optional unique user defined string, null if not used |
0 if connection was opened successfully; -1 if the connection failed | void com.red.rcp.RCPCamera.close | ( | ) |
Closes a camera connection.
| String com.red.rcp.RCPCamera.getID | ( | ) |
| void com.red.rcp.RCPCamera.toggleRecordState | ( | ) |
Toggles the record state of the camera.
| void com.red.rcp.RCPCamera.setParameter | ( | String | parameterName | ) |
Send a argument-less RCP parameter to the camera.
| parameterName | name of the RCP parameter |
| void com.red.rcp.RCPCamera.setParameter | ( | String | parameterName, |
| int | value | ||
| ) |
Sets an integer parameter on the camera.
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_SATURATION") |
| value | value to set (e.g. 1200) |
| void com.red.rcp.RCPCamera.setParameterString | ( | String | parameterName, |
| String | value | ||
| ) |
Sets a string parameter on the camera.
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_SLATE_SCENE") |
| value | value to set (e.g. "Woods") |
| void com.red.rcp.RCPCamera.getParameter | ( | String | parameterName | ) |
Gets a parameter from the camera.
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_SATURATION") |
| void com.red.rcp.RCPCamera.getList | ( | String | listName | ) |
Gets a list from the camera.
| listName | name of the RCP parameter (e.g. "RCP_PARAM_ISO") |
| void com.red.rcp.RCPCamera.setList | ( | String | listName, |
| String | listStrings, | ||
| String | listValues | ||
| ) |
Sets a list in the camera.
| listName | name of the RCP parameter (e.g. "RCP_PARAM_ISO") |
| listStrings | list of strings to be used to set the RCP parameter's list |
| listValues | list of values to be used to set the RCP parameter's list |
| 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.
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_ISO") |
| int com.red.rcp.RCPCamera.menuIsSupported | ( | ) |
Check if menu tree is supported by connected camera.
| int com.red.rcp.RCPCamera.menuGetChildren | ( | int | menuNodeId | ) |
Requests menu tree children for given parent mode.
| menuNodeId | ID of the parent node |
| int com.red.rcp.RCPCamera.menuNodeStatusIsSupported | ( | ) |
Check if menu tree node status is supported by connected camera.
| int com.red.rcp.RCPCamera.menuNodeGetStatus | ( | int | menuNodeId | ) |
Requests menu status for the given mode.
| menuNodeId | ID of the node |
| int com.red.rcp.RCPCamera.notificationGet | ( | ) |
Get current notification.
| 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.
| notificationId | ID of the notification |
| int com.red.rcp.RCPCamera.notificationResponse | ( | String | notificationId, |
| int | response | ||
| ) |
Sends response for current notification.
| notificationId | ID of the notification |
| response | value of response selected |
| int com.red.rcp.RCPCamera.getCameraConnectionStats | ( | int | statsType | ) |
Gets stats regarding camera connection.
| statsType | value of stats type selected 0 Tx Packets 1 Tx Bytes 2 Rx Packets 3 Rx Bytes |
| 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
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_SLATE_SCENE") |
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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.
Implements com.red.rcp.RCPCameraListener.
| 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]".
| id | identifies the RCPCamera object |
| camInfo | detailed camera information as a string |
Implements com.red.rcp.RCPCameraListener.
| 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.
| id | identifies the RCPCamera object |
| uuid | byte array containing the UUID. Same format as rcp_uuid_t |
| rftpType | indicates what type of command this was (e.g. store). See rftp_types_t |
| rftpError | Error code. See rftp_error_t |
| percentComplete | Applicable to STORE and RETRIEVE. From 0 - 100 |
| dirList | Applicable to LIST command. Array of strings that contains the results of the listing. |
Implements com.red.rcp.RCPCameraListener.
| int com.red.rcp.RCPCamera.getIsSupported | ( | String | parameterName | ) |
Check if parameter is supported by connected camera.
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_SATURATION") |
| int com.red.rcp.RCPCamera.getPropertyIsSupported | ( | String | parameterName, |
| int | propertyType | ||
| ) |
Check if parameter property of a parameter is supported by connected camera.
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_SATURATION") |
| propertyType | value 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 |
| void com.red.rcp.RCPCamera.setParameterUnsigned | ( | String | parameterName, |
| long | value | ||
| ) |
Sets an unsigned integer parameter on the camera.
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_SATURATION") |
| value | value to set (e.g. 1200) |
| String com.red.rcp.RCPCamera.getAPIVersion | ( | ) |
| String com.red.rcp.RCPCamera.getParameterName | ( | int | parameterId | ) |
| void com.red.rcp.RCPCamera.setPeriodicEnable | ( | String | parameterName, |
| boolean | enable | ||
| ) |
Enable or disable periodic parameter updates.
| parameterName | name of the RCP parameter (e.g. "RCP_PARAM_HISTOGRAM") |
| enable | true to enable, false to disable |
| int com.red.rcp.RCPCamera.rftpGetIsSupported | ( | ) |
| int com.red.rcp.RCPCamera.rftpSendFile | ( | String | localFile, |
| String | cameraFile, | ||
| boolean | compress, | ||
| byte [] | uuid_out | ||
| ) |
| int com.red.rcp.RCPCamera.rftpRetrieveFile | ( | String | localFile, |
| String | cameraFile, | ||
| int | maxFileSize, | ||
| boolean | compressionAllowed, | ||
| byte [] | uuid_out | ||
| ) |
| int com.red.rcp.RCPCamera.rftpAbortTransfer | ( | byte [] | uuid_in | ) |
| int com.red.rcp.RCPCamera.rftpDeleteFile | ( | String | cameraFile, |
| byte [] | uuid_out | ||
| ) |
| int com.red.rcp.RCPCamera.rftpDirectoryList | ( | String | path, |
| byte [] | uuid_out | ||
| ) |
|
static |