hcamapi
index
/home/tfischer/work/ss-v2.5.2rc30/myapps/host_hcamapi/host/hcamapi.py

This python 2/3 module contains the base class for exposing edgertronic CAMAPI via HTTP.
 
Needed packages:
    pip install requests
 
@author Todd Fischer <fischer@sanstreak.com>
@date January, 2014
 
Sanstreak Corporation provides this source code solely on the terms and
conditions set forth in the edgertronic by Sanstreak Usage Agreement and
on the condition that you accept and comply with them.  You may view the
most recent version of the Usage Agreement at:
https://wiki.edgertronic.com/wiki/Edgertronic_by_Sanstreak_Usage_Agreement

 
Modules
       
ast
logging
os
requests
sys
time

 
Classes
       
builtins.object
HCamapi

 
class HCamapi(builtins.object)
    Python binding for Sanstreak edgertronic CAMAPI methods.
 
Host CAMAPI (hcamapi) supports a HTTP/JSON network binding to CAMAPI
for configurating, controlling and monitoring a high speed camera.
 
  Methods defined here:
__init__(self, address, http_timeout=None)
Establish communication with the edgertronic camera.
 
:parm address: camera's IP address string or DNS name
:parm http_timeout: number of seconds to wait for a response
cancel(self, discard_captures=False)
Cancels current camera activity and gets ready for the next trigger.  If discard_captures then any previously
captured, but not saved, videos will be discard.
Camera returns to run state if current state is triggered, save interrupted, or review.
:return: outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_INVALID_STATE
check_save_state(self, desired_save_state)
Returns True if camera is in desired_state.
check_state(self, desired_state)
Returns True if camera is in desired_state.
check_storage(self)
Check if a change has occurred in the available storage devices and update
active storage device as necessary.
Always returns CAMAPI_STATUS_OKAY.  Fetch the camera status to determine
if the active storage device changed.
configure_camera(self, requested_settings)
Configure camera using the requested_settings dictionary.
Calculates a camera configuration based on the requested values, camera limitations, and
a prioritized scheme to to eliminate inconsistencies.
return: dictionary of requested setting values along with the allowed values.
configure_save(self, save_config_parms)
Override zero or more camera configuration parameters that can be modified after video frames have been captured.
:param save_config_parms['requested_iso']: Optional, iso in a more limited range as only digital gain can be change after the video frames have been captured.
:param save_config_parms['requested_force_monochrome']: Optional, flag to force color camera to save monochrome video.
:param save_config_parms['requested_gamma_correction']: Optional, flag to enable / disable gamma correction.
:param save_config_parms['requested_pipeline']: Optional, string to specify which video encode pipeline to use.
:param save_config_parms['requested_notes']: Optional, descriptive text string saved in metadata file and optionally overlayed on video frames
:param save_config_parms['requested_overlay_notes']: Optional, flag to cause the notes text to overlay on each video frame
:param save_config_parms['requested_overlay_logo']: Optional, flag to cause the user supplied logo to overlay on each video frame
:param save_config_parms['requested_overlay_settings']: Optional, flag to cause the common camera settings to overlay on each video frame
:param save_config_parms['requested_overlay_frame_number']: Optional, flag to cause the frame number to overlay on each video frame
:param save_config_parms['requested_filename_pattern']: Optional, parameterized filename (no extension) used for saving video and metadata
:return: allowed dictionary containing the parameters that will be used when the next selective_save() is invoked
delete_all_favorites(self)
delete_ext_storage_configuration(self, estore_query)
Accepts dictionary describing an external, typically network, storage technology.
Deletes existing external storage configuration.
:return: CAMAPI_STATUS_OKAY if there is no longer any configuation or CAMAPI_STATUS_INVALID_PARAMETER
delete_favorite(self, id)
Deletes a previously saved favorite using id to identify which favorite to delete
returns: CAMAPI status
delete_saved_setting(self, id)
Depreciated.  Use delete_favorite() instead.
Deletes a previously saved set of camera configuration values.
id must be provided, in the range 0 to 99
Returns: CAMAPI_STATUS_OKAY or CAMAPI_STATUS_INVALID_PARAMETER
display_remote_file(self, remote_fqn)
Downloads file and prints the content on stdout.  Downloads using the remote
fully qualified name.
erase_all_files(self, dev=None)
Erases all the files in the DCIM directory on the active storage device if dev=None.
You can use dev="USB" or dev="SD" to specify device to have files erased.
return: outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_STORAGE_ERROR
erase_file(self, filename)
Erases a file from a removable storage device.  If the filename begins with '/' then
the fully qualified filename (FQN) is used to erase the file, otherwise, a file in the
currently active storage directory is erased.  A FQN file must start with either '/mnt/'
followed by 'sdcard', 'usb' or 'net'.  A filename can end with '*' to erase both a video file
and the matching metadata file'. Examples:
    http://10.11.12.13/erase_file?filename=slomo_1552669012_2.*
    http://10.11.12.13/erase_file?filename=/mnt/sdcard/DCIM/slomo_1552669012_2.mov
