/// <summary> /// Stops recording. /// </summary> /// public void StopRecording() { if (!IsRecording) { return; } lock (syncObj) { IsRecording = false; if (videoWriter != null) { videoWriter.Close(); videoWriter.Dispose(); videoWriter = null; } if (audioDevice != null) { audioDevice.Stop(); audioDevice.Dispose(); audioDevice = null; } HasRecorded = true; } }
public virtual void StopRecording () { if (audioSource != null) audioSource.Dispose(); audioSource = null; NatCorderBridge.StopRecording(); Texture2D.Destroy(framebuffer); framebuffer = null; }
public void StartRecording(Configuration configuration, SaveCallback saveCallback, IAudioSource audioSource) { #if FFMPEG_API this.configuration = configuration; this.saveCallback = saveCallback; this.readbackBuffer = Acquire(); this.framebuffer = new Texture2D(configuration.width, configuration.height, TextureFormat.RGB24, false); // Create process filename = "recording_" + DateTime.Now.ToString("yyyy_MM_dd_HH_mm_ss_fff"); videoWriter = CreateProcess(string.Format( @"-y -f rawvideo -vcodec rawvideo -pixel_format rgb24 -video_size {0}x{1} -framerate {2} -loglevel warning -i - -vcodec libx264 -pix_fmt yuv420p -preset ultrafast {3}", configuration.width, configuration.height, configuration.framerate, filename + ".mp4" )); videoWriter.Start(); videoInput = new BinaryWriter(videoWriter.StandardInput.BaseStream); videoWriter.BeginOutputReadLine(); videoWriter.BeginErrorReadLine(); // We don't support audio if (audioSource != null) { audioSource.Dispose(); } // Start recording IsRecording = true; #endif }
public void Dispose() { if (_source != null) { _source.Dispose(); } }
public void StartRecording(Configuration configuration, VideoCallback videoCallback, IAudioSource audioSource) { // We don't need the audio source if (audioSource != null) { audioSource.Dispose(); } }
public void StopRecording() { if (audioSource != null) { audioSource.Dispose(); } natcorder.Call("stopRecording"); }
public void StopRecording() { if (audioSource != null) { audioSource.Dispose(); } NatCorderBridge.StopRecording(); }
protected void Dispose(bool disposing) { if (disposing) { _disposing = true; _audioPlayer.Dispose(); _audioSource.Dispose(); } }
private void CloseInternal() { if (_factory != null && _parameters.AecDump) { _factory.StopAecDump(); } _logger.Debug(TAG, "Closing peer connection."); if (_rtcEventLog != null) { // RtcEventLog should stop before the peer connection is disposed. _rtcEventLog.Stop(); _rtcEventLog = null; } _logger.Debug(TAG, "Closing audio source."); if (_audioSource != null) { _audioSource.Dispose(); _audioSource = null; } _logger.Debug(TAG, "Stopping capturer."); if (_videoCapturer != null) { _videoCapturer.StopCapture(); _videoCapturer.Dispose(); _videoCapturerStopped = true; _videoCapturer = null; } _logger.Debug(TAG, "Closing video source."); if (_videoSource != null) { _videoSource.Dispose(); _videoSource = null; } _localRenderer = null; _remoteRenderer = null; _logger.Debug(TAG, "Closing peer connection factory."); if (_factory != null) { _factory.Dispose(); _factory = null; } _logger.Debug(TAG, "Closing peer connection done."); _peerConnectionEvents.OnPeerConnectionClosed(); PeerConnectionFactory.StopInternalTracingCapture(); PeerConnectionFactory.ShutdownInternalTracer(); _executor.Release(); }