/// <summary> /// wrap up the avi writing /// </summary> public void CloseFile() { CloseStreams(); if (pAviRawAudioStream != IntPtr.Zero) { Win32.AVIStreamRelease(pAviRawAudioStream); pAviRawAudioStream = IntPtr.Zero; } if (pAviRawVideoStream != IntPtr.Zero) { Win32.AVIStreamRelease(pAviRawVideoStream); pAviRawVideoStream = IntPtr.Zero; } if (pAviFile != IntPtr.Zero) { Win32.AVIFileRelease(pAviFile); pAviFile = IntPtr.Zero; } if (pGlobalBuf != IntPtr.Zero) { Marshal.FreeHGlobal(pGlobalBuf); pGlobalBuf = IntPtr.Zero; pGlobalBuf_size = 0; } }
/// <summary> /// end recording /// </summary> public void CloseStreams() { if (pAviRawAudioStream != IntPtr.Zero) { FlushBufferedAudio(); } if (pAviCompressedVideoStream != IntPtr.Zero) { Win32.AVIStreamRelease(pAviCompressedVideoStream); pAviCompressedVideoStream = IntPtr.Zero; } }