Beispiel #1
0
        public bool ReaderCheckConfigure(H264Configurator h264Configurator)
        {
            if (!this._slicePicParameterSetId.HasValue || !this._ppsSeqParameterSetId.HasValue || !this._seqParameterSetId.HasValue)
            {
                return(false);
            }
            uint?nullable1 = this._slicePicParameterSetId;
            uint?nullable2 = this._picParameterSetId;
            int  num;

            if (((int)nullable1.GetValueOrDefault() != (int)nullable2.GetValueOrDefault() ? 0 : (nullable1.HasValue == nullable2.HasValue ? 1 : 0)) != 0)
            {
                nullable1 = this._ppsSeqParameterSetId;
                nullable2 = this._seqParameterSetId;
                num       = ((int)nullable1.GetValueOrDefault() != (int)nullable2.GetValueOrDefault() ? 0 : (nullable1.HasValue == nullable2.HasValue ? 1 : 0)) == 0 ? 1 : 0;
            }
            else
            {
                num = 1;
            }
            if (num != 0)
            {
                return(false);
            }
            if (!this.ComputeFrameRate())
            {
                Debug.WriteLine("H264Reader.ReaderCheckConfigure() unable to get frame rate");
            }
            return(true);
        }
Beispiel #2
0
 public void TryReparseTimingSei(H264Configurator h264Configurator)
 {
     if (this._timingBytes == null || !this._seqParameterSetId.HasValue)
     {
         return;
     }
     h264Configurator.ParseSei(this._timingBytes);
 }
 public H264StreamHandler(PesStreamParameters parameters)
     : base(parameters)
 {
     if (null == parameters)
     {
         throw new ArgumentNullException("parameters");
     }
     if (null == parameters.PesPacketPool)
     {
         throw new ArgumentException("PesPacketPool cannot be null", "parameters");
     }
     if (null == parameters.NextHandler)
     {
         throw new ArgumentException("NextHandler cannot be null", "parameters");
     }
     this._pesPacketPool = parameters.PesPacketPool;
     this._nextHandler   = parameters.NextHandler;
     this._configurator  = new H264Configurator(parameters.MediaStreamMetadata, parameters.StreamType.Description);
     this._parser        = new NalUnitParser(new Func <byte, NalUnitParser.ParserStateHandler>(this.ResolveHandler));
 }