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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
 public TsMediaManager(ISegmentReaderManagerFactory segmentReaderManagerFactory, IMediaElementManager mediaElementManager, IMediaStreamSource mediaStreamSource, Func<Buffering.IBufferingManager> bufferingManagerFactory, IMediaManagerParameters mediaManagerParameters, IMediaParserFactory mediaParserFactory, IPlatformServices platformServices);
Exemple #4
0
 public TsMediaManager(ISegmentReaderManagerFactory segmentReaderManagerFactory, IMediaElementManager mediaElementManager, IMediaStreamSource mediaStreamSource, Func <Buffering.IBufferingManager> bufferingManagerFactory, IMediaManagerParameters mediaManagerParameters, IMediaParserFactory mediaParserFactory, IPlatformServices platformServices);
Exemple #5
0
 public static void SetParameter(this IMediaStreamFacadeBase mediaStreamFacade, IMediaManagerParameters parameters)
 {
     mediaStreamFacade.Builder.RegisterSingleton <IMediaManagerParameters>(parameters);
 }
Exemple #6
0
 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);
 public static void SetParameter(this IMediaStreamFascade mediaStreamFascade, IMediaManagerParameters parameters);