// Summary:
 //     Initializes a new instance of the System.Windows.Media.MediaStreamSource
 //     class.
 public HLSMediaStreamSource(HLSMediaStreamSourceOpenParam openParam)
 {
     _openParam = new HLSMediaStreamSourceOpenParam(openParam);
     _bwHistory = new HttpLiveStreaming.BandwidthHistory(openParam.initialBandwidth);
     _playlist = new HLSPlaylist(openParam.uri);
     _playlist.MSS = this;
     Construct();
 }
Пример #2
0
        /// <summary>
        /// Special constructor for creating new demux for next stream in sequence
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="previousDemux"></param>
        public TSDemux(EncryptedStream stream, TSDemux previousDemux, IContainerMetadata metadata, uint bitrate, BandwidthHistory BWHistory)
        {
            if (previousDemux == null)
                throw new ArgumentNullException("previousDemux");

            CommonConstruct(stream, previousDemux._audioBuffer, previousDemux._videoBuffer, metadata, bitrate, BWHistory);

            if (!stream.Discontinuity)
                _streams = previousDemux._streams;

            _audioFormatParser = previousDemux._audioFormatParser;
            _videoFormatParser = previousDemux._videoFormatParser;
            _audioFormatParser.HLSStream = stream.HLSStream;
            _videoFormatParser.HLSStream = stream.HLSStream;
        }
Пример #3
0
        /// <summary>
        /// Common construction code for all constructors
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="audioBuffer"></param>
        /// <param name="videoBuffer"></param>
        private void CommonConstruct(EncryptedStream stream, SampleBuffer audioBuffer,
                                    SampleBuffer videoBuffer, IContainerMetadata metadata, uint bitrate,
                                    BandwidthHistory BWHistory)
        {
            if (stream == null)
                throw new ArgumentNullException("stream");
            _stream = stream;
            _metadata = metadata;
            _audioBuffer = audioBuffer;
            _audioBuffer.ResetOnSegmentStart();
            _videoBuffer = videoBuffer;
            _videoBuffer.ResetOnSegmentStart();

            _previousReadEndTime = stream.RequestStartTime;

            _bitrate = bitrate;

            _downloadChunkBuffer = new byte[_downloadChunkSize];
            _TSPacketBuffer = new byte[TSPacketSize];

            _BWHistory = BWHistory;
        }
Пример #4
0
 /// <summary>
 ///  Default constructor.
 /// </summary>
 /// <param name="stream"></param>
 /// <param name="audioBuffer"></param>
 /// <param name="videoBuffer"></param>
 public TSDemux(EncryptedStream stream, SampleBuffer audioBuffer,
                SampleBuffer videoBuffer, IContainerMetadata metadata, uint bitrate, 
                BandwidthHistory BWHistory)
 {
     CommonConstruct(stream, audioBuffer, videoBuffer, metadata, bitrate, BWHistory);
 }