コード例 #1
0
        private static void ComposeFfmpeg(IServiceCollection services, ProcessingConfiguration processingConfig)
        {
            var ffmpegDiretory = Path.GetDirectoryName(processingConfig.Actions.FfmpegPath);

            Xabe.FFmpeg.FFmpeg.SetExecutablesPath(ffmpegDiretory);
            services.AddTransient <IFFmpegEngine, FFmpegEngine>();
        }
コード例 #2
0
        private static ProcessingConfiguration GetProcessingConfig(
            IServiceCollection services,
            IConfiguration configuration)
        {
            var processingConfig = new ProcessingConfiguration();

            configuration.GetSection("Processing").Bind(processingConfig);
            services.AddSingleton(processingConfig);

            return(processingConfig);
        }
コード例 #3
0
        private static void ComposeActions(IServiceCollection services, ProcessingConfiguration config)
        {
            services.AddTransient <IActionsFileStore, LocalFileStoreAdapter>(
                x => new LocalFileStoreAdapter(
                    new LocalFileStoreOptions {
                BaseFilePath = config.Actions.BaseFilePath
            }
                    ));

            services.AddTransient <ILocalRecordsComponent, LocalRecordComponent>();
            services.AddTransient <IExtensionToMediaTypeMapper, ExtensionToMediaTypeMapper>();
            services.AddTransient <IActionsMappings, ActionsMappings>();
            services.AddTransient <IActionsHandlerFactory, ActionsHandlerFactory>();
            services.AddTransient <IActionsProcessorFacade, ActionsProcessorFacade>();
            services.AddTransient <IJsonActionsParser, JsonActionsParser>();
        }