camlib
Documentation for camlib is still a work-in-progress
Loading...
Searching...
No Matches
PTP Operations

PTP opcode functions - may also call unpack data structures. More...

Functions

int ptp_liveview_params (struct PtpRuntime *r, struct PtpLiveviewParams *params)
 
int ptp_set_generic_property (struct PtpRuntime *r, const char *name, int value)
 Set a generic property - abstraction over SetDeviceProp.
 
int ptp_pre_take_picture (struct PtpRuntime *r)
 Call before taking a picture - this is generally for 'focusing' On some cameras this does nothing.
 
int ptp_take_picture (struct PtpRuntime *r)
 Call after calling ptp_pre_take_picture - this time a picture will be taken.
 
int ptp_open_session (struct PtpRuntime *r)
 Open a new session - required for most commands.
 
int ptp_close_session (struct PtpRuntime *r)
 
int ptp_get_device_info (struct PtpRuntime *r, struct PtpDeviceInfo *di)
 
int ptp_get_storage_ids (struct PtpRuntime *r, struct PtpArray **a)
 Returns allocated array of storage IDs call free() afterwards.
 
int ptp_init_capture (struct PtpRuntime *r, int storage_id, int object_format)
 
int ptp_init_open_capture (struct PtpRuntime *r, int storage_id, int object_format)
 
int ptp_terminate_open_capture (struct PtpRuntime *r, int trans)
 
int ptp_get_storage_info (struct PtpRuntime *r, int id, struct PtpStorageInfo *si)
 
int ptp_send_object_info (struct PtpRuntime *r, int storage_id, int handle, struct PtpObjectInfo *oi)
 
int ptp_get_prop_value (struct PtpRuntime *r, int code)
 
int ptp_set_prop_value (struct PtpRuntime *r, int code, int value)
 
int ptp_set_prop_value_data (struct PtpRuntime *r, int code, void *data, int length)
 
int ptp_get_prop_desc (struct PtpRuntime *r, int code, struct PtpPropDesc *pd)
 
int ptp_get_object_handles (struct PtpRuntime *r, int id, int format, int in, struct PtpArray **a)
 Gets a list of object handles in a storage device or folder.
 
int ptp_get_object_info (struct PtpRuntime *r, uint32_t handle, struct PtpObjectInfo *oi)
 
int ptp_move_object (struct PtpRuntime *r, int storage_id, int handle, int folder)
 
int ptp_delete_object (struct PtpRuntime *r, int handle, int format_code)
 
int ptp_get_thumbnail (struct PtpRuntime *r, int handle)
 Raw JPEG data is accessible from ptp_get_payload()
 
int ptp_get_partial_object (struct PtpRuntime *r, uint32_t handle, int offset, int max)
 
int ptp_get_object (struct PtpRuntime *r, int handle)
 Download an object.
 
int ptp_download_object (struct PtpRuntime *r, int handle, FILE *stream, size_t max)
 Download an object from handle, to a local file (uses GetPartialObject)
 
int ptp_get_all_known (struct PtpRuntime *r, struct PtpGenericEvent **s, int *length)
 Recieve a generic list of all properties received in DeviceInfo This is similar to getting all events, but for first startup when you know nothing. Some vendors do this, but this gets all the properties manually.
 
int ptpip_init_events (struct PtpRuntime *r)
 
int ptpip_init_command_request (struct PtpRuntime *r, const char *device_name)
 
int ptp_eos_get_viewfinder_data (struct PtpRuntime *r)
 
int ptp_eos_set_remote_mode (struct PtpRuntime *r, int mode)
 
int ptp_eos_set_prop_value (struct PtpRuntime *r, int code, int value)
 
int ptp_eos_set_event_mode (struct PtpRuntime *r, int mode)
 
int ptp_eos_remote_release_off (struct PtpRuntime *r, int mode)
 
int ptp_eos_remote_release_on (struct PtpRuntime *r, int mode)
 
int ptp_eos_get_event (struct PtpRuntime *r)
 
