pict
Documentation for pict is still a work-in-progress
 
Loading...
Searching...
No Matches
cl_data.h
Go to the documentation of this file.
1
2// PTP data structures. Byte-wise, most of them are very similar to the spec, but
3// aren't actually compatible (they aren't packed). Don't try and memcpy into them.
4#ifndef CL_DATA_H
5#define CL_DATA_H
6
11
12// To store unpacked device info data, after parsing
14 uint16_t standard_version;
15 uint32_t vendor_ext_id;
16 uint16_t version;
17 char extensions[128];
18 uint16_t functional_mode;
19
20 int ops_supported_length;
21 uint16_t ops_supported[256];
22
23 int events_supported_length;
24 uint16_t events_supported[256];
25
26 int props_supported_length;
27 uint16_t props_supported[512];
28
29 int capture_formats_length;
30 uint16_t capture_formats[32];
31
32 int playback_formats_length;
33 uint16_t playback_formats[32];
34
35 char manufacturer[128];
36 char model[128];
37 char device_version[64];
38 char serial_number[128];
39};
40
42 uint16_t storage_type;
43 uint16_t fs_type;
44 uint16_t access_capability;
45 uint64_t max_capacity;
46 uint64_t free_space;
47 uint32_t free_objects;
48 char storage_desc[128];
49 char volume_identifier[128];
50};
51
53 uint32_t storage_id;
54 uint16_t obj_format;
55 uint16_t protection;
56 uint32_t compressed_size;
57 uint16_t thumb_format;
58 uint32_t thumb_compressed_size;
59 uint32_t thumb_width;
60 uint32_t thumb_height;
61 uint32_t img_width;
62 uint32_t img_height;
63 uint32_t img_bit_depth;
64 uint32_t parent_obj;
65 uint16_t assoc_type; // association
66 uint32_t assoc_desc;
67 uint32_t sequence_num;
68
69 char filename[64];
70 char date_created[32];
71 char date_modified[32];
72 char keywords[64];
73};
74
76 uint16_t length;
77 uint8_t data[];
78};
79
81 int min;
82 int max;
83 int step;
84};
85
87 uint16_t code;
88 uint16_t data_type;
89 uint8_t read_only; // (get/set)
90
91 // uint32_t variables will be used for all types <= 4 bytes
92 uint32_t default_value32;
93 uint32_t current_value32;
94 void *current_value;
95 void *default_value;
96
97 uint8_t form_type;
98 struct PtpRangeForm range_form;
99 struct PtpEnumerationForm *enum_form;
100};
101
103 uint32_t property_code;
104 uint32_t data_type;
105 uint8_t get_set;
106 uint32_t default_value;
107 uint32_t group_code;
108 uint32_t form_flag;
109 // mystery data type follows if form_flag == 0
110};
111
113 int type;
114 int code;
115 int value;
116 int def;
117};
118
120 uint32_t length;
121 uint32_t type;
122 // standard JPG follows
123};
124
126 uint32_t lv_pitch;
127 uint32_t lv_width;
128 uint32_t lcd_palette[256];
129};
130
132 uint8_t digic;
133 uint8_t v1;
134 uint8_t v2;
135 uint8_t v3;
136};
137
138enum PtpMlBmpLvOption {
139 PTP_ML_BMP_LV_GET_FRAME = 0,
140 PTP_ML_BMP_LV_GET_SPEC = 1,
141};
142
143enum PtpCHDKCommands {
144 PTP_CHDK_Version = 0,
145 PTP_CHDK_UploadFile = 5,
146};
147
148int ptp_pack_object_info(struct PtpRuntime *r, struct PtpObjectInfo *oi, uint8_t *buf, unsigned int max);
149
150int ptp_parse_prop_value(struct PtpRuntime *r);
151int ptp_parse_device_info(struct PtpRuntime *r, struct PtpDeviceInfo *di);
152int ptp_device_info_json(const struct PtpDeviceInfo *di, char *buffer, unsigned int max);
153int ptp_parse_prop_desc(struct PtpRuntime *r, struct PtpPropDesc *oi);
154int ptp_prop_desc_json(const struct PtpPropDesc *pd, char *buffer, unsigned int max);
155int ptp_parse_object_info(struct PtpRuntime *r, struct PtpObjectInfo *oi);
156int ptp_storage_info_json(const struct PtpStorageInfo *so, char *buffer, unsigned int max);
157int ptp_object_info_json(const struct PtpObjectInfo *so, char *buffer, unsigned int max);
158int ptp_parse_storage_info(struct PtpRuntime *r, struct PtpStorageInfo *si);
159__attribute__((deprecated)) int ptp_eos_events(struct PtpRuntime *r, struct PtpGenericEvent **p);
162int ptp_eos_events_open(struct PtpRuntime *r, struct PtpEventReader *reader);
165int ptp_eos_events_next(struct PtpRuntime *r, struct PtpEventReader *reader, struct PtpGenericEvent *event);
167int ptp_eos_events_json(struct PtpRuntime *r, char *buffer, unsigned int max);
168
169// Standard property value converters (conv.c)
170int ptp_eos_get_shutter(int data, int *out, int dir);
171int ptp_eos_get_iso(int data, int *out, int dir);
172int ptp_eos_get_aperture(int data, int *out, int dir);
173int ptp_eos_get_white_balance(int data, int *out, int dir);
174int ptp_eos_get_imgformat_value(uint32_t data[5], int *out);
175
176void *ptp_pack_chdk_upload_file(struct PtpRuntime *r, char *in, char *out, unsigned int *length);
177
178void *canon_evproc_pack(int *out_length, char *string);
179
180#endif
int ptp_eos_events_next(struct PtpRuntime *r, struct PtpEventReader *reader, struct PtpGenericEvent *event)
int ptp_eos_events_open(struct PtpRuntime *r, struct PtpEventReader *reader)
int ptp_eos_events_json(struct PtpRuntime *r, char *buffer, unsigned int max)
Reads event list currently in r->data and converts to JSON.