Returns: CAMAPI_STATUS_INVALID_PARAMETER, CAMAPI_STATUS_OKAY or CAMAPI_STATUS_STORAGE_ERROR
extract_metadata(self, remote_filename)
If remote filename starts with a '/', it is used as the fqn under the /static HTTP path.
Otherwise, the path to the active video storage directory is used.
factory_reset(self, wait=False)
Perform a factory reset followed by rebooting the camera.
:param wait: If True, waits for webserver to be active before returning.
:return: outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_TIMEOUT
fetch_remote_directory_listing(self, path=None)
Returns a list of filenames.  If path is None, then the list is the files in the video directories
stored on the active storage device otherwise returns list of files in the named path.
fetch_remote_file(self, remote_fqn)
Downloads and save the file using the remote fully qualified name and saves the file
in the current working directory using the basename from remote_fqn.
return: local filename
format_storage(self, dev=None)
Formats active storage device is dev is not specified.
Use dev="USB" or dev="SD" to specify device to be formatted.
return: outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_STORAGE_ERROR
get_accessory_list(self)
Returns a dictionary where the key is the accessory name and the value is the CAMAPI_ACCESSORY_STATE_*.
get_camhistory(self)
Returns a dictionary containing camera history.
get_caminfo(self)
Returns a dictionary of all the unchanging camera information.
get_camstatus(self)
Return camera status dictionary.
 
See https://wiki.edgertronic.com/wiki/SDK_-_Querying_camera_information#CAMAPI_get_camstatus.28.29
:returns: dictionary of camera status values
get_captured_video_info(self)
Returns a dictionary of dictionaries containing information about each captured, but unsaved, video.
The video currently being saved is included in the returned dictionary.
The returned dictionary contains seven keys plus one dictionary for each captured video.
- 'unsaved_count': number of buffers captured
- 'buffer_size': maximum number of frames that fit into a capture buffer
- 'pretrigger': percentage of the capture buffer holding pretrigger frames, deprecated
- 'pretrigger_frames': number of frame is the capture buffer reserved for pretrigger frames
- 'posttrigger1_frames': number of frame is the capture buffer reserved for posttrigger1 frames
- 'posttrigger2_frames': number of frame is the capture buffer reserved for posttrigger2 frames
- 'video_save_count': number of videos saved since the camera was manufactured (see notes overlay and filename parameter '&c')
- 'first_buffer': capture number for the oldest captured video
For each capture, there is a dictionary containing details specific to that capture.
The dictionary name is the capture index, starting at one.  The keys include:
- 'trigger_time': epoc time camera was triggered rounded to the nearest second
- 'start_frame': frame number of the first frame, where frame zero is the trigger frame
- 'end_frame':  frame number of the last frame, where frame zero is the trigger frame
get_current_settings(self)
Returns dictionary containing the current requested camera settings that are being used if camera is active,
otherwise None. Dictionary may contain other values - do not count on them being present in future versions of CAMAPI.
Defined camera settings documented at http://wiki.edgertronic.com/index.php/Software_developers_kit
get_default_settings(self)
Returns camera default settings.
:return: Dictionary containing factory reset camera settings.
get_ext_storage_configuration(self, estore_query)
Accepts dictionary describing an external, typically network, storage technology.
Retrieve external storage configuration parameters, if any.
:return: dictionary containing external storage configuration information or empty dictionary if estore_query has a parameter error or there are no previously saved settings.
get_ext_storage_state(self, estore_query)
Accepts dictionary describing an external, typically network, storage technology.
:return: CAMAPI_STATUS_* or CAMAPI_ESTORAGE_STATE_* state of the external storage device for the specified technology.
get_favorite(self, id)
returns: dictionary containing previously saved favorite settings with identifier id.
get_favorite_ids(self)
returns: list of saved favorite setting identifiers, will be an empty list if no settings have been saved.
get_history_string(self, prefix_text)
Returns human readable text describing the camera.  Text format will change in the future.
get_info_string(self, prefix_text)
Returns human readable text describing the camera.  Text format will change in the future.
get_last_saved_filename(self)
Returns filename used by the last successful video capture.
Note: API is deprecated, better to query file system directly.
get_pretrigger_fill_level(self)
Deprecated.  Use get_camstatus() level key.
 
