Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FFMpegManager" /> class.
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        /// <param name="zipClient">The zip client.</param>
        /// <param name="jsonSerializer">The json serializer.</param>
        /// <param name="protobufSerializer">The protobuf serializer.</param>
        /// <param name="logger">The logger.</param>
        /// <exception cref="System.ArgumentNullException">zipClient</exception>
        public FFMpegManager(Kernel kernel, IZipClient zipClient, IJsonSerializer jsonSerializer, IProtobufSerializer protobufSerializer, ILogManager logManager, IServerApplicationPaths appPaths)
        {
            if (kernel == null)
            {
                throw new ArgumentNullException("kernel");
            }
            if (zipClient == null)
            {
                throw new ArgumentNullException("zipClient");
            }
            if (jsonSerializer == null)
            {
                throw new ArgumentNullException("jsonSerializer");
            }
            if (protobufSerializer == null)
            {
                throw new ArgumentNullException("protobufSerializer");
            }

            _kernel             = kernel;
            _zipClient          = zipClient;
            _jsonSerializer     = jsonSerializer;
            _protobufSerializer = protobufSerializer;
            _appPaths           = appPaths;
            _logger             = logManager.GetLogger("FFMpegManager");

            // Not crazy about this but it's the only way to suppress ffmpeg crash dialog boxes
            SetErrorMode(ErrorModes.SEM_FAILCRITICALERRORS | ErrorModes.SEM_NOALIGNMENTFAULTEXCEPT | ErrorModes.SEM_NOGPFAULTERRORBOX | ErrorModes.SEM_NOOPENFILEERRORBOX);

            VideoImageCache = new FileSystemRepository(VideoImagesDataPath);
            AudioImageCache = new FileSystemRepository(AudioImagesDataPath);
            SubtitleCache   = new FileSystemRepository(SubtitleCachePath);

            Task.Run(() => VersionedDirectoryPath = GetVersionedDirectoryPath());
        }
Пример #2
0
 public void Initialize(bool useTypeMode)
 {
     //if (useTypeMode)
     //    protobufSerializer = new TypeModelProtobufSerializer(new ProtobufSerializer());
     //   else
     protobufSerializer = new MetaDataProtobufSerializer();
 }
Пример #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="HttpServer" /> class.
        /// </summary>
        /// <param name="applicationHost">The application host.</param>
        /// <param name="protobufSerializer">The protobuf serializer.</param>
        /// <param name="logger">The logger.</param>
        /// <param name="serverName">Name of the server.</param>
        /// <param name="defaultRedirectpath">The default redirectpath.</param>
        /// <exception cref="System.ArgumentNullException">urlPrefix</exception>
        public HttpServer(IApplicationHost applicationHost, IProtobufSerializer protobufSerializer, ILogger logger, string serverName, string defaultRedirectpath)
            : base()
        {
            if (protobufSerializer == null)
            {
                throw new ArgumentNullException("protobufSerializer");
            }
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (applicationHost == null)
            {
                throw new ArgumentNullException("applicationHost");
            }
            if (string.IsNullOrEmpty(serverName))
            {
                throw new ArgumentNullException("serverName");
            }
            if (string.IsNullOrEmpty(defaultRedirectpath))
            {
                throw new ArgumentNullException("defaultRedirectpath");
            }

            ServerName          = serverName;
            DefaultRedirectPath = defaultRedirectpath;
            ProtobufSerializer  = protobufSerializer;
            _logger             = logger;
            ApplicationHost     = applicationHost;

            EndpointHostConfig.Instance.ServiceStackHandlerFactoryPath = null;
            EndpointHostConfig.Instance.MetadataRedirectPath           = "metadata";
        }
