public void GetValues(IntPtr cameraMetadataHandle,
                              ARCameraMetadataTag tag, List <ARCameraMetadataValue> resultList)
        {
            IntPtr ndkMetadataHandle = IntPtr.Zero;

            NDKAPI.HwArImageMetadata_getNdkCameraMetadata(m_ndkSession.SessionHandle,
                                                          cameraMetadataHandle, ref ndkMetadataHandle);

            resultList.Clear();
            NdkCameraMetadata entry  = new NdkCameraMetadata();
            NdkCameraStatus   status = NDKAPI.ACameraMetadata_getConstEntry(ndkMetadataHandle, tag, ref entry);

            if (status != NdkCameraStatus.Ok)
            {
                ARDebug.LogError("ACameraMetadata_getConstEntry error with native camera error code: {0}",
                                 status);
                return;
            }

            for (int i = 0; i < entry.Count; i++)
            {
                switch (entry.Type)
                {
                case NdkCameraMetadataType.Byte:
                    sbyte byteValue = MarshalingHelper.GetValueOfUnmanagedArrayElement <sbyte>(entry.Value, i);
                    resultList.Add(new ARCameraMetadataValue(byteValue));
                    break;

                case NdkCameraMetadataType.Int32:
                    int intValue = MarshalingHelper.GetValueOfUnmanagedArrayElement <int>(entry.Value, i);
                    resultList.Add(new ARCameraMetadataValue(intValue));
                    break;

                case NdkCameraMetadataType.Float:
                    float floatValue = MarshalingHelper.GetValueOfUnmanagedArrayElement <float>(entry.Value, i);
                    resultList.Add(new ARCameraMetadataValue(floatValue));
                    break;

                case NdkCameraMetadataType.Int64:
                    long longValue = MarshalingHelper.GetValueOfUnmanagedArrayElement <long>(entry.Value, i);
                    resultList.Add(new ARCameraMetadataValue(longValue));
                    break;

                case NdkCameraMetadataType.Double:
                    double doubleValue = MarshalingHelper.GetValueOfUnmanagedArrayElement <double>(entry.Value, i);
                    resultList.Add(new ARCameraMetadataValue(doubleValue));
                    break;

                case NdkCameraMetadataType.Rational:
                    ARCameraMetadataRational rationalValue = MarshalingHelper.GetValueOfUnmanagedArrayElement <
                        ARCameraMetadataRational>(entry.Value, i);
                    resultList.Add(new ARCameraMetadataValue(rationalValue));
                    break;

                default:
                    return;
                }
            }
        }
 public static extern NdkCameraStatus ACameraMetadata_getConstEntry(IntPtr ndkCameraMetadata,
                                                                    ARCameraMetadataTag tag, ref NdkCameraMetadata entry);