public AudioTrackStreamer() { Debug.WriteLine("AudioTrackStreamer ctor"); _mediaManagerParameters = new MediaManagerParameters { ProgramStreamsHandler = streams => { var firstAudio = streams.Streams.FirstOrDefault(x => x.StreamType.Contents == TsStreamType.StreamContents.Audio); var others = null == firstAudio ? streams.Streams : streams.Streams.Where(x => x.Pid != firstAudio.Pid); foreach ( var programStream in others) programStream.BlockStream = true; } }; MediaStreamFacadeSettings.Parameters.UseHttpConnection = true; //MediaStreamFacadeSettings.Parameters.UseSingleStreamMediaManager = true; _bufferingPolicy = new DefaultBufferingPolicy { BytesMinimumStarting = 24 * 1024, BytesMinimum = 64 * 1024 }; _metadataHandler = new AudioMetadataHandler(_cancellationTokenSource.Token); }
public SmMediaManager(ISegmentReaderManagerFactory segmentReaderManagerFactory, IMediaStreamConfigurator mediaStreamConfigurator, Func<IBufferingManager> bufferingManagerFactory, IMediaManagerParameters mediaManagerParameters, IMediaParserFactory mediaParserFactory) { if (null == segmentReaderManagerFactory) throw new ArgumentNullException(nameof(segmentReaderManagerFactory)); if (null == mediaStreamConfigurator) throw new ArgumentNullException(nameof(mediaStreamConfigurator)); if (null == bufferingManagerFactory) throw new ArgumentNullException(nameof(bufferingManagerFactory)); _segmentReaderManagerFactory = segmentReaderManagerFactory; _mediaStreamConfigurator = mediaStreamConfigurator; _bufferingManagerFactory = bufferingManagerFactory; _mediaParserFactory = mediaParserFactory; _programStreamsHandler = mediaManagerParameters.ProgramStreamsHandler; // Start with a canceled token (i.e., we are not playing) _playbackCancellationTokenSource.Cancel(); _playbackTaskCompletionSource.TrySetResult(null); _reportStateTask = new SignalTask(ReportState); }
public TsMediaManager(ISegmentReaderManagerFactory segmentReaderManagerFactory, IMediaElementManager mediaElementManager, IMediaStreamSource mediaStreamSource, Func<Buffering.IBufferingManager> bufferingManagerFactory, IMediaManagerParameters mediaManagerParameters, IMediaParserFactory mediaParserFactory, IPlatformServices platformServices);
public TsMediaManager(ISegmentReaderManagerFactory segmentReaderManagerFactory, IMediaElementManager mediaElementManager, IMediaStreamSource mediaStreamSource, Func <Buffering.IBufferingManager> bufferingManagerFactory, IMediaManagerParameters mediaManagerParameters, IMediaParserFactory mediaParserFactory, IPlatformServices platformServices);
public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IMediaManagerParameters parameters) { mediaStreamFacade.Builder.RegisterSingleton <IMediaManagerParameters>(parameters); }
public SmMediaManager(ISegmentReaderManagerFactory segmentReaderManagerFactory, IMediaStreamConfigurator mediaStreamConfigurator, Func <IBufferingManager> bufferingManagerFactory, IMediaManagerParameters mediaManagerParameters, IMediaParserFactory mediaParserFactory) { if (null == segmentReaderManagerFactory) { throw new ArgumentNullException("segmentReaderManagerFactory"); } if (null == mediaStreamConfigurator) { throw new ArgumentNullException("mediaStreamConfigurator"); } if (null == bufferingManagerFactory) { throw new ArgumentNullException("bufferingManagerFactory"); } _segmentReaderManagerFactory = segmentReaderManagerFactory; _mediaStreamConfigurator = mediaStreamConfigurator; _bufferingManagerFactory = bufferingManagerFactory; _mediaParserFactory = mediaParserFactory; _programStreamsHandler = mediaManagerParameters.ProgramStreamsHandler; _playbackCancellationTokenSource.Cancel(); _playbackTaskCompletionSource.TrySetResult((object)null); _reportStateTask = new SignalTask(ReportState); }
public static void SetParameter(this IMediaStreamFascade mediaStreamFascade, IMediaManagerParameters parameters);