Пример #4
0
 public Plugin(IProtobufSerializer protobufSerializer, IProtobufReferenceLayerSerializer protobufReferenceLayerSerializer, IAdmVersionInfoWriter admVersionInfoWriter, IAdmVersionInfoReader admVersionInfoReader)
 {
     _documentsImporter = new DocumentsImporter(protobufSerializer);
     _documentsExporter = new DocumentsExporter(protobufSerializer);
     _protobufReferenceLayerSerializer = protobufReferenceLayerSerializer;
     _admVersionInfoWriter             = admVersionInfoWriter;
     _admVersionInfoReader             = admVersionInfoReader;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="LoggregatorLog"/> class.
        /// </summary>
        /// <param name="loggregatorEndpoint">The Loggregator endpoint.</param>
        /// <param name="authenticationToken">The authentication token.</param>
        /// <param name="httpProxy">The HTTP proxy.</param>
        /// <param name="skipCertificateValidation">if set to <c>true</c> it will skip TLS certificate validation for HTTP requests.</param>
        public LoggregatorLog(Uri loggregatorEndpoint, string authenticationToken, Uri httpProxy, bool skipCertificateValidation)
        {
            this.LoggregatorEndpoint       = loggregatorEndpoint;
            this.AuthenticationToken       = authenticationToken;
            this.HttpProxy                 = httpProxy;
            this.SkipCertificateValidation = skipCertificateValidation;

            this.protobufSerializer = new ProtobufSerializer();
        }
Пример #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LoggregatorLog"/> class.
        /// </summary>
        /// <param name="loggregatorEndpoint">The Loggregator endpoint.</param>
        /// <param name="authenticationToken">The authentication token.</param>
        /// <param name="httpProxy">The HTTP proxy.</param>
        /// <param name="skipCertificateValidation">if set to <c>true</c> it will skip TLS certificate validation for HTTP requests.</param>
        public LoggregatorLog(Uri loggregatorEndpoint, string authenticationToken, Uri httpProxy, bool skipCertificateValidation)
        {
            this.LoggregatorEndpoint = loggregatorEndpoint;
            this.AuthenticationToken = authenticationToken;
            this.HttpProxy = httpProxy;
            this.SkipCertificateValidation = skipCertificateValidation;

            this.protobufSerializer = new ProtobufSerializer();
        }
Пример #7
0
 public void Initialize(bool useTypeMode)
 {
     if (useTypeMode)
     {
         protobufSerializer = new TypeModelProtobufSerializer(new Protocols_c());
     }
     else
     {
         protobufSerializer = new MetaDataProtobufSerializer();
     }
 }
Пример #8
0
 public static void Initialize(bool useTypeMode)
 {
     if (useTypeMode)
     {
         //protobufSerializer = new TypeModelProtobufSerializer(new ClientCommon_c());
     }
     else
     {
         protobufSerializer = new MetaDataProtobufSerializer();
     }
 }
Пример #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImageManager" /> class.
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        /// <param name="protobufSerializer">The protobuf serializer.</param>
        /// <param name="logger">The logger.</param>
        public ImageManager(Kernel kernel, IProtobufSerializer protobufSerializer, ILogger logger, IServerApplicationPaths appPaths)
        {
            _protobufSerializer = protobufSerializer;
            _logger             = logger;
            _kernel             = kernel;

            ImageSizeCache     = new FileSystemRepository(Path.Combine(appPaths.ImageCachePath, "image-sizes"));
            ResizedImageCache  = new FileSystemRepository(Path.Combine(appPaths.ImageCachePath, "resized-images"));
            CroppedImageCache  = new FileSystemRepository(Path.Combine(appPaths.ImageCachePath, "cropped-images"));
            EnhancedImageCache = new FileSystemRepository(Path.Combine(appPaths.ImageCachePath, "enhanced-images"));
        }
 public LoggregatorLog(IOptions <CFConfiguration> cfOPtions, ISimpleHttpClient simpleHttpClient,
                       ILoggregatorWebSocket webSocket, IProtobufSerializer protobufSerializer)
 {
     this.LoggregatorEndpoint = new Uri(cfOPtions?.Value?.LogAggregationUrl);
     if (!string.IsNullOrWhiteSpace(cfOPtions?.Value?.Proxy))
     {
         this.HttpProxy = new Uri(cfOPtions?.Value?.Proxy);
     }
     this.SkipCertificateValidation = (bool)cfOPtions?.Value?.SkipCertificateValidation;
     this.webSocket          = webSocket;
     this.protobufSerializer = protobufSerializer;
     httpClient = simpleHttpClient;
 }
Пример #11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SQLiteUserDataRepository" /> class.
        /// </summary>
        /// <param name="appPaths">The app paths.</param>
        /// <param name="protobufSerializer">The protobuf serializer.</param>
        /// <param name="logger">The logger.</param>
        /// <exception cref="System.ArgumentNullException">protobufSerializer</exception>
        public SQLiteUserDataRepository(IApplicationPaths appPaths, IProtobufSerializer protobufSerializer, ILogger logger)
            : base(logger)
        {
            if (protobufSerializer == null)
            {
                throw new ArgumentNullException("protobufSerializer");
            }
            if (appPaths == null)
            {
                throw new ArgumentNullException("appPaths");
            }

            _protobufSerializer = protobufSerializer;
            _appPaths           = appPaths;
        }
Пример #12
0
        public FFProbeVideoInfoProvider(IIsoManager isoManager, IBlurayExaminer blurayExaminer, IProtobufSerializer protobufSerializer, ILogManager logManager, IServerConfigurationManager configurationManager)
            : base(logManager, configurationManager)
        {
            if (isoManager == null)
            {
                throw new ArgumentNullException("isoManager");
            }
            if (blurayExaminer == null)
            {
                throw new ArgumentNullException("blurayExaminer");
            }
            if (protobufSerializer == null)
            {
                throw new ArgumentNullException("protobufSerializer");
            }

            _blurayExaminer     = blurayExaminer;
            _isoManager         = isoManager;
            _protobufSerializer = protobufSerializer;

            BdInfoCache = new FileSystemRepository(Path.Combine(ConfigurationManager.ApplicationPaths.CachePath, "bdinfo"));
        }
Пример #13
0
 public DocumentsImporter(IProtobufSerializer protobufSerializer)
 {
     _protobufSerializer = protobufSerializer;
 }
Пример #14
0
 public ProtobufReferenceLayerSerializer(IProtobufReferenceLayerConverter protobufReferenceLayerConverter, IProtobufSerializer protobufSerializer)
 {
     _protobufReferenceLayerConverter = protobufReferenceLayerConverter;
     _protobufSerializer = protobufSerializer;
 }
Пример #15
0
 /// <summary>
 /// Creates the server.
 /// </summary>
 /// <param name="applicationHost">The application host.</param>
 /// <param name="protobufSerializer">The protobuf serializer.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="serverName">Name of the server.</param>
 /// <param name="defaultRedirectpath">The default redirectpath.</param>
 /// <returns>IHttpServer.</returns>
 public static IHttpServer CreateServer(IApplicationHost applicationHost, IProtobufSerializer protobufSerializer, ILogger logger, string serverName, string defaultRedirectpath)
 {
     return(new HttpServer(applicationHost, protobufSerializer, logger, serverName, defaultRedirectpath));
 }