Beispiel #1
0
        public LiveTvService(ILogger logger)
        {
            //System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();
            logger.Info("[TVHclient] LiveTvService()");

            _logger = logger;

            _htsConnectionHandler = HTSConnectionHandler.GetInstance(_logger);
            _htsConnectionHandler.setLiveTvService(this);
        }
        public LiveTvService(ILogger logger, IMediaEncoder mediaEncoder)
        {
            //System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();
            logger.LogInformation("[TVHclient] LiveTvService()");

            _logger = logger;

            _htsConnectionHandler = HTSConnectionHandler.GetInstance(_logger);
            _htsConnectionHandler.setLiveTvService(this);

            //Added for stream probing
            _mediaEncoder = mediaEncoder;
        }
        public LiveTvService(ILogger logger, IMediaEncoder mediaEncoder)
        {
            //System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();
            logger.Info("[TVHclient] LiveTvService()");

            _logger = logger;

            _htsConnectionHandler = HTSConnectionHandler.GetInstance(_logger);
            _htsConnectionHandler.setLiveTvService(this);

            //Added for stream probing
            _mediaEncoder = mediaEncoder;
        }
Beispiel #4
0
 public static HTSConnectionHandler GetInstance(ILogger logger)
 {
     if (_instance == null)
     {
         lock (_syncRoot)
         {
             if (_instance == null)
             {
                 _instance = new HTSConnectionHandler(logger);
             }
         }
     }
     return(_instance);
 }
 public static HTSConnectionHandler GetInstance(ILogger logger)
 {
     if (_instance == null)
     {
         lock (_syncRoot)
         {
             if (_instance == null)
             {
                 _instance = new HTSConnectionHandler(logger);
             }
         }
     }
     return _instance;
 }
 public static HTSConnectionHandler GetInstance(ILoggerFactory loggerFactory, IHttpClientFactory httpClientFactory)
 {
     if (_instance == null)
     {
         lock (_syncRoot)
         {
             if (_instance == null)
             {
                 _instance = new HTSConnectionHandler(loggerFactory, httpClientFactory);
             }
         }
     }
     return(_instance);
 }
Beispiel #7
0
        private HTSConnectionHandler GetConnectionHandler(TunerHostInfo tuner)
        {
            var id = tuner.Id;

            if (ConnectionHandlers.TryGetValue(id, out HTSConnectionHandler handler))
            {
                return(handler);
            }

            var config = GetProviderOptions <TvHeadEndProviderOptions>(tuner);

            handler = new HTSConnectionHandler(Logger, tuner.Url, config);
            ConnectionHandlers.TryAdd(id, handler);

            return(handler);
        }
        public LiveTvService(ILoggerFactory loggerFactory, IMediaEncoder mediaEncoder, IHttpClientFactory httpClientFactory)
        {
            //System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();
            _logger = loggerFactory.CreateLogger <LiveTvService>();
            _logger.LogDebug("[TVHclient] LiveTvService()");

            _htsConnectionHandler = HTSConnectionHandler.GetInstance(loggerFactory, httpClientFactory);
            _htsConnectionHandler.setLiveTvService(this);

            {
                var lifeSpan       = TimeSpan.FromSeconds(15); // Revalidate tickets every 15 seconds
                var requestTimeout = TimeSpan.FromSeconds(10); // First request retry after 10 seconds
                var retries        = 2;                        // Number of times to retry getting tickets
                _channelTicketHandler   = new AccessTicketHandler(loggerFactory, _htsConnectionHandler, requestTimeout, retries, lifeSpan, Channel);
                _recordingTicketHandler = new AccessTicketHandler(loggerFactory, _htsConnectionHandler, requestTimeout, retries, lifeSpan, Recording);
            }

            //Added for stream probing
            _mediaEncoder = mediaEncoder;
        }