:returns: pretrigger buffer fill as an integer percentage
get_save_state(self)
Returns current camera save state.
get_save_status_string(self, camstatus)
get_saved_settings(self, id=None)
Returns dictionary containing last successfully saved settings or
default camera settings otherwise, along with the allowed settings.
Use of id is depreciated.  Use get_favorite() instead.
If id is specified, returns the camera settings for that identifier,
or an empty dictionary if the settings for the specified identifier do not exist.
get_state(self)
Returns current camera capture state.
get_status(self)
Deprecated.  Return (state, level, flags) camera status tuple.
get_status_string(self)
Returns human readable string of the current device status.  Text format will change in the future.
get_storage_dir(self)
Returns path to mount point of the active storage device or None if there is no storage device available.
get_storage_info(self, device=None)
Returns a dictonary containing information about the storage device , or about active storage device if device is not set
:return: empty diectionary if no storage installed
get_text_save_state(self, save_st)
Helper routine to present camera save state as human readable text.
get_text_state(self, st)
Helper routine to present camera state as human readable text.
get_text_status(self, status)
Helper routine to present CAMAPI return status enumeration as human readable text.
mount(self, dev=None)
Attempts to mount specified storage device. Use /mount?device=USB,
/mount?device=SD, or /mount?device=NET to specify the device.
Returns: CAMAPI_STATUS_OKAY or CAMAPI_STATUS_STORAGE_ERROR, CAMAPI_STATUS_INVALID_PARAMETER
net_get_configuration(self)
Get network IP address parameters.  The returned allowed and requested values will always be the same.
The supported network settings dictionary entries include:
requested_ipv4_method / ipv4_method - NETWORK_IPV4_METHOD_*
requested_ipv4_addr / ipv4_addr - string in the format XXY.XXY.XXY.XXY where X is an optional 0 .. 9 digit and Y is a mandatory  0 .. 9 digit.
requested_ipv4_netmask / ipv4_netmask - optional string in the format XXY.XXY.XXY.XXY.  Defaults to 255.255.255.0
requested_ipv4_gateway / ipv4_gateway - optional string in the format XXY.XXY.XXY.XXY.
requested_dns_server / dns_server - optional string in the format XXY.XXY.XXY.XXY.
requested_ntp_server / ntp_server - optional string in the format XXY.XXY.XXY.XXY or domain name string like pool.ntp.org
macaddr - eth0 ethernet mac address
eth0_carrier - 0 if there is not mac carrier (should never happen over a live network connection) or 1 if there is mac carrier
active_ipv4_addr - current IP address used by the camera
active_ipv4_netmask - current network mask used by the camera
active_ipv4_gateway - current network address used by the camera
net_set_configuration(self, new_network_settings)
Set network IP address parameters.
The supported network settings dictionary entries include:
requested_ipv4_method - either 'fixed', or 'dhcp-fallback-fixed'
requested_ipv4_addr - string in the format XXY.XXY.XXY.XXY where X is an optional 0 .. 9 digit and Y is a mandatory  0 .. 9 digit.
requested_ipv4_netmask - optional string in the format XXY.XXY.XXY.XXY.  Defaults to 255.255.255.0
requested_ipv4_gateway - optional string in the format XXY.XXY.XXY.XXY.
requested_dns_server - optional string in the format XXY.XXY.XXY.XXY.
requested_ntp_server - optional string in the format XXY.XXY.XXY.XXY or domain name string like pool.ntp.org
Returns the accepted camera configuration.  The returned values may not yet be activated as network configuration
changes are delayed 3 seconds to give the camera an opportunity to first respond to the current request.
Also returns ipv4_addr_changed if the camera's IP address will change.
print_all_favorites(self)
print_favorite(self, id)
print_settings(self, s, dict_key_leader, tab)
read_file(self, fqn)
Read a file from the camera's file system and returns the contents.
:param fqn: Fully qualified filename (meaning starts with a '/') where data is stored.
returns: file contents
reboot(self, wait=False)
Software reboot the camera.
:param wait: If True, waits for webserver to be active before returning.
:return: outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_TIMEOUT
reconfigure_run(self, run_config_parms)
Updates the set of allowed run parameters and applies them immediately without interrupting the frames
being stored in the pretrigger buffer.  The new settings apply to all video captured in the future until
run() or reconfigure_run() is called.  Videos that have been captured, but not saved, are not affected.
The set of allow parameters are those that don't require a recalibration.  This keeps the pre-trigger buffer from being emptied.
:param run_config_parms['requested_iso']: Optional, iso in a more limited range as only digital gain can be change after the video frames have been captured.
:param run_config_parms['requested_exposure']: Optional, previously captured frames in the pre-trigger buffer will use the previous exposure setting.
:param run_config_parms['requested_force_monochrome']: Optional, flag to force color camera to save monochrome video.
:param run_config_parms['requested_gamma_correction']: Optional, flag to enable / disable gamma correction.
:param run_config_parms['requested_notes']: Optional, descriptive text string saved in metadata file and optionally overlayed on video frames
:param run_config_parms['requested_overlay_notes']: Optional, flag to cause the notes text to overlay on each video frame
:param run_config_parms['requested_overlay_logo']: Optional, flag to cause the user supplied logo to overlay on each video frame
:param run_config_parms['requested_overlay_settings']: Optional, flag to cause the common camera settings to overlay on each video frame
:param run_config_parms['requested_overlay_frame_number']: Optional, flag to cause the frame number to overlay on each video frame
:param run_config_parms['requested_filename_pattern']: Optional, filename pattern to use for video and metadata files
:param run_config_parms['requested_camera_name']: Optional, descriptive text string typically used to identify this camera
:return: allowed dictionary containing the parameters used for current and future captures
register_app_ext(self, app_ext_dict)
Runtime addition of user supplied application extension.
Accepts a dictionary with the following keys:
   filename - must be in the form app_ext_*.py
   app_ext - python source code for an AppExt class
