public async Task Invoke(HttpContext httpContext, IStreamingService streamingService) { PathString startPath = $"{_options.Path}/push"; PathString remainingPath; if (httpContext.Request.Path.StartsWithSegments(startPath, out remainingPath)) { CancellationToken cancellationToken = httpContext.RequestAborted; var segments = remainingPath.Value.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); if (segments == null || !segments.Any() || string.IsNullOrWhiteSpace(segments[0])) { var innerEx = new Exception($"The expected path must start with '{startPath}/{{channel}}', where {{channel}} represents the streaming channel name"); throw new ArgumentNullException("channel", innerEx); } var channelName = segments[0]; var streamingRequest = new HttpStreamingRequest { Name = channelName, HttpContext = httpContext, CancellationToken = cancellationToken }; await streamingService.Process(streamingRequest); } else { await _next.Invoke(httpContext); } }
public MainViewModel(IStreamingService streamingService, IMvxNavigationService navigationService, IMvxTrace trace) : base(navigationService, trace) { _streamingService = streamingService; _navigationService = navigationService; _status = "God's Way Radio - 104.7"; _streamingService.LoadStream(); }
public MainViewModel(CognitiveClient cognitiveClient, IStreamingService streamingService, ISpeechService speechService) { this.cognitiveClient = cognitiveClient; this.streamingService = streamingService; this.speechService = speechService; this.CreateCommands(); }
public OAuthWindowView(IStreamingService streamingService, IConfigHandler configHandler) { InitializeComponent(); this.streamingService = streamingService ?? throw new ArgumentNullException(nameof(streamingService)); this.configHandler = configHandler ?? throw new ArgumentNullException(nameof(configHandler)); OAuthWebBrowser.Source = new Uri(streamingService.OAuthUrl); OAuthWebBrowser.NavigationStarting += OAuthWebBrowser_NavigationStarting; }
public TaleSourcesController( ILogger <TaleSourcesController> logger, IStreamingService streamingService, ITalesRepository talesRepository) { _logger = logger; _streamingService = streamingService; _talesRepository = talesRepository; }
public DomainCustomersService( ICustomersRepository customersRepository, IPaymentService paymentService, IStreamingService streamingService) { this.customersRepository = customersRepository; this.paymentService = paymentService; this.streamingService = streamingService; }
public MainViewModel(IStreamingService streamingService, VisionServiceClient visionServiceClient, ITranslatorService translatorService, ISpeechService speechService) { this.streamingService = streamingService; this.visionServiceClient = visionServiceClient; this.translatorService = translatorService; this.speechService = speechService; this.CreateCommands(); }
public MainViewModel(IStreamingService streamingService, ISpeechService speechService) { this.streamingService = streamingService; this.speechService = speechService; this.CreateCommands(); // Initializes vision extensions. var visionInitializeTask = VisionExtensions.InitializeAsync(); }
public MovieAcquisitionService( ICustomersRepository customersRepository, IPaymentService paymentService, IStreamingService streamingService ) { this.customersRepository = customersRepository; this.paymentService = paymentService; this.streamingService = streamingService; }
public void RunAllScenarios(IStreamingService channel) { var requestedStreamSize = (Interlocked.Increment(ref _curStreamSize) * 3 + 1) % MaxStreamSize; // Are variations of the buffer size important? // Maybe, since just like the stream size they contribute to timing variations... var bufSize = Interlocked.Increment(ref _curBufferSize) % MaxBufferSize + 2; // Just run all 3 streaming scenarios here TestGetStreamFromInt(channel, requestedStreamSize, bufSize); TestGetIntFromStream(channel, requestedStreamSize, bufSize); TestEchoStream(channel, requestedStreamSize, bufSize); }
private void TestGetIntFromStream(IStreamingService channel, int requestedStreamSize, int bufSize) { using (var stream = new VerifiableStream(requestedStreamSize)) { int receivedSize = channel.GetIntFromStream(stream); if (receivedSize != requestedStreamSize) { Console.WriteLine("We didn't receive the correct stream size. Stream size: " + requestedStreamSize + "received: " + receivedSize); System.Diagnostics.Debugger.Break(); } } }
private void TestGetStreamFromInt(IStreamingService channel, int requestedStreamSize, int bufSize) { using (var stream = channel.GetStreamFromInt(requestedStreamSize)) { var receivedStreamSize = VerifyStream(stream, requestedStreamSize, bufSize); if (receivedStreamSize != requestedStreamSize) { Console.WriteLine("Received stream is different size from the requested one. Expected size: " + requestedStreamSize + " received: " + receivedStreamSize); //if (requestedStreamSize % 384 != 0) System.Diagnostics.Debugger.Break(); } } }
private void TestEchoStream(IStreamingService channel, int requestedStreamSize, int bufSize) { using (var stream = new VerifiableStream(requestedStreamSize)) { using (var receivedStream = channel.EchoStream(stream)) { var receivedSize = VerifyStream(receivedStream, requestedStreamSize, bufSize); if (receivedSize != requestedStreamSize) { Console.WriteLine("Unexpected stream size: " + receivedSize); //if (requestedStreamSize % 384 != 0) System.Diagnostics.Debugger.Break(); } } } }
private void cmdConnect_Click(object sender, EventArgs e) { if (CURRENT_IP == "127.0.0.1" || CURRENT_IP == "localhost") { mWebStreamClient = ChannelFactory <IWebStreamingService> .CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/MPExtended/StreamingService")); mStreamClient = ChannelFactory <IStreamingService> .CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/MPExtended/StreamingService")); mServiceClient = ChannelFactory <IMediaAccessService> .CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/MPExtended/MediaAccessService")); mTvClient = ChannelFactory <ITVAccessService> .CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/MPExtended/TVAccessService")); } else { #pragma warning disable 0162 mWebStreamClient = ChannelFactory <IWebStreamingService> .CreateChannel(new BasicHttpBinding(), new EndpointAddress("http://" + CURRENT_IP + ":4321/MPExtended/StreamingService")); mStreamClient = ChannelFactory <IStreamingService> .CreateChannel(new BasicHttpBinding(), new EndpointAddress("http://" + CURRENT_IP + ":4321/MPExtended/StreamingService")); mServiceClient = ChannelFactory <IMediaAccessService> .CreateChannel(new BasicHttpBinding(), new EndpointAddress("http://" + CURRENT_IP + ":4321/MPExtended/MediaAccessService")); mTvClient = ChannelFactory <ITVAccessService> .CreateChannel(new BasicHttpBinding(), new EndpointAddress("http://" + CURRENT_IP + ":4321/MPExtended/TVAccessService")); #pragma warning restore 0162 } Log("Initialized"); // providers var config = mServiceClient.GetServiceDescription(); movieProvider = config.AvailableMovieLibraries.First().Id; fileProvider = config.AvailableFileSystemLibraries.First().Id; // load movies try { cbMovies.Items.Clear(); mMovies = mServiceClient.GetMoviesDetailed(movieProvider, null, null); foreach (WebMovieDetailed movie in mMovies) { cbMovies.Items.Add(movie.Title); } Log("Loaded movies"); } catch (Exception) { Log("Failed to connect to MAS"); } // load chanels try { cbChannels.Items.Clear(); mChannels = new List <WebChannelBasic>(); foreach (WebChannelGroup group in mTvClient.GetGroups()) { WebChannelBasic[] channels = mTvClient.GetChannelsBasic(group.Id).ToArray(); foreach (WebChannelBasic ch in channels) { cbChannels.Items.Add(ch.Title); mChannels.Add(ch); } } Log("Loaded channels"); } catch (Exception) { Log("Failed to connect to TV4Home"); } // load profiles try { cbProfiles.Items.Clear(); mProfiles = mWebStreamClient.GetTranscoderProfiles(); foreach (WebTranscoderProfile profile in mProfiles) { cbProfiles.Items.Add(profile.Name); } cbProfiles.SelectedIndex = 0; } catch (Exception) { Log("Failed to load profiles"); } }
public CameraController(ILogger <CameraController> logger, IStreamingService streamingService) { this.logger = logger; this.streamingService = streamingService; }
public RemoveAndArchiveTracksCommandHandler(IStreamingService spotifyService) { _SpotifyService = spotifyService; }
public NowPlayingViewModel(IStreamingService streamingService, IMvxNavigationService navigationService, IDeviceTimer deviceTimer, IMvxTrace trace) : base(navigationService, trace) { _navigationService = navigationService; _deviceTimer = deviceTimer; }
public ResolveUserThroughTokenCommandHandler(IStreamingService streamingService) { _StreamingService = streamingService; }
public StartStreamCommand(IStreamingService streamingService) { this.streamingService = streamingService; }
public StreamingEndpoint(ILogger logger, IStreamingService streamingService, IMessageBus messageBus) { _logger = logger; _streamingService = streamingService; _messageBus = messageBus; }
private void cmdConnect_Click(object sender, EventArgs e) { if (CURRENT_IP == "127.0.0.1" || CURRENT_IP == "localhost") { mWebStreamClient = ChannelFactory<IWebStreamingService>.CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/MPExtended/StreamingService")); mStreamClient = ChannelFactory<IStreamingService>.CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/MPExtended/StreamingService")); mServiceClient = ChannelFactory<IMediaAccessService>.CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/MPExtended/MediaAccessService")); mTvClient = ChannelFactory<ITVAccessService>.CreateChannel(new NetNamedPipeBinding() { MaxReceivedMessageSize = 10000000 }, new EndpointAddress("net.pipe://localhost/MPExtended/TVAccessService")); } else { #pragma warning disable 0162 mWebStreamClient = ChannelFactory<IWebStreamingService>.CreateChannel(new BasicHttpBinding(), new EndpointAddress("http://" + CURRENT_IP + ":4321/MPExtended/StreamingService")); mStreamClient = ChannelFactory<IStreamingService>.CreateChannel(new BasicHttpBinding(), new EndpointAddress("http://" + CURRENT_IP + ":4321/MPExtended/StreamingService")); mServiceClient = ChannelFactory<IMediaAccessService>.CreateChannel(new BasicHttpBinding(), new EndpointAddress("http://" + CURRENT_IP + ":4321/MPExtended/MediaAccessService")); mTvClient = ChannelFactory<ITVAccessService>.CreateChannel(new BasicHttpBinding(), new EndpointAddress("http://" + CURRENT_IP + ":4321/MPExtended/TVAccessService")); #pragma warning restore 0162 } Log("Initialized"); // providers var config = mServiceClient.GetServiceDescription(); movieProvider = config.AvailableMovieLibraries.First().Id; fileProvider = config.AvailableFileSystemLibraries.First().Id; // load movies try { cbMovies.Items.Clear(); mMovies = mServiceClient.GetAllMoviesDetailed(movieProvider, null, null); foreach (WebMovieDetailed movie in mMovies) { cbMovies.Items.Add(movie.Title); } Log("Loaded movies"); } catch (Exception) { Log("Failed to connect to MAS"); } // load chanels try { cbChannels.Items.Clear(); mChannels = new List<WebChannelBasic>(); foreach (WebChannelGroup group in mTvClient.GetGroups()) { WebChannelBasic[] channels = mTvClient.GetChannelsBasic(group.Id).ToArray(); foreach (WebChannelBasic ch in channels) { cbChannels.Items.Add(ch.DisplayName); mChannels.Add(ch); } } Log("Loaded channels"); } catch (Exception) { Log("Failed to connect to TV4Home"); } // load profiles try { cbProfiles.Items.Clear(); mProfiles = mWebStreamClient.GetTranscoderProfiles(); foreach (WebTranscoderProfile profile in mProfiles) { cbProfiles.Items.Add(profile.Name); } cbProfiles.SelectedIndex = 0; } catch (Exception) { Log("Failed to load profiles"); } }
public CreateOrUpdateUserCommandHandler(IStreamingService streamingService, IMediator mediator) { _StreamingService = streamingService; _Mediator = mediator; }
public VideosController(IStreamingService streamingService) { _streamingService = streamingService; }
public SortPlaylistCommandHandler(IStreamingService spotifyService) { _SpotifyService = spotifyService; }