public void TestNewResultWhenTwoMpeg4VopsFoundAfterH263Vop()
        {
            const string minVopShortHeaderCount = "Min Vop Short Header Count";

            _mpeg4Detector.SetConfigurationItem(minVopShortHeaderCount, "1");

            Util.CompareResultWithReference(_mpeg4Project, _mpeg4Detector, Path.Combine(TestFilePath, "Mpeg4DetectorNewResultWhenTwoMpeg4VopsFoundAfterH263Vop.m4v"), ReferenceFilePostFix);

            _mpeg4Detector.ResetConfigurationItem(minVopShortHeaderCount);
        }
        private void ScanAndSaveAsSeparateFiles(KeyValuePair <string, string> systemConfiguration, KeyValuePair <string, string> videoConfiguration)
        {
            DeleteSavedFiles();

            IProject projectIssue2490 = TestFramework.ProjectManager.CreateProject(FileNameProjectIssue2490, "S. Holmes", DateTime.Now, "Scan file 1");

            // Locate detectors (and change configuration)
            TestFramework.DetectorFactory.Initialize(".");

            IDetector systemDetector = Util.FindDetector(TestFramework.DetectorFactory.ContainerDetectors, "MPEG-1/2 Systems");
            IDetector videoDetector  = Util.FindDetector(TestFramework.DetectorFactory.CodecDetectors, Mpeg2VideoDetector.DetectorName);

            if (!string.IsNullOrEmpty(systemConfiguration.Key))
            {
                systemDetector.SetConfigurationItem(systemConfiguration.Key, systemConfiguration.Value);
            }
            if (!string.IsNullOrEmpty(videoConfiguration.Key))
            {
                videoDetector.SetConfigurationItem(videoConfiguration.Key, videoConfiguration.Value);
            }

            IDetector[] containerDetectors = new IDetector[] { systemDetector };
            IDetector[] codecDetectors     = new IDetector[] { videoDetector };

            List <IDetector> detectors = new List <IDetector>();

            detectors.AddRange(containerDetectors);
            detectors.AddRange(codecDetectors);

            // Scan test file
            IInputFile fileIssue2490 = TestFramework.DetectData(containerDetectors, codecDetectors, projectIssue2490, FileNameIssue2490);

            if (!string.IsNullOrEmpty(systemConfiguration.Key))
            {
                systemDetector.ResetConfigurationItem(systemConfiguration.Key);
            }
            if (!string.IsNullOrEmpty(videoConfiguration.Key))
            {
                videoDetector.ResetConfigurationItem(videoConfiguration.Key);
            }

            TestFramework.SaveAsSeparateFiles(new List <object> {
                fileIssue2490
            }, ".");

            if (projectIssue2490 != null)
            {
                TestFramework.ProjectManager.CloseProject(projectIssue2490);
                projectIssue2490 = null;
            }
        }
            public IDetector GetDetector(IDetectorFactory detectorFactory)
            {
                if (DetectorType == typeof(UnknownFormatDetector).FullName)
                {
                    return(new UnknownFormatDetector());
                }
                IDetector detector = detectorFactory.Detectors.Single(x => x.DetectorType.FullName == DetectorType);

                foreach (Pair <string, string> configurationItem in Configuration)
                {
                    detector.SetConfigurationItem(configurationItem.First, configurationItem.Second);
                }
                return(detector);
            }
Beispiel #4
0
        internal static void Scan(string scanFileName, IProject projectIssue2332, string containerDetectorName, KeyValuePair <string, string> containerDetectorConfiguration, string codecDetectorName, KeyValuePair <string, string> codecDetectorConfiguration)
        {
            // Locate detectors (and change configuration)
            TestFramework.DetectorFactory.Initialize(".");

            IDetector systemDetector = FindDetector(TestFramework.DetectorFactory.ContainerDetectors, containerDetectorName);

            systemDetector.ResetConfiguration();
            IDetector videoDetector = FindDetector(TestFramework.DetectorFactory.CodecDetectors, codecDetectorName);

            videoDetector.ResetConfiguration();

            if (!string.IsNullOrEmpty(containerDetectorConfiguration.Key))
            {
                systemDetector.SetConfigurationItem(containerDetectorConfiguration.Key, containerDetectorConfiguration.Value);
            }
            if (!string.IsNullOrEmpty(codecDetectorConfiguration.Key))
            {
                videoDetector.SetConfigurationItem(codecDetectorConfiguration.Key, codecDetectorConfiguration.Value);
            }

            IDetector[] containerDetectors = new[] { systemDetector };
            IDetector[] codecDetectors     = new[] { videoDetector };

            List <IDetector> detectors = new List <IDetector>();

            detectors.AddRange(containerDetectors);
            detectors.AddRange(codecDetectors);

            // Scan test file
            TestFramework.DetectData(containerDetectors, codecDetectors, projectIssue2332, scanFileName);

            if (!string.IsNullOrEmpty(containerDetectorConfiguration.Key))
            {
                systemDetector.ResetConfigurationItem(containerDetectorConfiguration.Key);
            }
            if (!string.IsNullOrEmpty(codecDetectorConfiguration.Key))
            {
                videoDetector.ResetConfigurationItem(codecDetectorConfiguration.Key);
            }
        }
Beispiel #5
0
        public void TestFixtureSetup()
        {
            File.Delete(FileNameProjectIssue2496);

            _projectIssue2496 = TestFramework.ProjectManager.CreateProject(FileNameProjectIssue2496, "S. Holmes", DateTime.Now, "Scan file 1");

            // Locate detectors (and change configuration)
            TestFramework.DetectorFactory.Initialize(".");

            IDetector systemDetector = Util.FindDetector(TestFramework.DetectorFactory.ContainerDetectors, "MPEG-1/2 Systems");

            systemDetector.SetConfigurationItem(MaxSystemHeaderCount, "3");

            IDetector[] containerDetectors = new IDetector[] { systemDetector };
            IDetector[] codecDetectors     = new IDetector[] {
                Util.FindDetector(TestFramework.DetectorFactory.CodecDetectors, Mpeg2VideoDetector.DetectorName)
            };

            // Scan test file (1)
            _fileIssue2496 = TestFramework.DetectData(containerDetectors, codecDetectors, _projectIssue2496, FileNameIssue2496);
        }