protected override void InitStrategy()
        {
            var settings = new WebStationStreamingSettings();

            _strategy = new WeightedWindowPrefetchingStrategy(
                new StreamingCorePrefetchingStrategy(), _loaderName, SR.DescriptionWebStationPrefetchingStrategy)
            {
                Enabled = settings.RetrieveConcurrency > 0,
                RetrievalThreadConcurrency     = Math.Max(settings.RetrieveConcurrency, 1),
                DecompressionThreadConcurrency = Math.Max(settings.DecompressConcurrency, 1),
                FrameLookAheadCount            = settings.ImageWindow >= 0 ? (int?)settings.ImageWindow : null,
                SelectedImageBoxWeight         = Math.Max(settings.SelectedWeighting, 1),
                UnselectedImageBoxWeight       = Math.Max(settings.UnselectedWeighting, 0)
            };

            PrefetchingStrategy = _strategy;

            if (Platform.IsLogLevelEnabled(LogLevel.Debug))
            {
                StringBuilder message = new StringBuilder();
                message.AppendLine(String.Format("Streaming Prefetch Strategy: {0}", _strategy.Name));
                message.AppendLine(String.Format("\tEnabled: {0}", _strategy.Enabled ? "Yes" : "No"));
                message.AppendLine(String.Format("\tRetrieval Thread Concurrency: {0}", _strategy.RetrievalThreadConcurrency));
                message.AppendLine(String.Format("\tDecompression Thread Concurrency: {0}", _strategy.DecompressionThreadConcurrency));
                message.AppendLine(String.Format("\tFrame Lookahead Count: {0}", _strategy.FrameLookAheadCount));
                message.AppendLine(String.Format("\tSelected Imagebox Weight: {0}", _strategy.SelectedImageBoxWeight));
                message.AppendLine(String.Format("\tUnselected Imagebox Weight: {0}", _strategy.UnselectedImageBoxWeight));

                Platform.Log(LogLevel.Debug, message.ToString());
            }
        }
Ejemplo n.º 2
0
        protected override void InitStrategy()
        {
            var settings = new WebStationStreamingSettings();
            
            _strategy = new WeightedWindowPrefetchingStrategy(
                new StreamingCorePrefetchingStrategy(), _loaderName, SR.DescriptionWebStationPrefetchingStrategy)
                                      {
                                          Enabled = settings.RetrieveConcurrency > 0,
                                          RetrievalThreadConcurrency = Math.Max(settings.RetrieveConcurrency, 1),
                                          DecompressionThreadConcurrency = Math.Max(settings.DecompressConcurrency, 1),
                                          FrameLookAheadCount = settings.ImageWindow >= 0 ? (int?)settings.ImageWindow : null,
                                          SelectedImageBoxWeight = Math.Max(settings.SelectedWeighting, 1),
                                          UnselectedImageBoxWeight = Math.Max(settings.UnselectedWeighting, 0)
                                      };

            PrefetchingStrategy = _strategy;

            if (Platform.IsLogLevelEnabled(LogLevel.Debug))
            {
                StringBuilder message = new StringBuilder();
                message.AppendLine(String.Format("Streaming Prefetch Strategy: {0}", _strategy.Name));
                message.AppendLine(String.Format("\tEnabled: {0}", _strategy.Enabled ? "Yes" : "No"));
                message.AppendLine(String.Format("\tRetrieval Thread Concurrency: {0}", _strategy.RetrievalThreadConcurrency));
                message.AppendLine(String.Format("\tDecompression Thread Concurrency: {0}", _strategy.DecompressionThreadConcurrency));
                message.AppendLine(String.Format("\tFrame Lookahead Count: {0}", _strategy.FrameLookAheadCount));
                message.AppendLine(String.Format("\tSelected Imagebox Weight: {0}", _strategy.SelectedImageBoxWeight));
                message.AppendLine(String.Format("\tUnselected Imagebox Weight: {0}", _strategy.UnselectedImageBoxWeight));

                Platform.Log(LogLevel.Debug, message.ToString());                
            }
        }