CSharpRTMP.Core.Protocols.Rtmfp.Publication.PushVideoPacket C# (CSharp) Метод

PushVideoPacket() публичный Метод

public PushVideoPacket ( uint time, N2HBinaryReader packet, uint numberLostFragments ) : void
time uint
packet CSharpRTMP.Common.N2HBinaryReader
numberLostFragments uint
Результат void
        public void PushVideoPacket(uint time, N2HBinaryReader packet, uint numberLostFragments)
        {
            if (PublisherId == 0)
            {
                Logger.FATAL("Video packet pushed on a publication {0} who is idle", PublisherId);
                return;
            }
            if (numberLostFragments > 0) _firstKeyFrame = false;
            VideoQOS.Add(time,packet.Fragments,numberLostFragments,(uint) (packet.BaseStream.GetAvaliableByteCounts()+5),(uint) (_publisher!=null?_publisher.Ping:0));
            if (numberLostFragments > 0)
                Logger.INFO("{0} video fragments lost on publication {1}", numberLostFragments, PublisherId);
            var pos = packet.BaseStream.Position;
            var temp = packet.ReadByte();
            var temp2 = packet.ReadByte();
            packet.BaseStream.Position = pos;
            if ((temp & 0xF0) == 0x10)
            {
                _firstKeyFrame = true;
                if (temp == 0x17 && temp2 == 0)
                {
                    packet.BaseStream.CopyDataTo(VideoCodecBuffer);
                    VideoCodecBuffer.Position = 0;
                }
            }
            if (!_firstKeyFrame)
            {
                VideoQOS.DroppedFrames++;
                return;
            }
           
            foreach (var listener in Listeners)
            {
                listener.Value.PushVideoPacket(time,packet);
                //packet.BaseStream.Position = pos;
            }
            _publisher.OnVideoPacket(this, time, packet);
        }
    }