Example #1
0
        private static void Calculate(MetadataInfoTreeGroup metadataInfoTreeGroup)
        {
            //first ensure that all dependencies have calculated metadata
            if (metadataInfoTreeGroup.DependecyTree.Any(mti => mti.ResultMetadataInfo == null))
            {
                metadataInfoTreeGroup.DependecyTree.ForEach(mti => Calculate((dynamic)mti));
            }

            //second we need to form a list of the supplied metadata info
            var suppliedMetadataInfo = metadataInfoTreeGroup.DependecyTree.Select(mti => mti.ResultMetadataInfo).ToList();

            var metadataInfoResult = suppliedMetadataInfo.First().Copy();

            //now we must execute the metadata manipulators for filters
            if (metadataInfoTreeGroup.Filterchain != null)
            {
                var metadataManipulators = metadataInfoTreeGroup.Filterchain.Filters.List.OfType <IMetadataManipulation>().ToList();

                metadataManipulators.ForEach(mm => metadataInfoResult = mm.EditInfo(metadataInfoResult, suppliedMetadataInfo));
            }

            //now we must execute the metadata manipulators for settings
            if (metadataInfoTreeGroup.Settings != null)
            {
                var metadataManipulators = metadataInfoTreeGroup.Settings.SettingsList.OfType <IMetadataManipulation>().ToList();

                metadataManipulators.ForEach(mm => metadataInfoResult = mm.EditInfo(metadataInfoResult, suppliedMetadataInfo));
            }

            //finally set the calculated result.
            metadataInfoTreeGroup.ResultMetadataInfo = metadataInfoResult;
        }
        private static void Calculate(MetadataInfoTreeGroup metadataInfoTreeGroup)
        {
            //first ensure that all dependencies have calculated metadata
            if (metadataInfoTreeGroup.DependecyTree.Any(mti => mti.ResultMetadataInfo == null))
            {
                metadataInfoTreeGroup.DependecyTree.ForEach(mti => Calculate((dynamic)mti));
            }

            //second we need to form a list of the supplied metadata info
            var suppliedMetadataInfo = metadataInfoTreeGroup.DependecyTree.Select(mti => mti.ResultMetadataInfo).ToList();

            var metadataInfoResult = suppliedMetadataInfo.First().Copy();

            //now we must execute the metadata manipulators for filters
            if (metadataInfoTreeGroup.Filterchain != null)
            {
                var metadataManipulators = metadataInfoTreeGroup.Filterchain.Filters.OfType<IMetadataManipulation>().ToList();

                metadataManipulators.ForEach(mm => metadataInfoResult = mm.EditInfo(metadataInfoResult, suppliedMetadataInfo));
            }

            //now we must execute the metadata manipulators for settings
            if (metadataInfoTreeGroup.Settings != null)
            {
                var metadataManipulators = metadataInfoTreeGroup.Settings.SettingsList.OfType<IMetadataManipulation>().ToList();

                metadataManipulators.ForEach(mm => metadataInfoResult = mm.EditInfo(metadataInfoResult, suppliedMetadataInfo));
            }

            //finally set the calculated result.
            metadataInfoTreeGroup.ResultMetadataInfo = metadataInfoResult;
        }
        public static MetadataInfoTreeGroup Create(FFmpegCommand command, CommandOutput commandOutput)
        {
            var metadataInfoTreeGroup = new MetadataInfoTreeGroup(commandOutput.Settings);

            metadataInfoTreeGroup.Fill(command, commandOutput);

            return metadataInfoTreeGroup;
        }
        public static MetadataInfoTreeGroup Create(FFmpegCommand command, Filterchain filterchain)
        {
            var metadataInfoTreeGroup = new MetadataInfoTreeGroup(filterchain);

            metadataInfoTreeGroup.Fill(command, filterchain);

            return metadataInfoTreeGroup;
        }
        public static MetadataInfoTreeGroup Create(FFmpegCommand command, CommandOutput commandOutput)
        {
            var metadataInfoTreeGroup = new MetadataInfoTreeGroup(commandOutput.Settings);

            metadataInfoTreeGroup.Fill(command, commandOutput);

            return(metadataInfoTreeGroup);
        }
        public static MetadataInfoTreeGroup Create(FFmpegCommand command, Filterchain filterchain)
        {
            var metadataInfoTreeGroup = new MetadataInfoTreeGroup(filterchain);

            metadataInfoTreeGroup.Fill(command, filterchain);

            return(metadataInfoTreeGroup);
        }
Example #7
0
        public static MetadataInfoStreamCalculator Create(FFmpegCommand command, CommandOutput commandOutput)
        {
            var infoStreamItem = MetadataInfoTreeGroup.Create(command, commandOutput);

            return(new MetadataInfoStreamCalculator(infoStreamItem));
        }
Example #8
0
        public static MetadataInfoStreamCalculator Create(FFmpegCommand command, Filterchain filterchain)
        {
            var infoStreamItem = MetadataInfoTreeGroup.Create(command, filterchain);

            return(new MetadataInfoStreamCalculator(infoStreamItem));
        }