Returns: dictionary with a status key indicating the outcome.
rename_last_video(self, rename_dict)
Renames the most recently triggered ('stage'=RENAME_STAGE_TRIGGERED) or most recently
captured video that is queued for  save ('stage'=RENAME_STAGE_QUEUED) or fully saved
('stage'=RENAME_STAGE_SAVED) video. Also renames the matching metadata file. If
back-to-back triggering or saving is occuring, then depending on the timing, you may
rename a different video than intended.  The rename_last_video() method behavior
depends on the camera state, which changes with time.  You need save times  much
longer than your host software processing times for this method to be useful. A much
better design to provide the desired  filename with run() or trigger(). If 'stage'
is not specified, then last saved video will be renamed.  The new_filename_pattern
can be in the form  new_name, FQFN /mnt/sdcard/DCIM/new_name, or just new_name
and contain parameters.  e.g. new_name_&c.
param: rename_dict['new_filename_pattern'] parameterized filename
param: rename_dict['stage'] can be any of the RENAME_STAGE_* enumerations
Enum: RENAME_STAGE_SAVED 0
Enum: RENAME_STAGE_TRIGGERED 1
Enum: RENAME_STAGE_QUEUED 2
Returns: { 'err': CAMAPI_STATUS_*, 'actual_filename': FQFN without file extention }
review_frame(self, buffer_number, frame_number)
Review specified frame from video previously stored in DDR3 memory.
:param buffer_number: multishot buffer number of the captured video to review
:param frame_number: frame to review
:return: outcome, either CAMAPI_STATUS_OKAY, CAMAPI_STATUS_INVALID_STATE,  CAMAPI_STATUS_INVALID_PARAMETER
run(self, requested_settings)
"
Reconfigures the camara to use the best match values based on the requested values,
calibrates the camera using those values, and starts capturing the pre-trigger video frames.
The best match values are the same balues as those returned by configure_camera().
return: outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_INVALID_STATE
save(self)
Saves videos when multishot capture is enabled and one or more multishot buffers contain unsaved videos.
:return: outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_INVALID_STATE
save_favorite(self, favorite_settings)
Save a set of camera settings.  The supplied settings must have an 'id' key set to a valid value.
returns: CAMAPI status okay, illegal parameter, or storage error
save_stop(self, discard_unsaved=False)
Stop save that is in process, truncating video to the portion saved so far.  Rest of captured video data is discarded.
If there are more unsaved multishot videos and discard_unsaved is set, the rest of the unsaved videos are
discarded as well.
:return: outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_INVALID_STATE
scan_ext_storage(self, estore_query=None)
Accepts dictionary describing an external, typically network, storage system to scan.
:return: human readable output of available storage
selective_save(self, save_parms)
Save portion of video previously stored in DDR3 memory.  Captured videos in DDR3 are not modified.
:param save_parms['buffer_number']: which multishot buffer to save.
:param save_parms['start_frame']: Starting frame to save.
:param save_parms['end_frame']: Ending frame to save.
:param save_parms['filename']: Optional, parameterized filename (no extension) used for saving video and metadata
:return: outcome, CAMAPI_STATUS_OKAY, CAMAPI_STATUS_INVALID_STATE, CAMAPI_STATUS_INVALID_PARAMETER
set_ext_storage_configuration(self, estore_config)
Accepts dictionary describing an external, typically network, storage configuration.
Can take up to 60 seconds to return.  During this time all other CAMAPI calls are unresponsive (meaning delayed until this method returns).
:return: CAMAPI_STATUS_OKAY if storage configuration was saved, otherwise returns CAMAPI_STATUS_INVALID_PARAMETER
sync_time(self, set_time=None)
Returns the camera's current time in seconds from Jan 1, 1970 (called the Unix epoch).
If set_time is specified (in Unix epoch units), then the camera's hardware real time clock is first set.
trigger(self, base_filename=None, user_parm=None)
"
Stops filling the pre-trigger portion buffer and starts filling the post-trigger portion of the buffer.
The base filename will have a video file extension appended for the movie file and a ".txt" extension
appended for the file containing the video capture metadata.
 
