internal override void NewFrameCallback(VarjoStreamFrame streamData, IntPtr userdata)
        {
            lock (mutex)
            {
                Debug.Assert(streamData.type == StreamType);
                data = streamData.metadata.distortedColorData;

                long leftBufferId = 0;
                if (!VarjoMixedReality.GetDataStreamBufferId(streamData.id, streamData.frameNumber, 0 /* varjo_ChannelIndex_Left */, out leftBufferId))
                {
                    Debug.LogErrorFormat("Failed to get distorted color left buffer id {0}", streamData.frameNumber);
                    return;
                }

                long rightBufferId = 0;
                if (!VarjoMixedReality.GetDataStreamBufferId(streamData.id, streamData.frameNumber, 1 /* varjo_ChannelIndex_Right */, out rightBufferId))
                {
                    Debug.LogErrorFormat("Failed to get distorted color right buffer id {0}", streamData.frameNumber);
                    return;
                }

                leftBuffer.UpdateBuffer(leftBufferId);
                rightBuffer.UpdateBuffer(rightBufferId);
            }
        }
 internal override void NewFrameCallback(VarjoStreamFrame streamData, IntPtr userdata)
 {
     lock (mutex)
     {
         Debug.Assert(streamData.type == VarjoStreamType.DistortedColor);
         data = streamData.metadata.distortedColorData;
     }
 }
        internal VarjoCameraMetadata(VarjoDistortedColorData distortedColorData)
        {
            data                    = distortedColorData;
            ev                      = data.ev;
            exposureTime            = data.exposureTime;
            whiteBalanceTemperature = data.whiteBalanceTemperature;
            wbNormalizationData     = new VarjoWBNormalizationData();

            if (data.wbNormalizationData.wbGains != null)
            {
                wbNormalizationData.wbGains = new Color(
                    (float)data.wbNormalizationData.wbGains[0],
                    (float)data.wbNormalizationData.wbGains[1],
                    (float)data.wbNormalizationData.wbGains[2]
                    );
            }

            if (data.wbNormalizationData.invCCM != null)
            {
                wbNormalizationData.invCCM = new Matrix4x4(
                    new Vector4(
                        (float)data.wbNormalizationData.invCCM[0],
                        (float)data.wbNormalizationData.invCCM[1],
                        (float)data.wbNormalizationData.invCCM[2],
                        0.0f),
                    new Vector4(
                        (float)data.wbNormalizationData.invCCM[3],
                        (float)data.wbNormalizationData.invCCM[4],
                        (float)data.wbNormalizationData.invCCM[5],
                        0.0f),
                    new Vector4(
                        (float)data.wbNormalizationData.invCCM[6],
                        (float)data.wbNormalizationData.invCCM[7],
                        (float)data.wbNormalizationData.invCCM[8],
                        0.0f),
                    new Vector4(0.0f, 0.0f, 0.0f, 1.0f)
                    );
            }

            if (data.wbNormalizationData.ccm != null)
            {
                wbNormalizationData.ccm = new Matrix4x4(
                    new Vector4(
                        (float)data.wbNormalizationData.ccm[0],
                        (float)data.wbNormalizationData.ccm[1],
                        (float)data.wbNormalizationData.ccm[2],
                        0.0f),
                    new Vector4(
                        (float)data.wbNormalizationData.ccm[3],
                        (float)data.wbNormalizationData.ccm[4],
                        (float)data.wbNormalizationData.ccm[5],
                        0.0f),
                    new Vector4(
                        (float)data.wbNormalizationData.ccm[6],
                        (float)data.wbNormalizationData.ccm[7],
                        (float)data.wbNormalizationData.ccm[8],
                        0.0f),
                    new Vector4(0.0f, 0.0f, 0.0f, 1.0f)
                    );
            }

            cameraCalibrationConstant = data.cameraCalibrationConstant;
        }