Lines Matching defs:metadata
27 * A single metadata entry, storing an array of values of a given type. If the
44 * A packet of metadata. This is a list of entries, each of which may point to
74 * In short, the entries and data are contiguous in memory after the metadata
143 camera_metadata_t *metadata = (camera_metadata_t*)dst;
144 metadata->version = CURRENT_METADATA_VERSION;
145 metadata->flags = 0;
146 metadata->entry_count = 0;
147 metadata->entry_capacity = entry_capacity;
148 metadata->entries = (camera_metadata_entry_t*)(metadata + 1);
149 metadata->data_count = 0;
150 metadata->data_capacity = data_capacity;
151 metadata->size = memory_needed;
152 if (metadata->data_capacity != 0) {
153 metadata->data =
154 (uint8_t*)(metadata->entries + metadata->entry_capacity);
156 metadata->data = NULL;
159 return metadata;
161 void free_camera_metadata(camera_metadata_t *metadata) {
162 free(metadata);
173 size_t get_camera_metadata_size(const camera_metadata_t *metadata) {
174 if (metadata == NULL) return ERROR;
176 return metadata->size;
179 size_t get_camera_metadata_compact_size(const camera_metadata_t *metadata) {
180 if (metadata == NULL) return ERROR;
182 ptrdiff_t reserved_size = metadata->size -
183 calculate_camera_metadata_size(metadata->entry_capacity,
184 metadata->data_capacity);
186 return calculate_camera_metadata_size(metadata->entry_count,
187 metadata->data_count) + reserved_size;
190 size_t get_camera_metadata_entry_count(const camera_metadata_t *metadata) {
191 return metadata->entry_count;
194 size_t get_camera_metadata_entry_capacity(const camera_metadata_t *metadata) {
195 return metadata->entry_capacity;
198 size_t get_camera_metadata_data_count(const camera_metadata_t *metadata) {
199 return metadata->data_count;
202 size_t get_camera_metadata_data_capacity(const camera_metadata_t *metadata) {
203 return metadata->data_capacity;
219 camera_metadata_t *metadata = (camera_metadata_t*)dst;
220 metadata->version = CURRENT_METADATA_VERSION;
221 metadata->flags = src->flags;
222 metadata->entry_count = src->entry_count;
223 metadata->entry_capacity = src->entry_count;
224 metadata->entries = (camera_metadata_entry_t*)
225 ((uint8_t *)(metadata + 1) + reserved_size);
226 metadata->data_count = src->data_count;
227 metadata->data_capacity = src->data_count;
228 metadata->data = (uint8_t *)(metadata->entries + metadata->entry_capacity);
229 metadata->size = memory_needed;
232 memcpy(metadata->reserved, src->reserved, reserved_size);
234 memcpy(metadata->entries, src->entries,
235 sizeof(camera_metadata_entry_t[metadata->entry_count]));
236 memcpy(metadata->data, src->data,
237 sizeof(uint8_t[metadata->data_count]));
239 return metadata;
465 void dump_camera_metadata(const camera_metadata_t *metadata,
468 if (metadata == NULL) {
469 ALOGE("%s: Metadata is null.", __FUNCTION__);
474 "Dumping camera metadata array. %d entries, "
476 metadata->entry_count, metadata->data_count);
478 metadata->entry_capacity, metadata->data_capacity);
480 metadata->version, metadata->flags);
481 for (i=0; i < metadata->entry_count; i++) {
482 camera_metadata_entry_t *entry = metadata->entries + i;
513 if (entry->data.offset >= metadata->data_count) {
517 metadata->data_count);
520 data_ptr = metadata->data + entry->data.offset;