:param base_filename: Name of file to use to hold the captured video.  base_filename should not
                      have an extension.  If the base_filename begins with '/', then
                      the fully qualified filename (FQN) is used to erase the file, otherwise,
                      The video and metadata files are stored in the currently active storage
                      directory.  A FQN file must start with either '/mnt/' followed by 'sdcard',
                      'usb' or 'net' followed by the path and filename.  the base_filename can
                      contain parameters that will be expanded when the files are saved.
:param user_parm:     text string that is stored in the metadata file and can optinally be
                      overlayed in notes.
 
:return:              outcome, either CAMAPI_STATUS_OKAY or CAMAPI_STATUS_INVALID_STATE
trigger_hw(self, base_filename=None, user_parm=None)
Designed to be called by software running in the camera, such as user-added URLs python code.
Non-blocking version of trigger() with no state checking and always returning CAMAPI_STATUS_OKAY.
If the camera is able to be triggered, it will trigger.  Operates similar to triggering using the
built-in multi-function button.  The base_filename and user_parm are ignored if no trigger occurred.
Use get_camstatus() to check if the state changed to CAMAPI_STATE_TRIGGERED.
 
:param base_filename: Name of file to use to hold the captured video.  base_filename should not
                      have an extension.  If the base_filename begins with '/', then the path
                      to the active storage device is not prepended.
:param user_parm:     Text string that is included in the captured video metadata file and can be used
                      in the notes string and in the filename.
