static void OnChunkTested(SmoothStreamPerformanceTest test, SmoothStreamChunk chunk, ChunkResponse chunkResponse) { var rating = new ChunkResponseAnalyzer().RateChunkResponse(chunk, chunkResponse); string ratingText = rating.ToString(); if (!_ratingCounters.ContainsKey(ratingText)) { _ratingCounters[ratingText] = 0; } _ratingCounters[ratingText] += 1; }
static void Main(string[] args) { bool verbose = false; if (0 == args.Count()) { Console.WriteLine("Usage : smoothrunner url [-v]"); return; } // get input video uri string inputVideo = args[0]; if (args.Count() > 1) { verbose = args[1] == "-v"; } SmoothStreamPerformanceTest _test = null; //ManifestParser parser = new ManifestParser(); //parser.ParseManifest(new Uri(myUrl)); _test = new SmoothStreamPerformanceTest(new Uri(inputVideo)); _test.PerformanceTestUpdated += new PerformanceTestUpdateInfoEvent(OnPerformanceTestUpdated); _test.ChunkTested += new ChunkTestedEvent(OnChunkTested); //_test.StartAsync(); _test.RunTestAsync(); foreach (var item in _ratingCounters) { Console.WriteLine("Key : {0} with value {1}", item.Key.ToString(), item.Value.ToString()); } }
static void OnPerformanceTestUpdated(SmoothStreamPerformanceTest test, string message) { Console.WriteLine("OnPerformanceTestUpdated : Test {0} -> Message{}", test.ToString(), message); }