Exemple #1
0
    private void Update()
    {
        if (!videoUpdateStarted)
        {
            return;
        }

        int localTimestamp = (int)(Time.realtimeSinceStartup * 1000);

        encoder.SetValue(localTimestamp);
        Graphics.Blit(sourceImage.texture, destTexture, encoder.Material);

        int remoteTimestamp = decoder.GetValue(receiveImage.texture);

        textLocalTimestamp.text  = localTimestamp.ToString();
        textRemoteTimestamp.text = remoteTimestamp.ToString();

        int latency = localTimestamp - remoteTimestamp;

        UpdateLatencyInfo(latency);
    }