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))); }
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); }
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); }