Ejemplo n.º 1
0
        /// <summary>
        /// Starts recording a conference. Sets up the conference data and then records all streams received until told to stop.
        /// </summary>
        public void RecordConference(string conferenceDescription, string venueIdentifier, IPEndPoint venue)
        {
            if (conferenceDescription.Length >= Constants.MaxDBStringSize || venueIdentifier.Length >= Constants.MaxDBStringSize)
            {
                throw new ArgumentException("String longer than accepted by database.");
            }

            recording = true;
            venueIPE  = venue;

            streams      = new Hashtable(Constants.InitialStreams);
            participants = new Hashtable();

            conferenceID = DBHelper.CreateConference(conferenceDescription, venueIdentifier, DateTime.Now);

            // Store info about this conference to the instance, for debugging reference (mostly)
            this.conferenceDescription = conferenceDescription;
            this.venueIdentifier       = venueIdentifier;
            this.venue = venue;

            // Create our performance counter
            perfCounter = new ConferenceRecorderPC(venueIdentifier + " : " + conferenceDescription);

            // Set up RTCP properties
            RtpEvents.RtpParticipantAdded += new MSR.LST.Net.Rtp.RtpEvents.RtpParticipantAddedEventHandler(this.OnNewRtpParticipant);
            RtpEvents.RtpStreamAdded      += new MSR.LST.Net.Rtp.RtpEvents.RtpStreamAddedEventHandler(this.OnNewRtpStream);
            RtpEvents.RtpStreamRemoved    += new MSR.LST.Net.Rtp.RtpEvents.RtpStreamRemovedEventHandler(this.OnRtpStreamRemoved);

            // Start listening
            RtpParticipant rtpMe = new RtpParticipant(Constants.PersistenceCName, Constants.PersistenceName + " (RECORDING)");

            rtpSession = new RtpSession(venue, rtpMe, true, true);
        }