// Records a video highlight for the given group. Attached metadata to it to make the Highlight more interesting.
        // Set the start and end delta to change the length of the video clip.
        public static void SetVideoHighlight(VideoHighlightParams videoHighlightParams, EmptyCallbackDelegate callback)
        {
            if (!instanceCreated)
            {
                Debug.LogError("ERROR: Cannot record a video. The SDK has not been initialized.");
                return;
            }

            IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(videoHighlightParams));

            EmptyCallbackId cid = new EmptyCallbackId();

            cid.id       = GetCallbackId();
            cid.callback = callback;

            IntPtr asyncOp = Marshal.AllocHGlobal(Marshal.SizeOf(cid));

            try
            {
                Marshal.StructureToPtr(videoHighlightParams, pnt, false);
                Marshal.StructureToPtr(cid, asyncOp, false);

                Highlights_SetVideoHighlightAsync(pnt, asyncOp);
            }
            finally
            {
                Marshal.FreeHGlobal(pnt);
                Marshal.FreeHGlobal(asyncOp);
            }
        }
Exemple #2
0
        // Records a video highlight for the given group. Attached metadata to it to make the Highlight more interesting.
        // Set the start and end delta to change the length of the video clip.
        public static void SetVideoHighlight(VideoHighlightParams videoHighlightParams)
        {
            if (!instanceCreated)
            {
                Debug.LogError("ERROR: Cannot record a video. The SDK has not been initialized.");
                return;
            }

            IntPtr pnt = Marshal.AllocHGlobal(Marshal.SizeOf(videoHighlightParams));

            try
            {
                Marshal.StructureToPtr(videoHighlightParams, pnt, false);
                Highlights_SetVideoHighlightAsync(pnt);
            }
            finally {
                Marshal.FreeHGlobal(pnt);
            }
        }