public H264StreamHandler(PesStreamParameters parameters) : base(parameters) { if (null == parameters) throw new ArgumentNullException(nameof(parameters)); if (null == parameters.PesPacketPool) throw new ArgumentException("PesPacketPool cannot be null", nameof(parameters)); if (null == parameters.NextHandler) throw new ArgumentException("NextHandler cannot be null", nameof(parameters)); _pesPacketPool = parameters.PesPacketPool; _nextHandler = parameters.NextHandler; _configurator = new H264Configurator(parameters.MediaStreamMetadata, parameters.StreamType.Description); _parser = new NalUnitParser(ResolveHandler); }
public void TryReparseTimingSei(H264Configurator h264Configurator) { if (null != _timingBytes && _seqParameterSetId.HasValue) h264Configurator.ParseSei(_timingBytes); }
public bool ReaderCheckConfigure(H264Configurator h264Configurator) { if (!_slicePicParameterSetId.HasValue || !_ppsSeqParameterSetId.HasValue || !_seqParameterSetId.HasValue) return false; if (_slicePicParameterSetId == _picParameterSetId && _ppsSeqParameterSetId == _seqParameterSetId) { var gotFrameRate = ComputeFrameRate(); if (!gotFrameRate) Debug.WriteLine("H264Reader.ReaderCheckConfigure() unable to get frame rate"); return true; } return false; }