Example #1
0
    public void CaptureFrame(MegacoolFrameCaptureConfig config)
    {
        config.SetDefaults();

        InitializeManager();
        RenderThisFrame = true;

#if UNITY_IOS && !UNITY_EDITOR
        captureFrameWithConfig(config.RecordingId, config.OverflowStrategy.ToString(), new Crop(new Rect(0, 0, 0, 0)), config.ForceAdd, config.MaxFrames, config.FrameRate);
#elif UNITY_ANDROID && !UNITY_EDITOR
        AndroidWrapper.CaptureFrame(config);
#endif
    }
Example #2
0
    public void CaptureFrame(MegacoolFrameCaptureConfig config)
    {
        AndroidJavaObject jConfig = new AndroidJavaObject("co.megacool.megacool.RecordingConfig");

        // We have to use the generic version of Call here since the Java methods are not void, even
        // though we discard the return value
        jConfig.Call <AndroidJavaObject>("id", config.RecordingId);
        jConfig.Call <AndroidJavaObject>("maxFrames", config.MaxFrames);
        jConfig.Call <AndroidJavaObject>("peakLocation", config.PeakLocation);
        jConfig.Call <AndroidJavaObject>("frameRate", config.FrameRate);
        jConfig.Call <AndroidJavaObject>("playbackFrameRate", config.PlaybackFrameRate);
        jConfig.Call <AndroidJavaObject>("lastFrameDelay", config.LastFrameDelay);
        jConfig.Call <AndroidJavaObject>("overflowStrategy", config.OverflowStrategy.ToString());

//        AndroidJavaObject jCrop = new AndroidJavaObject("android.graphics.Rect",
//            (int)config.Crop.xMin, (int)config.Crop.yMin, (int)config.Crop.xMax, (int)config.Crop.yMax);
//        jConfig.Call<AndroidJavaObject>("cropRect", jCrop);

        Android.Call("captureFrame", jConfig);
    }