public void InputVideoDecodeConfiguration_MultipleFilters_InvalidConfigDetected()
        {
            var parameters = new StackAllOptions
            {
                InputVideoFile      = "a.mp4",
                InputVideoArguments = "-vf scale=-1:1080",
                Filters             = new List <string> {
                    "MaxFilter", "MinFilter"
                },
                OutputVideoFile = "a2.mp4"
            };

            var basicEnvironment = new StackingEnvironment();

            basicEnvironment.ConfigureInputMode(parameters);
            basicEnvironment.ConfigureFilters(parameters.Filters);
            basicEnvironment.ConfigureOuptutMode(parameters);

            basicEnvironment.ThrowMe.Should().BeFalse();
            basicEnvironment.Filters.Should().HaveCount(2);

            basicEnvironment.CheckConstraints();

            basicEnvironment.ThrowMe.Should().BeTrue();
        }
Пример #2
0
        public void FilterConfiguration_NoConfiguration_SetsThrowMeFlag()
        {
            var parameters = new StackAllOptions {
            };

            var basicEnvironment = new StackingEnvironment();

            basicEnvironment.ConfigureFilters(parameters.Filters);

            basicEnvironment.ThrowMe.Should().BeTrue();
        }
Пример #3
0
        public void FilterConfiguration_AllowsFriendlyInput_InputsParseCorrectly(string input, int expectedFilters)
        {
            var parameters = new StackAllOptions
            {
                Filters = input.Split(' ')
            };

            var basicEnvironment = new StackingEnvironment();

            basicEnvironment.ConfigureFilters(parameters.Filters);

            basicEnvironment.Filters.Cast <IFilter <MutableByteImage> >().Should().HaveCount(expectedFilters);
        }
Пример #4
0
        public void FilterConfiguration_AttackDecayFilter_CreatesAttackDecayFilter()
        {
            var parameters = new StackAllOptions
            {
                Filters = "--filters AttackDecayFilter Attack=1.0 Decay=0.2".Split(' ')
            };

            var basicEnvironment = new StackingEnvironment();

            basicEnvironment.ConfigureFilters(parameters.Filters);

            basicEnvironment.Filters.Count.Should().Be(1);
            basicEnvironment.ThrowMe.Should().BeFalse();
        }
Пример #5
0
        public void FilterConfiguration_FilterConfig_CreatesRequestedFilter(string input)
        {
            var parameters = new StackAllOptions
            {
                Filters = input.Split(' ')
            };

            var basicEnvironment = new StackingEnvironment();

            basicEnvironment.ConfigureFilters(parameters.Filters);

            basicEnvironment.Filters.Count.Should().Be(1);
            basicEnvironment.ThrowMe.Should().BeFalse();
        }
Пример #6
0
        public void FilterConfiguration_AttackiDecayFilter_ParametersSetCorrectly(string input, string expectedName)
        {
            var parameters = new StackAllOptions
            {
                Filters = input.Split(' ')
            };

            var basicEnvironment = new StackingEnvironment();

            basicEnvironment.ConfigureFilters(parameters.Filters);

            var createdFilter = basicEnvironment.Filters.Single().As <IFilter <MutableByteImage> >();

            createdFilter.Name.Should().Be(expectedName);
        }
Пример #7
0
        public void FilterConfiguration_DefaultFilterName_NameIsSet()
        {
            var parameters = new StackAllOptions
            {
                Filters = "--filters AttackDecayFilter Attack=0.2 Decay=1.0, MaxFilter, MinFilter".Split(' ')
            };

            var basicEnvironment = new StackingEnvironment();

            basicEnvironment.ConfigureFilters(parameters.Filters);

            var createdFilters = basicEnvironment.Filters.Cast <IFilter <MutableByteImage> >().ToList();

            createdFilters.Count.Should().Be(3);
            createdFilters.Select(x => x.Name).Distinct().Count().Should().Be(3);
        }