Ejemplo n.º 1
0
			public PullAndPushJob(PlayEngine engine) {
				_engine = engine;
			}
Ejemplo n.º 2
0
		public override void Start() {
			// Ensure the play engine exists
			if (_engine == null) {
				IScope scope = this.Scope;
				if (scope != null) {
					ISchedulingService schedulingService = scope.GetService(typeof(ISchedulingService)) as ISchedulingService;
					IConsumerService consumerService = scope.GetService(typeof(IConsumerService)) as IConsumerService;
					IProviderService providerService = scope.GetService(typeof(IProviderService)) as IProviderService;
					_engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).Build();
				} else {
					if (log.IsErrorEnabled)
						log.Error("Scope was null on start");
				}
			}

			// Create bw control service and register myself
			// Bandwidth control service should not be bound to a specific scope because it's designed to control
			// the bandwidth system-wide.
			_bwController = this.Scope.GetService(typeof(IBWControlService)) as IBWControlService;
			_bwContext = _bwController.RegisterBWControllable(this);
			//Set bandwidth members on the engine
			_engine.SetBandwidthController(_bwController, _bwContext);
			//Set buffer check interval
			_engine.BufferCheckInterval = _bufferCheckInterval;
			//Set underrun trigger
			_engine.UnderrunTrigger = _underrunTrigger;
			// Start playback engine
			_engine.Start();
			// Notify subscribers on start
			NotifySubscriberStart();
		}
Ejemplo n.º 3
0
			public PlaylistSubscriberStreamJob2(PlayEngine engine, string itemName) {
				_engine = engine;
				_itemName = itemName;
			}
Ejemplo n.º 4
0
		/// <summary>
		/// Creates a play engine based on current services (scheduling service, consumer service, and provider service).
		/// </summary>
		/// <param name="schedulingService">The scheduling service.</param>
		/// <param name="consumerService">The consumer service.</param>
		/// <param name="providerService">The provider service.</param>
		/// <returns>Play engine.</returns>
		PlayEngine CreateEngine(ISchedulingService schedulingService, IConsumerService consumerService, IProviderService providerService) {
			_engine = new PlayEngine.Builder(this, schedulingService, consumerService, providerService).Build();
			return _engine;
		}