:return:              outcome, CAMAPI_STATUS_OKAY
unmount(self, dev=None)
Attempts to unmount mnt_pt or selected storage device if dev is None.
Use dev="USB" or dev="SD" to specify device to be unmounted. Unmounting
the selected storage device causes the camera to select USB
storage if possible or SD storage if USB storage is unavailable and
SD storage is usable.
Returns: CAMAPI_STATUS_OKAY or CAMAPI_STATUS_STORAGE_ERROR
wait_for_pending_saves_to_finish(self, label, timeout)
wait_for_save_transition(self, label, current_state, timeout)
Waits for camera to transition from current save state to a different state.  Timeout is the maximun wait time in seconds.  Returns last state polled.
wait_for_state(self, label, next_state, timeout)
Waits for camera to transition to next_state.  Timeout is the maximun wait time in seconds.
wait_for_transition(self, label, current_state, timeout)
Waits for camera to transition from current_state to a different state.  Timeout is the maximun wait time in seconds.  Returns last state polled.
wait_until_running(self, label, timeout)
write_file(self, fqn, data)
Writes a file to the camera's file system.  Intended use case is installing configuration files.
Most of the file system is read-only; writing to a read-only directory or file will fail.
:param fqn: Fully qualified filename (meaning starts with a '/') where data will be stored.
:param data: Data to write to the file.
returns: CAMAPI_STATUS_OKAY, CAMAPI_STATUS_INVALID_PARAMETER, or CAMAPI_STATUS_STORAGE_ERROR

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes defined here:
METADATA_FILE_LOOKUP_TABLE = {'Active pipeline:': 'pipeline', 'Build date:': 'build_date', 'Camera Name:': 'camera_name', 'Camera time:': 'camera_time', 'DACVREFADC:': 'dacvrefadc', 'DDR3 maximum temperature:': 'ddr3_temp_max', 'DDR3 memory size:': 'memory_size', 'DDR3 minimum temperature:': 'ddr3_temp_min', 'DDR3 temp at last calibration:': 'calibration_ddr3_temp', 'DDR3 temp:': 'ddr3_temp', ...}
METADATA_TEXT_SETTINGS = ('camera_name', 'model_string', 'pipeline_description', 'time_since_dark_frame', 'uptime', 'ethernet_mac_address', 'playback_framerate', 'software_version', 'user_parm')
METADATA_TRUE_FALSE_KEYS = ('genlock_locked',)
cam_addr = None
http_timeout = 10

 
Data
        AUTO_EXPOSURE_AVERAGE = 2
