public void Release() { //lock (this) //{ _isReleased = true; try { var avmode = new AVModel() { context = FunctionEx.IntPtrToStruct <AVModel>(pAVObj).context, }; lock (this) ffimp_free_avobj(FunctionEx.StructToIntPtr(avmode)); avmode = new AVModel() { codec = FunctionEx.IntPtrToStruct <AVModel>(pAVObj).codec, }; lock (this) ffimp_free_avobj(FunctionEx.StructToIntPtr(avmode)); //ffimp_free_avobj(pAVObj); if (_ffscale != null) { _ffscale.Release(); } Marshal.FreeHGlobal(pOutBuf); } catch (Exception e) { Console.WriteLine("ffimp error:{0}", e); } //} }
public void Release() { Stop(); if (_scale != null) { _scale.Release(); } }
public void Dispose() { try { if (_isworking) { Stop(); } _capturer.Dispose(); _ffscale.Release(); _x264.Release(); _draw.Release(); } catch (Exception e) { throw; } }