Ejemplo n.º 1
0
        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);
            }
            //}
        }
Ejemplo n.º 2
0
 public void Release()
 {
     Stop();
     if (_scale != null)
     {
         _scale.Release();
     }
 }
Ejemplo n.º 3
0
 public void Dispose()
 {
     try
     {
         if (_isworking)
         {
             Stop();
         }
         _capturer.Dispose();
         _ffscale.Release();
         _x264.Release();
         _draw.Release();
     }
     catch (Exception e)
     {
         throw;
     }
 }