AUTO_EXPOSURE_OFF = 0
AUTO_EXPOSURE_SATURATION = 1
CAMAPI_ACCESSORY_STATE_CONNECTED = 1
CAMAPI_ACCESSORY_STATE_REMOVED = 2
CAMAPI_ACCESSORY_STATE_RUNNING = 3
CAMAPI_ACCESSORY_STATE_STOPPED = 4
CAMAPI_ACCESSORY_STATE_UNKNOWN = 0
CAMAPI_ESTORAGE_STATE_CONFIGURED = 102
CAMAPI_ESTORAGE_STATE_ERROR = 104
CAMAPI_ESTORAGE_STATE_MOUNTED = 103
CAMAPI_ESTORAGE_STATE_UNCONFIGURED = 101
CAMAPI_FLAG_GENLOCK_CONFIG_ERROR = 524288
CAMAPI_FLAG_GENLOCK_NO_SIGNAL = 262144
CAMAPI_FLAG_NET_CONFIGURED = 512
CAMAPI_FLAG_NET_FULL = 2048
CAMAPI_FLAG_NET_NOT_MOUNTABLE = 1024
CAMAPI_FLAG_SD_CARD_STORAGE_FULL = 32
CAMAPI_FLAG_SD_CARD_STORAGE_INSTALLED = 8
CAMAPI_FLAG_SD_CARD_STORAGE_UNMOUNTED = 128
CAMAPI_FLAG_SHUTTER_FAILURE = 131072
CAMAPI_FLAG_STORAGE_BAD = 64
CAMAPI_FLAG_STORAGE_FULL = 1
CAMAPI_FLAG_STORAGE_MISSING_OR_UNMOUNTED = 2
CAMAPI_FLAG_USB_STORAGE_FULL = 16
CAMAPI_FLAG_USB_STORAGE_INSTALLED = 4
CAMAPI_FLAG_USB_STORAGE_UNMOUNTED = 256
CAMAPI_SAVE_STATE_IDLE = 1
CAMAPI_SAVE_STATE_SAVE_INTERRUPTED = 9
CAMAPI_SAVE_STATE_SAVE_TRUNCATING = 10
CAMAPI_SAVE_STATE_SAVING = 5
CAMAPI_SAVE_STATE_SELECTIVE_SAVING = 12
CAMAPI_STATE_BUFFERS_FULL_TRIGGER_DISABLED = 13
CAMAPI_STATE_CALIBRATING = 2
CAMAPI_STATE_REVIEWING = 11
CAMAPI_STATE_RUNNING = 3
CAMAPI_STATE_RUNNING_PRETRIGGER_FULL = 6
CAMAPI_STATE_SAVE_INTERRUPTED = 9
CAMAPI_STATE_SAVE_TRUNCATING = 10
CAMAPI_STATE_SAVING = 5
CAMAPI_STATE_SELECTIVE_SAVING = 12
CAMAPI_STATE_TRIGGERED = 4
CAMAPI_STATE_TRIGGER_CANCELED = 7
CAMAPI_STATE_UNCONFIGURED = 1
CAMAPI_STATE_WAITING_FOR_SAVE_TO_COMPLETE_TRIGGER_DISABLED = 14
CAMAPI_STATUS_CODE_OUT_OF_DATE = 4
CAMAPI_STATUS_INVALID_CONFIGURATION = 6
CAMAPI_STATUS_INVALID_PARAMETER = 5
CAMAPI_STATUS_INVALID_STATE = 2
CAMAPI_STATUS_OKAY = 1
CAMAPI_STATUS_STORAGE_ERROR = 3
CAMAPI_STATUS_TIMEOUT = 7
CAMERA_BINARY_SETTINGS = ('subsample', 'force_monochrome', 'trigger_debounce', 'gamma_correction', 'save_view', 'overlay_notes', 'overlay_logo', 'overlay_settings', 'overlay_frame_number', 'multirate_capture')
CAMERA_COMMON_SETTINGS = ('camera_name', 'iso', 'exposure', 'horizontal', 'vertical', 'h_offset', 'v_offset', 'subsample', 'edr', 'overclock', 'genlock', 'force_monochrome', 'multishot_count', 'trigger_debounce', 'gamma_correction', 'save_mode', 'pipeline', 'notes', 'overlay_notes', 'overlay_logo', ...)
CAMERA_MRC_SETTINGS = ('pretrigger_frame_rate', 'posttrigger1_frame_rate', 'posttrigger2_frame_rate', 'pretrigger_duration', 'posttrigger1_duration', 'posttrigger2_duration', 'multirate_capture')
CAMERA_NET_RO_SETTINGS = ('eth0_carrier', 'macaddr', 'ipv4_active_addr', 'ipv4_active_netmask', 'ipv4_addr')
CAMERA_NET_RW_SETTINGS = ('ipv4_method', 'ipv4_addr', 'ipv4_netmask', 'dns_server', 'ntp_server')
CAMERA_RO_MRC_SETTINGS = ('pretrigger_frames', 'posttrigger1_frames', 'posttrigger2_frames')
CAMERA_RO_SETTINGS = ('warning',)
CAMERA_SETTINGS = ('camera_name', 'iso', 'exposure', 'horizontal', 'vertical', 'h_offset', 'v_offset', 'subsample', 'edr', 'overclock', 'genlock', 'force_monochrome', 'multishot_count', 'trigger_debounce', 'gamma_correction', 'save_mode', 'pipeline', 'notes', 'overlay_notes', 'overlay_logo', ...)
CAMERA_SRC_SETTINGS = ('frame_rate', 'duration', 'pretrigger')
CAMERA_TEXT_SETTINGS = ('pipeline', 'camera_name', 'notes', 'filename_pattern', 'encode_framerate')
GENLOCK_EXT = 3
GENLOCK_MASTER = 1
GENLOCK_OFF = 0
GENLOCK_RECEIVER = 2
GENLOCK_SLAVE = 2
GENLOCK_SOURCE = 1
NETWORK_IPV4_METHOD_DHCP = 2
NETWORK_IPV4_METHOD_DHCP_FALLBACK_FIXED = 1
NETWORK_IPV4_METHOD_FIXED = 0
PLAYBACK_FRAMERATE_23_976 = 1
PLAYBACK_FRAMERATE_24 = 2
PLAYBACK_FRAMERATE_25 = 3
PLAYBACK_FRAMERATE_29_97 = 4
PLAYBACK_FRAMERATE_30 = 5
PLAYBACK_FRAMERATE_50 = 6
PLAYBACK_FRAMERATE_59_94 = 7
PLAYBACK_FRAMERATE_60 = 8
PLAYBACK_FRAMERATE_UNKNOWN = 0
RENAME_STAGE_QUEUED = 2
RENAME_STAGE_SAVED = 0
RENAME_STAGE_TRIGGERED = 1
SAVE_MODE_AUTO = 0
SAVE_MODE_BACKGROUND = 2
SAVE_MODE_BACKGROUND_LIFO = 3
SAVE_MODE_REVIEW = 1
STREAM_STATUS_RUNTIME_ERROR = 303
STREAM_STATUS_STORAGE_FULL = 302