• Home
  • Raw
  • Download

Lines Matching refs:metadata

157         const camera_metadata_t *metadata) {  in get_entries()  argument
159 ((uint8_t*)metadata + metadata->entries_start); in get_entries()
162 static uint8_t *get_data(const camera_metadata_t *metadata) { in get_data() argument
163 return (uint8_t*)metadata + metadata->data_start; in get_data()
177 camera_metadata_t *metadata = (camera_metadata_t*) buffer; in allocate_copy_camera_metadata_checked() local
178 if (validate_camera_metadata_structure(metadata, &src_size) != OK) { in allocate_copy_camera_metadata_checked()
183 return metadata; in allocate_copy_camera_metadata_checked()
209 camera_metadata_t *metadata = (camera_metadata_t*)dst; in place_camera_metadata() local
210 metadata->version = CURRENT_METADATA_VERSION; in place_camera_metadata()
211 metadata->flags = 0; in place_camera_metadata()
212 metadata->entry_count = 0; in place_camera_metadata()
213 metadata->entry_capacity = entry_capacity; in place_camera_metadata()
214 metadata->entries_start = in place_camera_metadata()
216 metadata->data_count = 0; in place_camera_metadata()
217 metadata->data_capacity = data_capacity; in place_camera_metadata()
218 metadata->size = memory_needed; in place_camera_metadata()
219 size_t data_unaligned = (uint8_t*)(get_entries(metadata) + in place_camera_metadata()
220 metadata->entry_capacity) - (uint8_t*)metadata; in place_camera_metadata()
221 metadata->data_start = ALIGN_TO(data_unaligned, DATA_ALIGNMENT); in place_camera_metadata()
222 metadata->user = NULL; in place_camera_metadata()
224 return metadata; in place_camera_metadata()
226 void free_camera_metadata(camera_metadata_t *metadata) { in free_camera_metadata() argument
227 free(metadata); in free_camera_metadata()
242 size_t get_camera_metadata_size(const camera_metadata_t *metadata) { in get_camera_metadata_size() argument
243 if (metadata == NULL) return ERROR; in get_camera_metadata_size()
245 return metadata->size; in get_camera_metadata_size()
248 size_t get_camera_metadata_compact_size(const camera_metadata_t *metadata) { in get_camera_metadata_compact_size() argument
249 if (metadata == NULL) return ERROR; in get_camera_metadata_compact_size()
251 return calculate_camera_metadata_size(metadata->entry_count, in get_camera_metadata_compact_size()
252 metadata->data_count); in get_camera_metadata_compact_size()
255 size_t get_camera_metadata_entry_count(const camera_metadata_t *metadata) { in get_camera_metadata_entry_count() argument
256 return metadata->entry_count; in get_camera_metadata_entry_count()
259 size_t get_camera_metadata_entry_capacity(const camera_metadata_t *metadata) { in get_camera_metadata_entry_capacity() argument
260 return metadata->entry_capacity; in get_camera_metadata_entry_capacity()
263 size_t get_camera_metadata_data_count(const camera_metadata_t *metadata) { in get_camera_metadata_data_count() argument
264 return metadata->data_count; in get_camera_metadata_data_count()
267 size_t get_camera_metadata_data_capacity(const camera_metadata_t *metadata) { in get_camera_metadata_data_capacity() argument
268 return metadata->data_capacity; in get_camera_metadata_data_capacity()
278 camera_metadata_t *metadata = in copy_camera_metadata() local
281 metadata->flags = src->flags; in copy_camera_metadata()
282 metadata->entry_count = src->entry_count; in copy_camera_metadata()
283 metadata->data_count = src->data_count; in copy_camera_metadata()
285 memcpy(get_entries(metadata), get_entries(src), in copy_camera_metadata()
286 sizeof(camera_metadata_buffer_entry_t[metadata->entry_count])); in copy_camera_metadata()
287 memcpy(get_data(metadata), get_data(src), in copy_camera_metadata()
288 sizeof(uint8_t[metadata->data_count])); in copy_camera_metadata()
289 metadata->user = NULL; in copy_camera_metadata()
291 return metadata; in copy_camera_metadata()
294 int validate_camera_metadata_structure(const camera_metadata_t *metadata, in validate_camera_metadata_structure() argument
297 if (metadata == NULL) { in validate_camera_metadata_structure()
322 uintptr_t aligned_ptr = ALIGN_TO(metadata, alignments[i].alignment); in validate_camera_metadata_structure()
324 if ((uintptr_t)metadata != aligned_ptr) { in validate_camera_metadata_structure()
327 __FUNCTION__, metadata, in validate_camera_metadata_structure()
338 if (expected_size != NULL && metadata->size > *expected_size) { in validate_camera_metadata_structure()
340 __FUNCTION__, metadata->size, *expected_size); in validate_camera_metadata_structure()
344 if (metadata->entry_count > metadata->entry_capacity) { in validate_camera_metadata_structure()
346 __FUNCTION__, metadata->entry_count, metadata->entry_capacity); in validate_camera_metadata_structure()
350 uptrdiff_t entries_end = metadata->entries_start + metadata->entry_capacity; in validate_camera_metadata_structure()
351 if (entries_end < metadata->entries_start || // overflow check in validate_camera_metadata_structure()
352 entries_end > metadata->data_start) { in validate_camera_metadata_structure()
356 (metadata->entries_start + metadata->entry_capacity), in validate_camera_metadata_structure()
357 metadata->data_start); in validate_camera_metadata_structure()
361 uptrdiff_t data_end = metadata->data_start + metadata->data_capacity; in validate_camera_metadata_structure()
362 if (data_end < metadata->data_start || // overflow check in validate_camera_metadata_structure()
363 data_end > metadata->size) { in validate_camera_metadata_structure()
367 (metadata->data_start + metadata->data_capacity), in validate_camera_metadata_structure()
368 metadata->size); in validate_camera_metadata_structure()
373 size_t entry_count = metadata->entry_count; in validate_camera_metadata_structure()
374 camera_metadata_buffer_entry_t *entries = get_entries(metadata); in validate_camera_metadata_structure()
409 (camera_metadata_data_t*) (get_data(metadata) + in validate_camera_metadata_structure()
423 data_entry_end > metadata->data_capacity) { in validate_camera_metadata_structure()
427 metadata->data_capacity); in validate_camera_metadata_structure()
816 void dump_camera_metadata(const camera_metadata_t *metadata, in dump_camera_metadata() argument
819 dump_indented_camera_metadata(metadata, fd, verbosity, 0); in dump_camera_metadata()
822 void dump_indented_camera_metadata(const camera_metadata_t *metadata, in dump_indented_camera_metadata() argument
826 if (metadata == NULL) { in dump_indented_camera_metadata()
835 metadata->entry_count, metadata->entry_capacity, in dump_indented_camera_metadata()
836 metadata->data_count, metadata->data_capacity); in dump_indented_camera_metadata()
839 metadata->version, metadata->flags); in dump_indented_camera_metadata()
840 camera_metadata_buffer_entry_t *entry = get_entries(metadata); in dump_indented_camera_metadata()
841 for (i=0; i < metadata->entry_count; i++, entry++) { in dump_indented_camera_metadata()
873 if (entry->data.offset >= metadata->data_count) { in dump_indented_camera_metadata()
877 metadata->data_count); in dump_indented_camera_metadata()
880 data_ptr = get_data(metadata) + entry->data.offset; in dump_indented_camera_metadata()