public bool IsFileReady()
        {
            bool result = true;

            if (_handle >= 0)
            {
                result = NativePlugin.IsFileWritingComplete(_handle);
                if (result)
                {
                    if (_videoEncodingHints != null)
                    {
                        result = StartPostProcess();
                        _videoEncodingHints = null;
                    }
                    if (_postProcessEvent != null)
                    {
                        result = _postProcessEvent.WaitOne(1);
                    }
                    if (result)
                    {
                        Dispose();
                    }
                }
            }
            return(result);
        }
        public void Dispose()
        {
            if (_handle >= 0)
            {
                NativePlugin.FreeRecorder(_handle);
                _handle = -1;

                // Issue the free resources plugin event
                NativePlugin.RenderThreadEvent(NativePlugin.PluginEvent.FreeResources, -1);
            }

            _videoEncodingHints = null;
            _postProcessEvent   = null;
        }
 internal void AddPostOperation(VideoEncoderHints videoEncodingHints)
 {
     _videoEncodingHints = videoEncodingHints;
 }
Example #4
0
 public static extern int CreateRecorderVideo([MarshalAs(UnmanagedType.LPWStr)] string filename, uint width, uint height, float frameRate, int format,
                                              [MarshalAs(UnmanagedType.U1)] bool isRealTime, [MarshalAs(UnmanagedType.U1)] bool isTopDown, int videoCodecIndex,
                                              AudioCaptureSource audioSource, int audioSampleRate, int audioChannelCount, int audioInputDeviceIndex, int audioCodecIndex,
                                              [MarshalAs(UnmanagedType.U1)] bool forceGpuFlush, VideoEncoderHints hints);