Lines Matching refs:entry
33 // Align entry buffers as the compiler would
44 * A single metadata entry, storing an array of values of a given type. If the
233 // Start entry list at aligned boundary
345 ALOGE("%s: Entry count (%u) should be <= entry capacity (%u)",
354 ALOGE("%s: Entry start + capacity (%u) should be <= data start (%u)",
372 // Validate each entry
379 ALOGE("%s: Entry index %u had bad alignment (address %p),"
385 camera_metadata_buffer_entry_t entry = entries[i];
387 if (entry.type >= NUM_TYPES) {
388 ALOGE("%s: Entry index %u had a bad type %d",
389 __FUNCTION__, i, entry.type);
395 uint32_t tag_section = entry.tag >> 16;
396 int tag_type = get_camera_metadata_tag_type(entry.tag);
397 if (tag_type != (int)entry.type && tag_section < VENDOR_SECTION) {
398 ALOGE("%s: Entry index %u had tag type %d, but the type was %d",
399 __FUNCTION__, i, tag_type, entry.type);
404 calculate_camera_metadata_entry_data_size(entry.type,
405 entry.count);
410 entry.data.offset);
413 ALOGE("%s: Entry index %u had bad data alignment (address %p),"
416 get_camera_metadata_tag_name(entry.tag) ?: "unknown",
421 size_t data_entry_end = entry.data.offset + data_size;
422 if (data_entry_end < entry.data.offset || // overflow check
425 ALOGE("%s: Entry index %u data ends (%u) beyond the capacity "
431 } else if (entry.count == 0) {
432 if (entry.data.offset != 0) {
433 ALOGE("%s: Entry index %u had 0 items, but offset was non-0 "
434 "(%u), tag name: %s", __FUNCTION__, i, entry.data.offset,
435 get_camera_metadata_tag_name(entry.tag) ?: "unknown");
456 camera_metadata_buffer_entry_t *entry = get_entries(dst) + dst->entry_count;
457 for (size_t i = 0; i < src->entry_count; i++, entry++) {
458 entry->type,
459 entry->count) > 0 ) {
460 entry->data.offset += dst->data_count;
519 camera_metadata_buffer_entry_t *entry = get_entries(dst) + dst->entry_count;
520 memset(entry, 0, sizeof(camera_metadata_buffer_entry_t));
521 entry->tag = tag;
522 entry->type = type;
523 entry->count = data_count;
526 memcpy(entry->data.value, data,
529 entry->data.offset = dst->data_count;
530 memcpy(get_data(dst) + entry->data.offset, data,
579 camera_metadata_entry_t *entry) {
580 if (src == NULL || entry == NULL) return ERROR;
585 entry->index = index;
586 entry->tag = buffer_entry->tag;
587 entry->type = buffer_entry->type;
588 entry->count = buffer_entry->count;
591 entry->data.u8 = get_data(src) + buffer_entry->data.offset;
593 entry->data.u8 = buffer_entry->data.value;
600 camera_metadata_entry_t *entry) {
628 entry);
633 camera_metadata_ro_entry_t *entry) {
635 (camera_metadata_entry_t*)entry);
644 camera_metadata_buffer_entry_t *entry = get_entries(dst) + index;
645 size_t data_bytes = calculate_camera_metadata_entry_data_size(entry->type,
646 entry->count);
650 uint8_t *start = get_data(dst) + entry->data.offset;
652 size_t length = dst->data_count - entry->data.offset - data_bytes;
655 // Update all entry indices to account for shift
661 e->data.offset > entry->data.offset) {
668 // Shift entry array
669 memmove(entry, entry + 1,
685 camera_metadata_buffer_entry_t *entry = get_entries(dst) + index;
688 calculate_camera_metadata_entry_data_size(entry->type,
691 data_count * camera_metadata_type_size[entry->type];
694 calculate_camera_metadata_entry_data_size(entry->type,
695 entry->count);
704 uint8_t *start = get_data(dst) + entry->data.offset;
706 size_t length = dst->data_count - entry->data.offset - entry_bytes;
710 // Update all entry indices to account for shift
716 e->data.offset > entry->data.offset) {
725 entry->data.offset = dst->data_count;
727 memcpy(get_data(dst) + entry->data.offset, data, data_payload_bytes);
732 memcpy(get_data(dst) + entry->data.offset, data, data_payload_bytes);
736 // Data fits into entry
737 memcpy(entry->data.value, data,
741 entry->count = data_count;
842 camera_metadata_buffer_entry_t *entry = get_entries(metadata);
843 for (i=0; i < metadata->entry_count; i++, entry++) {
846 tag_section = get_camera_metadata_section_name(entry->tag);
850 tag_name = get_camera_metadata_tag_name(entry->tag);
855 if (entry->type >= NUM_TYPES) {
858 type_name = camera_metadata_type_names[entry->type];
864 entry->tag,
866 entry->count);
870 if (entry->type >= NUM_TYPES) continue;
872 size_t type_size = camera_metadata_type_size[entry->type];
874 if ( type_size * entry->count > 4 ) {
875 if (entry->data.offset >= metadata->data_count) {
876 ALOGE("%s: Malformed entry data offset: %d (max %d)",
878 entry->data.offset,
882 data_ptr = get_data(metadata) + entry->data.offset;
884 data_ptr = entry->data.value;
886 int count = entry->count;
889 print_data(fd, data_ptr, entry->tag, entry->type, count, indentation);