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 - some very similar to the exact MTP/PTP spec.
3#ifndef CL_DATA_H
4#define CL_DATA_H
5
10
12 uint32_t length;
13 uint32_t data[4];
14};
15
16// To store unpacked device info data, after parsing
18 uint16_t standard_version;
19 uint32_t vendor_ext_id;
20 uint16_t version;
21 char extensions[128];
22 uint16_t functional_mode;
23
24 int ops_supported_length;
25 uint16_t ops_supported[256];
26
27 int events_supported_length;
28 uint16_t events_supported[256];
29
30 int props_supported_length;
31 uint16_t props_supported[512];
32
33 int capture_formats_length;
34 uint16_t capture_formats[32];
35
36 int playback_formats_length;
37 uint16_t playback_formats[32];
38
39 char manufacturer[128];
40 char model[128];
41 char device_version[64];
42 char serial_number[128];
43};
44
46 uint16_t storage_type;
47 uint16_t fs_type;
48 uint16_t access_capability;
49 uint64_t max_capacity;
50 uint64_t free_space;
51 uint32_t free_objects;
52 char storage_desc[128];
53 char volume_identifier[128];
54};
55
57 uint32_t storage_id;
58 uint16_t obj_format;
59 uint16_t protection;
60 uint32_t compressed_size;
61 uint16_t thumb_format;
62 uint32_t thumb_compressed_size;
63 uint32_t thumb_width;
64 uint32_t thumb_height;
65 uint32_t img_width;
66 uint32_t img_height;
67 uint32_t img_bit_depth;
68 uint32_t parent_obj;
69 uint16_t assoc_type; // association
70 uint32_t assoc_desc;
71 uint32_t sequence_num;
72
73 char filename[64];
74 char date_created[32];
75 char date_modified[32];
76 char keywords[64];
77};
78
80 uint16_t length;
81 uint8_t data[];
82};
83
85 int min;
86 int max;
87 int step;
88};
89
91 uint16_t code;
92 uint16_t data_type;
93 uint8_t read_only; // (get/set)
94
95 // uint32_t variables will be used for all types <= 4 bytes
96 uint32_t default_value32;
97 uint32_t current_value32;
98 void *current_value;
99 void *default_value;
100
101 uint8_t form_type;
102 struct PtpRangeForm range_form;
103 struct PtpEnumerationForm *enum_form;
104};
105
107 uint32_t property_code;
108 uint32_t data_type;
109 uint8_t get_set;
110 uint32_t default_value;
111 uint32_t group_code;
112 uint32_t form_flag;
113 // mystery data type follows if form_flag == 0
114};
115
117 int type;
118 int code;
119 int value;
120 int def;
121};
122
124 uint32_t length;
125 uint32_t type;
126 // standard JPG follows
127};
128
130 uint32_t a;
131 uint32_t b;
132 uint32_t c;
133 uint32_t d;
134 uint32_t e;
135};
136
138 uint32_t lv_pitch;
139 uint32_t lv_width;
140 uint32_t lcd_palette[256];
141};
142
144 uint8_t digic;
145 uint8_t v1;
146 uint8_t v2;
147 uint8_t v3;
148};
149
150enum PtpMlBmpLvOption {
151 PTP_ML_BMP_LV_GET_FRAME = 0,
152 PTP_ML_BMP_LV_GET_SPEC = 1,
153};
154
155enum PtpCHDKCommands {
156 PTP_CHDK_Version = 0,
157 PTP_CHDK_UploadFile = 5,
158};
159
160int ptp_pack_object_info(struct PtpRuntime *r, struct PtpObjectInfo *oi, uint8_t *buf, int max);
161
162int ptp_parse_prop_value(struct PtpRuntime *r);
163int ptp_parse_device_info(struct PtpRuntime *r, struct PtpDeviceInfo *di);
164int ptp_device_info_json(const struct PtpDeviceInfo *di, char *buffer, int max);
165int ptp_parse_prop_desc(struct PtpRuntime *r, struct PtpPropDesc *oi);
166int ptp_prop_desc_json(const struct PtpPropDesc *pd, char *buffer, int max);
167int ptp_parse_object_info(struct PtpRuntime *r, struct PtpObjectInfo *oi);
168int ptp_storage_info_json(const struct PtpStorageInfo *so, char *buffer, int max);
169int ptp_object_info_json(const struct PtpObjectInfo *so, char *buffer, int max);
170int ptp_parse_storage_info(struct PtpRuntime *r, struct PtpStorageInfo *si);
171int ptp_eos_events(struct PtpRuntime *r, struct PtpGenericEvent **p);
172void *ptp_open_eos_events(struct PtpRuntime *r);
173void *ptp_get_eos_event(struct PtpRuntime *r, void *e, struct PtpCanonEvent *ce);
174
175int ptp_eos_events_json(struct PtpRuntime *r, char *buffer, int max);
176
177// Standard property value converters (conv.c)
178int ptp_eos_get_shutter(int data, int dir);
179int ptp_eos_get_iso(int data, int dir);
180int ptp_eos_get_aperture(int data, int dir);
181int ptp_eos_get_white_balance(int data, int dir);
182int ptp_eos_get_imgformat_value(uint32_t data[5]);
183
184void *ptp_pack_chdk_upload_file(struct PtpRuntime *r, char *in, char *out, int *length);
185
186#endif