示例#1
0
        private void Init(MediaFrame frame, bool reinit = false)
        {
            if (_inited && !reinit)
            {
                return;
            }

            if (_ffimp != null)
            {
                _ffimp.Release();
            }

            _inited = true;
            _width  = frame.nWidth;
            _height = frame.nHeight;
            _ffimp  = new FFImp(AVCodecCfg.CreateVideo(_width, _height), true, true);
            if (_yuvDraw == null && _control != null)
            {
                _yuvDraw = new YUVGDIDraw(_control);
            }
            _yuvDraw.SetSize(_width, _height);

            _yuvDataBuffer = new byte[_width * _height * 3 / 2];

            _drawHandle = new Action <byte[]>(Draw);
        }
示例#2
0
        public override void Dispose()
        {
            Stop();

            _isDisoseing = true;
            try {
                //if (_play != null)
                //    _play.Dispose();
                if (_speex != null)
                {
                    _speex.Dispose();
                }
                if (_aac != null)
                {
                    _aac.Release();
                }
                if (_wave != null)
                {
                    _wave.Dispose();
                }
            } catch {
            } finally {
                _isDisoseing = false;
                _isDisosed   = true;
            }
        }
示例#3
0
 public override void Close()
 {
     if (_aac != null)
     {
         // _aac.Dispose();
         _aac.Release();
     }
 }