internal bool ScanForNearlyCompleteCodecStream(IDataReader dataReader)
            {
                dataReader.Position = 0L;

                Reset();

                _dataScanner.DataBlockDetected   += DataBlockDetected;
                _dataScanner.UnknownDataDetected += UnknownDataDetected;
                try
                {
                    _dataScanner.Scan(dataReader, this);
                }
                finally
                {
                    _dataScanner.DataBlockDetected   -= DataBlockDetected;
                    _dataScanner.UnknownDataDetected -= UnknownDataDetected;
                }

                if (_cancelled || (_codecStreamFragments.Count == 0))
                {
                    return(false);
                }
                foreach (var fragment in _codecStreamFragments)
                {
                    AddRelativeCodecStream(_dataBlockBuilder, fragment);
                }
                return(true);
            }
        private void ScanForCodecFormats(IDataPacket dataPacket)
        {
            ResetFixAndReportDataBlock(dataPacket.StartOffset);

            using (IDataReader dataReader = _dataReaderPool.CreateDataReader(dataPacket))
            {
                IProgressReporter subProgressReporter = _createSubProgressReporter(_codecProgressReporter, dataPacket.StartOffset, dataPacket.Length, dataPacket.InputFile.Length);
                _codecDataScanner.Scan(dataReader, subProgressReporter);
            }
        }
        public void Scan(IDataReader dataReader, IProgressReporter progressReporter)
        {
            ProgressReporterSummer progressReporterSummer    = new ProgressReporterSummer(progressReporter);
            IProgressReporter      containerProgressReporter = progressReporterSummer.AddProgressReporter(ContainerDetectors.Count());

            _codecProgressReporter = progressReporterSummer.AddProgressReporter(CodecDetectors.Count());

            LastDataBlock = null;

            try
            {
                using (_dataReaderPool)
                {
                    _containerDataScanner.Scan(dataReader, containerProgressReporter);
                }
            }
            finally
            {
                LastDataBlock = null;
            }
        }