Example #1
0
        private Filterchain(List <IStream> outputsToUse)
        {
            if (outputsToUse == null || outputsToUse.Count == 0)
            {
                throw new ArgumentNullException("outputsToUse");
            }

            Id          = Guid.NewGuid().ToString();
            ReceiptList = new List <StreamIdentifier>();
            OutputList  = new List <FilterchainOutput>();
            Filters     = new ForStreamCollection <IFilter>(outputsToUse.First().GetType());
            OutputList.AddRange(outputsToUse.Select(output => new FilterchainOutput(this, output)));
        }
Example #2
0
        public void AppliesToCollection_Verify()
        {
            var appliesToCollection = new ForStreamCollection <IFilter>(typeof(VideoStream));

            appliesToCollection.Add(new Trim());
            appliesToCollection.Add(new SetDar());

            Assert.Throws <ForStreamInvalidException>(() => appliesToCollection.Add(new AMix()));

            Assert.True(appliesToCollection.Count == 2);

            Assert.True(appliesToCollection.IndexOf <SetDar>() == 1);

            appliesToCollection.Merge(new SetDar(), FFmpegMergeOptionType.NewWins);
            appliesToCollection.Merge(new Overlay(), FFmpegMergeOptionType.OldWins);

            Assert.True(appliesToCollection.Count == 3);
        }
Example #3
0
        public void AppliesToCollection_Verify()
        {
            var appliesToCollection = new ForStreamCollection<IFilter>(typeof (VideoStream));

            Assert.DoesNotThrow(() => appliesToCollection.Add(new Trim()));
            Assert.DoesNotThrow(() => appliesToCollection.Add(new SetDar()));

            Assert.Throws<ForStreamInvalidException>(() => appliesToCollection.Add(new AMix()));

            Assert.True(appliesToCollection.Count == 2);

            Assert.True(appliesToCollection.IndexOf<SetDar>() == 1);

            appliesToCollection.Merge(new SetDar(), FFmpegMergeOptionType.NewWins);
            appliesToCollection.Merge(new Overlay(), FFmpegMergeOptionType.OldWins);

            Assert.True(appliesToCollection.Count == 3);
        }