Lines Matching refs:entry
32 void MetadataUtils::WriteMetadataDataToVec(const camera_metadata_item_t &entry, std::vector<uint8_t… in WriteMetadataDataToVec() argument
34 if (entry.data_type == META_TYPE_BYTE) { in WriteMetadataDataToVec()
35 for (size_t i = 0; i < entry.count; i++) { in WriteMetadataDataToVec()
36 WriteData<int8_t>(*(entry.data.u8 + i), cameraAbility); in WriteMetadataDataToVec()
38 } else if (entry.data_type == META_TYPE_INT32) { in WriteMetadataDataToVec()
39 for (size_t i = 0; i < entry.count; i++) { in WriteMetadataDataToVec()
40 WriteData<int32_t>(*(entry.data.i32 + i), cameraAbility); in WriteMetadataDataToVec()
42 } else if (entry.data_type == META_TYPE_FLOAT) { in WriteMetadataDataToVec()
43 for (size_t i = 0; i < entry.count; i++) { in WriteMetadataDataToVec()
44 WriteData<float>(*(entry.data.f + i), cameraAbility); in WriteMetadataDataToVec()
46 } else if (entry.data_type == META_TYPE_INT64) { in WriteMetadataDataToVec()
47 for (size_t i = 0; i < entry.count; i++) { in WriteMetadataDataToVec()
48 WriteData<int64_t>(*(entry.data.i64 + i), cameraAbility); in WriteMetadataDataToVec()
50 } else if (entry.data_type == META_TYPE_DOUBLE) { in WriteMetadataDataToVec()
51 for (size_t i = 0; i < entry.count; i++) { in WriteMetadataDataToVec()
52 WriteData<double>(*(entry.data.d + i), cameraAbility); in WriteMetadataDataToVec()
54 } else if (entry.data_type == META_TYPE_RATIONAL) { in WriteMetadataDataToVec()
55 for (size_t i = 0; i < entry.count; i++) { in WriteMetadataDataToVec()
56 WriteData<int32_t>((*(entry.data.r + i)).numerator, cameraAbility); in WriteMetadataDataToVec()
57 WriteData<int32_t>((*(entry.data.r + i)).denominator, cameraAbility); in WriteMetadataDataToVec()
154 void MetadataUtils::ReadMetadataDataFromVec(int32_t &index, camera_metadata_item_t &entry, in ReadMetadataDataFromVec() argument
157 if (entry.data_type == META_TYPE_BYTE) { in ReadMetadataDataFromVec()
158 entry.data.u8 = new(std::nothrow) uint8_t[entry.count]; in ReadMetadataDataFromVec()
159 if (entry.data.u8 != nullptr) { in ReadMetadataDataFromVec()
160 for (size_t i = 0; i < entry.count; i++) { in ReadMetadataDataFromVec()
161 ReadData<uint8_t>(entry.data.u8[i], index, cameraAbility); in ReadMetadataDataFromVec()
164 } else if (entry.data_type == META_TYPE_INT32) { in ReadMetadataDataFromVec()
165 entry.data.i32 = new(std::nothrow) int32_t[entry.count]; in ReadMetadataDataFromVec()
166 if (entry.data.i32 != nullptr) { in ReadMetadataDataFromVec()
167 for (size_t i = 0; i < entry.count; i++) { in ReadMetadataDataFromVec()
168 ReadData<int32_t>(entry.data.i32[i], index, cameraAbility); in ReadMetadataDataFromVec()
171 } else if (entry.data_type == META_TYPE_FLOAT) { in ReadMetadataDataFromVec()
172 entry.data.f = new(std::nothrow) float[entry.count]; in ReadMetadataDataFromVec()
173 if (entry.data.f != nullptr) { in ReadMetadataDataFromVec()
174 for (size_t i = 0; i < entry.count; i++) { in ReadMetadataDataFromVec()
175 ReadData<float>(entry.data.f[i], index, cameraAbility); in ReadMetadataDataFromVec()
178 } else if (entry.data_type == META_TYPE_INT64) { in ReadMetadataDataFromVec()
179 entry.data.i64 = new(std::nothrow) int64_t[entry.count]; in ReadMetadataDataFromVec()
180 if (entry.data.i64 != nullptr) { in ReadMetadataDataFromVec()
181 for (size_t i = 0; i < entry.count; i++) { in ReadMetadataDataFromVec()
182 ReadData<int64_t>(entry.data.i64[i], index, cameraAbility); in ReadMetadataDataFromVec()
185 } else if (entry.data_type == META_TYPE_DOUBLE) { in ReadMetadataDataFromVec()
186 entry.data.d = new(std::nothrow) double[entry.count]; in ReadMetadataDataFromVec()
187 if (entry.data.d != nullptr) { in ReadMetadataDataFromVec()
188 for (size_t i = 0; i < entry.count; i++) { in ReadMetadataDataFromVec()
189 ReadData<double>(entry.data.d[i], index, cameraAbility); in ReadMetadataDataFromVec()
192 } else if (entry.data_type == META_TYPE_RATIONAL) { in ReadMetadataDataFromVec()
193 entry.data.r = new(std::nothrow) camera_rational_t[entry.count]; in ReadMetadataDataFromVec()
194 if (entry.data.r != nullptr) { in ReadMetadataDataFromVec()
195 for (size_t i = 0; i < entry.count; i++) { in ReadMetadataDataFromVec()
196 ReadData<int32_t>(entry.data.r[i].numerator, index, cameraAbility); in ReadMetadataDataFromVec()
197 ReadData<int32_t>(entry.data.r[i].denominator, index, cameraAbility); in ReadMetadataDataFromVec()
468 static void ReadMetadataUInt8(camera_metadata_item_t &entry, MessageParcel &data) in ReadMetadataUInt8() argument
472 entry.data.u8 = new(std::nothrow) uint8_t[entry.count]; in ReadMetadataUInt8()
473 if (entry.data.u8 != nullptr) { in ReadMetadataUInt8()
474 for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { in ReadMetadataUInt8()
475 entry.data.u8[i] = buffers.at(i); in ReadMetadataUInt8()
480 static void ReadMetadataInt32(camera_metadata_item_t &entry, MessageParcel &data) in ReadMetadataInt32() argument
484 entry.data.i32 = new(std::nothrow) int32_t[entry.count]; in ReadMetadataInt32()
485 if (entry.data.i32 != nullptr) { in ReadMetadataInt32()
486 for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { in ReadMetadataInt32()
487 entry.data.i32[i] = buffers.at(i); in ReadMetadataInt32()
492 static void ReadMetadataUInt32(camera_metadata_item_t &entry, MessageParcel &data) in ReadMetadataUInt32() argument
496 entry.data.ui32 = new(std::nothrow) uint32_t[entry.count]; in ReadMetadataUInt32()
497 if (entry.data.ui32 != nullptr) { in ReadMetadataUInt32()
498 for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { in ReadMetadataUInt32()
499 entry.data.ui32[i] = buffers.at(i); in ReadMetadataUInt32()
504 static void ReadMetadataFloat(camera_metadata_item_t &entry, MessageParcel &data) in ReadMetadataFloat() argument
508 entry.data.f = new(std::nothrow) float[entry.count]; in ReadMetadataFloat()
509 if (entry.data.f != nullptr) { in ReadMetadataFloat()
510 for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { in ReadMetadataFloat()
511 entry.data.f[i] = buffers.at(i); in ReadMetadataFloat()
516 static void ReadMetadataInt64(camera_metadata_item_t &entry, MessageParcel &data) in ReadMetadataInt64() argument
520 entry.data.i64 = new(std::nothrow) int64_t[entry.count]; in ReadMetadataInt64()
521 if (entry.data.i64 != nullptr) { in ReadMetadataInt64()
522 for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { in ReadMetadataInt64()
523 entry.data.i64[i] = buffers.at(i); in ReadMetadataInt64()
528 static void ReadMetadataDouble(camera_metadata_item_t &entry, MessageParcel &data) in ReadMetadataDouble() argument
532 entry.data.d = new(std::nothrow) double[entry.count]; in ReadMetadataDouble()
533 if (entry.data.d != nullptr) { in ReadMetadataDouble()
534 for (size_t i = 0; i < entry.count && i < buffers.size(); i++) { in ReadMetadataDouble()
535 entry.data.d[i] = buffers.at(i); in ReadMetadataDouble()
540 static void ReadMetadataRational(camera_metadata_item_t &entry, MessageParcel &data) in ReadMetadataRational() argument
544 entry.data.r = new(std::nothrow) camera_rational_t[entry.count]; in ReadMetadataRational()
545 if (entry.data.r != nullptr) { in ReadMetadataRational()
547 i < entry.count && j < static_cast<size_t>(buffers.size() - 1); in ReadMetadataRational()
549 entry.data.r[i].numerator = buffers.at(j); in ReadMetadataRational()
550 entry.data.r[i].denominator = buffers.at(j + 1); in ReadMetadataRational()
554 bool MetadataUtils::ReadMetadata(camera_metadata_item_t &entry, MessageParcel &data) in ReadMetadata() argument
556 if (entry.count > MAX_SUPPORTED_ITEMS) { in ReadMetadata()
557 entry.count = MAX_SUPPORTED_ITEMS; in ReadMetadata()
560 switch (entry.data_type) { in ReadMetadata()
562 ReadMetadataUInt8(entry, data); in ReadMetadata()
565 ReadMetadataInt32(entry, data); in ReadMetadata()
568 ReadMetadataUInt32(entry, data); in ReadMetadata()
571 ReadMetadataFloat(entry, data); in ReadMetadata()
574 ReadMetadataInt64(entry, data); in ReadMetadata()
577 ReadMetadataDouble(entry, data); in ReadMetadata()
580 ReadMetadataRational(entry, data); in ReadMetadata()
609 void MetadataUtils::FreeMetadataBuffer(camera_metadata_item_t &entry) in FreeMetadataBuffer() argument
611 if (entry.data_type == META_TYPE_BYTE) { in FreeMetadataBuffer()
612 if (entry.data.u8 != nullptr) { in FreeMetadataBuffer()
613 delete[] entry.data.u8; in FreeMetadataBuffer()
615 } else if (entry.data_type == META_TYPE_INT32) { in FreeMetadataBuffer()
616 if (entry.data.i32 != nullptr) { in FreeMetadataBuffer()
617 delete[] entry.data.i32; in FreeMetadataBuffer()
619 } else if (entry.data_type == META_TYPE_FLOAT) { in FreeMetadataBuffer()
620 if (entry.data.f != nullptr) { in FreeMetadataBuffer()
621 delete[] entry.data.f; in FreeMetadataBuffer()
623 } else if (entry.data_type == META_TYPE_INT64) { in FreeMetadataBuffer()
624 if (entry.data.i64 != nullptr) { in FreeMetadataBuffer()
625 delete[] entry.data.i64; in FreeMetadataBuffer()
627 } else if (entry.data_type == META_TYPE_UINT32) { in FreeMetadataBuffer()
628 if (entry.data.ui32 != nullptr) { in FreeMetadataBuffer()
629 delete[] entry.data.ui32; in FreeMetadataBuffer()
631 } else if (entry.data_type == META_TYPE_DOUBLE) { in FreeMetadataBuffer()
632 if (entry.data.d != nullptr) { in FreeMetadataBuffer()
633 delete[] entry.data.d; in FreeMetadataBuffer()
635 } else if (entry.data_type == META_TYPE_RATIONAL) { in FreeMetadataBuffer()
636 if (entry.data.r != nullptr) { in FreeMetadataBuffer()
637 delete[] entry.data.r; in FreeMetadataBuffer()