int ptp_eos_hdd_capacity_push (struct PtpRuntime *r)
 
int ptp_eos_hdd_capacity_pop (struct PtpRuntime *r)
 
int ptp_eos_get_prop_value (struct PtpRuntime *r, int code)
 
int ptp_eos_bulb_start (struct PtpRuntime *r)
 
int ptp_eos_bulb_stop (struct PtpRuntime *r)
 
int ptp_eos_set_ui_lock (struct PtpRuntime *r)
 
int ptp_eos_reset_ui_lock (struct PtpRuntime *r)
 
int ptp_eos_cancel_af (struct PtpRuntime *r)
 
int ptp_eos_drive_lens (struct PtpRuntime *r, int steps)
 
int ptp_eos_ping (struct PtpRuntime *r)
 
int ptp_liveview_size (struct PtpRuntime *r)
 
int ptp_liveview_init (struct PtpRuntime *r)
 
int ptp_liveview_deinit (struct PtpRuntime *r)
 
int ptp_liveview_frame (struct PtpRuntime *r, void *buffer)
 
int ptp_liveview_type (struct PtpRuntime *r)
 
int ptp_ml_init_bmp_lv (struct PtpRuntime *r)
 
int ptp_ml_get_bmp_lv (struct PtpRuntime *r, uint32_t **buffer_ptr)
 
int ptp_ml_get_liveview_v1 (struct PtpRuntime *r)
 
int ptp_chdk_get_version (struct PtpRuntime *r)
 
int ptp_chdk_upload_file (struct PtpRuntime *r, char *input, char *dest)
 
int ptp_eos_activate_command (struct PtpRuntime *r)
 
int ptp_eos_exec_evproc (struct PtpRuntime *r, void *data, int length, int expect_return)
 
int ptp_eos_evproc_run (struct PtpRuntime *r, char *fmt,...)
 
int ptp_eos_evproc_return_data (struct PtpRuntime *r)
 
int ptp_eos_fa_get_build_version (struct PtpRuntime *r, char *buffer, int max)
 
int ptp_eos_get_liveview (struct PtpRuntime *r)
 

Detailed Description

PTP opcode functions - may also call unpack data structures.

Function Documentation

◆ ptp_eos_get_liveview()

int ptp_eos_get_liveview ( struct PtpRuntime * r)
Returns
enum PtpGeneralError, 0 for 'camera is busy', or the size of the image in the payload

◆ ptp_get_all_known()

int ptp_get_all_known ( struct PtpRuntime * r,
struct PtpGenericEvent ** s,
int * length )

Recieve a generic list of all properties received in DeviceInfo This is similar to getting all events, but for first startup when you know nothing. Some vendors do this, but this gets all the properties manually.

Parameters
[out]sOutput structure, caller must free

◆ ptp_get_partial_object()

int ptp_get_partial_object ( struct PtpRuntime * r,
uint32_t handle,
int offset,
int max )
Note
Not thread safe.

◆ ptp_get_thumbnail()

int ptp_get_thumbnail ( struct PtpRuntime * r,
int handle )

Raw JPEG data is accessible from ptp_get_payload()

Note
Not thread safe.

◆ ptp_pre_take_picture()

int ptp_pre_take_picture ( struct PtpRuntime * r)

Call before taking a picture - this is generally for 'focusing' On some cameras this does nothing.

Note
This is meant for a onMouseDown-like event. ptp_take_picture should be called on onMouseUp

◆ ptp_set_generic_property()

int ptp_set_generic_property ( struct PtpRuntime * r,
const char * name,
int value )

Set a generic property - abstraction over SetDeviceProp.

Note
May reject writes if an invalid property is found (see event code)

◆ ptpip_init_command_request()

int ptpip_init_command_request ( struct PtpRuntime * r,
const char * device_name )
Note
PTP/IP only

◆ ptpip_init_events()

int ptpip_init_events ( struct PtpRuntime * r)
Note
PTP/IP only