コード例 #1
0
        public NetworkPlayback(string filename)
        {
            ChunkAssembler assembler = new ChunkAssembler();
            NetworkArchiver archiver = new NetworkArchiver();
            archiver.OpenArchive(filename);

            while (archiver.HasMoreEvents()) {
                //Get the current event
                NetworkEvent ne = archiver.GetNextEvent();
                if (ne != null) {
                    //Add it to the chunkEvents (which contains everything)
                    this.chunkEvents.Add(ne);
                    if (ne is NetworkChunkEvent) {
                        NetworkChunkEvent nce = (NetworkChunkEvent)ne;
                        //Add it to the chunk assembler
                        Message m = assembler.Add(nce.chunk);
                        if (m != null) {
                            //We have a complete message!
                            NetworkMessageEvent nme = new NetworkMessageEvent(m, ne.timeIndex, ne.source);
                            this.messageEvents.Add(nme);
                        }
                    } else if (ne is NetworkMessageEvent) {
                        this.messageEvents.Add(((NetworkMessageEvent)ne).message);
                    } else {
                        //Skip
                    }
                }
            }
            archiver.CloseArchive();
        }
コード例 #2
0
 public RTPReceiveConnection(IPEndPoint ip, NetworkArchiver na)
 {
     RtpEvents.RtpStreamAdded += new MSR.LST.Net.Rtp.RtpEvents.RtpStreamAddedEventHandler(this.handleRtpStreamAdded);
     RtpEvents.RtpStreamRemoved += new MSR.LST.Net.Rtp.RtpEvents.RtpStreamRemovedEventHandler(this.handleRtpStreamRemoved);
     this.m_Participant = new RtpParticipant("Recorder", "Recorder");
     this.m_Session = new RtpSession(ip, this.m_Participant, true, true);
     this.m_archiver = na;
 }
コード例 #3
0
ファイル: RTPConnection.cs プロジェクト: zhujingcheng/CP3
 public RTPReceiveConnection(IPEndPoint ip, NetworkArchiver na)
 {
     RtpEvents.RtpStreamAdded   += new MSR.LST.Net.Rtp.RtpEvents.RtpStreamAddedEventHandler(this.handleRtpStreamAdded);
     RtpEvents.RtpStreamRemoved += new MSR.LST.Net.Rtp.RtpEvents.RtpStreamRemovedEventHandler(this.handleRtpStreamRemoved);
     this.m_Participant          = new RtpParticipant("Recorder", "Recorder");
     this.m_Session              = new RtpSession(ip, this.m_Participant, true, true);
     this.m_archiver             = na;
 }