Lines Matching refs:metadata
210 const camera_metadata_t *metadata) { in get_entries() argument
212 ((uint8_t*)metadata + metadata->entries_start); in get_entries()
215 static uint8_t *get_data(const camera_metadata_t *metadata) { in get_data() argument
216 return (uint8_t*)metadata + metadata->data_start; in get_data()
240 camera_metadata_t *metadata = (camera_metadata_t*) buffer; in allocate_copy_camera_metadata_checked() local
241 if (validate_camera_metadata_structure(metadata, &src_size) != OK) { in allocate_copy_camera_metadata_checked()
246 return metadata; in allocate_copy_camera_metadata_checked()
255 camera_metadata_t *metadata = place_camera_metadata( in allocate_camera_metadata() local
257 if (!metadata) { in allocate_camera_metadata()
263 return metadata; in allocate_camera_metadata()
280 camera_metadata_t *metadata = (camera_metadata_t*)dst; in place_camera_metadata() local
281 metadata->version = CURRENT_METADATA_VERSION; in place_camera_metadata()
282 metadata->flags = 0; in place_camera_metadata()
283 metadata->entry_count = 0; in place_camera_metadata()
284 metadata->entry_capacity = entry_capacity; in place_camera_metadata()
285 metadata->entries_start = in place_camera_metadata()
287 metadata->data_count = 0; in place_camera_metadata()
288 metadata->data_capacity = data_capacity; in place_camera_metadata()
289 metadata->size = memory_needed; in place_camera_metadata()
290 size_t data_unaligned = (uint8_t*)(get_entries(metadata) + in place_camera_metadata()
291 metadata->entry_capacity) - (uint8_t*)metadata; in place_camera_metadata()
292 metadata->data_start = ALIGN_TO(data_unaligned, DATA_ALIGNMENT); in place_camera_metadata()
293 metadata->vendor_id = CAMERA_METADATA_INVALID_VENDOR_ID; in place_camera_metadata()
295 assert(validate_camera_metadata_structure(metadata, NULL) == OK); in place_camera_metadata()
296 return metadata; in place_camera_metadata()
298 void free_camera_metadata(camera_metadata_t *metadata) { in free_camera_metadata() argument
299 free(metadata); in free_camera_metadata()
316 size_t get_camera_metadata_size(const camera_metadata_t *metadata) { in get_camera_metadata_size() argument
317 if (metadata == NULL) return ERROR; in get_camera_metadata_size()
319 return metadata->size; in get_camera_metadata_size()
322 size_t get_camera_metadata_compact_size(const camera_metadata_t *metadata) { in get_camera_metadata_compact_size() argument
323 if (metadata == NULL) return ERROR; in get_camera_metadata_compact_size()
325 return calculate_camera_metadata_size(metadata->entry_count, in get_camera_metadata_compact_size()
326 metadata->data_count); in get_camera_metadata_compact_size()
329 size_t get_camera_metadata_entry_count(const camera_metadata_t *metadata) { in get_camera_metadata_entry_count() argument
330 return metadata->entry_count; in get_camera_metadata_entry_count()
333 size_t get_camera_metadata_entry_capacity(const camera_metadata_t *metadata) { in get_camera_metadata_entry_capacity() argument
334 return metadata->entry_capacity; in get_camera_metadata_entry_capacity()
337 size_t get_camera_metadata_data_count(const camera_metadata_t *metadata) { in get_camera_metadata_data_count() argument
338 return metadata->data_count; in get_camera_metadata_data_count()
341 size_t get_camera_metadata_data_capacity(const camera_metadata_t *metadata) { in get_camera_metadata_data_capacity() argument
342 return metadata->data_capacity; in get_camera_metadata_data_capacity()
356 camera_metadata_t *metadata = in copy_camera_metadata() local
359 metadata->flags = src->flags; in copy_camera_metadata()
360 metadata->entry_count = src->entry_count; in copy_camera_metadata()
361 metadata->data_count = src->data_count; in copy_camera_metadata()
362 metadata->vendor_id = src->vendor_id; in copy_camera_metadata()
364 memcpy(get_entries(metadata), get_entries(src), in copy_camera_metadata()
365 sizeof(camera_metadata_buffer_entry_t[metadata->entry_count])); in copy_camera_metadata()
366 memcpy(get_data(metadata), get_data(src), in copy_camera_metadata()
367 sizeof(uint8_t[metadata->data_count])); in copy_camera_metadata()
369 assert(validate_camera_metadata_structure(metadata, NULL) == OK); in copy_camera_metadata()
370 return metadata; in copy_camera_metadata()
405 int validate_camera_metadata_structure(const camera_metadata_t *metadata, in validate_camera_metadata_structure() argument
408 if (metadata == NULL) { in validate_camera_metadata_structure()
413 uintptr_t aligned_ptr = ALIGN_TO(metadata, METADATA_PACKET_ALIGNMENT); in validate_camera_metadata_structure()
414 const uintptr_t alignmentOffset = aligned_ptr - (uintptr_t) metadata; in validate_camera_metadata_structure()
437 uintptr_t aligned_ptr_section = ALIGN_TO((uintptr_t) metadata + alignmentOffset, in validate_camera_metadata_structure()
440 if ((uintptr_t)metadata + alignmentOffset != aligned_ptr_section) { in validate_camera_metadata_structure()
443 __FUNCTION__, metadata, in validate_camera_metadata_structure()
463 memcpy(&headerCopy, metadata, sizeof(camera_metadata_t)); in validate_camera_metadata_structure()
466 header = metadata; in validate_camera_metadata_structure()
518 camera_metadata_buffer_entry_t *entries = get_entries(metadata); in validate_camera_metadata_structure()
563 (camera_metadata_data_t*) (get_data(metadata) + in validate_camera_metadata_structure()
571 get_local_camera_metadata_tag_name(entry.tag, metadata) ? in validate_camera_metadata_structure()
578 data_entry_end > metadata->data_capacity) { in validate_camera_metadata_structure()
582 metadata->data_capacity); in validate_camera_metadata_structure()
590 get_local_camera_metadata_tag_name(entry.tag, metadata) ? : "unknown"); in validate_camera_metadata_structure()
1082 void dump_camera_metadata(const camera_metadata_t *metadata, in dump_camera_metadata() argument
1085 dump_indented_camera_metadata(metadata, fd, verbosity, 0); in dump_camera_metadata()
1088 void dump_indented_camera_metadata(const camera_metadata_t *metadata, in dump_indented_camera_metadata() argument
1092 if (metadata == NULL) { in dump_indented_camera_metadata()
1101 metadata->entry_count, metadata->entry_capacity, in dump_indented_camera_metadata()
1102 metadata->data_count, metadata->data_capacity); in dump_indented_camera_metadata()
1105 metadata->version, metadata->flags); in dump_indented_camera_metadata()
1106 camera_metadata_buffer_entry_t *entry = get_entries(metadata); in dump_indented_camera_metadata()
1107 for (i=0; i < metadata->entry_count; i++, entry++) { in dump_indented_camera_metadata()
1110 tag_section = get_local_camera_metadata_section_name(entry->tag, metadata); in dump_indented_camera_metadata()
1114 tag_name = get_local_camera_metadata_tag_name(entry->tag, metadata); in dump_indented_camera_metadata()
1139 if (entry->data.offset >= metadata->data_count) { in dump_indented_camera_metadata()
1143 metadata->data_count); in dump_indented_camera_metadata()
1146 data_ptr = get_data(metadata) + entry->data.offset; in dump_indented_camera_metadata()