public void Dispose()
        {
            if (SourceReader != null)
            {
                SourceReader.Close();
                SourceReader.Dispose();
            }
            if (TargetWriter != null)
            {
                TargetWriter.Flush();
                TargetWriter.Close();
                TargetWriter.Dispose();
            }

            if (SourceStream != null)
            {
                SourceStream.Close();
                SourceStream.Dispose();
            }
            if (TargetStream != null)
            {
                TargetStream.Close();
                TargetStream.Dispose();
            }
        }
Exemple #2
0
 private void DisposeInternal()
 {
     if (_reader != null)
     {
         _reader.Dispose();
         _reader = null;
     }
     if (_byteStream != null)
     {
         _byteStream.Dispose();
         _byteStream = null;
     }
 }
Exemple #3
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (stream != null)
                {
                    stream.Dispose();
                }
                if (reader != null)
                {
                    reader.Dispose();
                }
            }

            base.Dispose(disposing);
        }
        public void Close()
        {
            logger.Debug("VideoCaptureSource::Close()");

            if (mediaSource != null)
            {
                //mediaSource?.Shutdown();

                mediaSource.Dispose();
                mediaSource = null;
            }

            if (sourceReader != null)
            {
                sourceReader.Dispose();
                sourceReader = null;
            }

            if (device != null)
            {
                device.Dispose();
                device = null;
            }

            if (SharedTexture != null)
            {
                SharedTexture.Dispose();
                SharedTexture = null;
            }

            if (texture != null)
            {
                texture.Dispose();
                texture = null;
            }

            if (processor != null)
            {
                processor.Close();
                processor = null;
            }
        }
Exemple #5
0
        public void Close()
        {
            logger.Debug("VideoCaptureSource::Close()");

            if (mediaSource != null)
            {
                //mediaSource?.Shutdown();

                mediaSource.Dispose();
                mediaSource = null;
            }

            if (sourceReader != null)
            {
                sourceReader.Dispose();
                sourceReader = null;
            }

            if (OutputMediaType != null)
            {
                OutputMediaType.Dispose();
                OutputMediaType = null;
            }
        }
Exemple #6
0
 public void Dispose()
 {
     SourceReader.Dispose();
 }