Events contains all the events raised by the Rtp/Rtcp code Each event consists of 4 items - an EventArgs, a Delegate, an Event and an internal method Raise*Event that actually fires the event, and if the event is not hooked logs information to the EventLog. Because all our events follow the same pattern, they have been streamlined to call a single method (FireEvent) to actually fire them. This method uses the delegate's invocation list to call the hooked methods in a non-linked list format Due to our use of the static EventThrower which calls all events from a single thread, all methods in this class are static as well. They are not meant to be called in a multi-threaded way (although it would probably work fine since no static members are touched). Consideration was given to breaking these down by Rtp, Rtcp and shared (Rtp + Rtcp) events but due to the limited number of events it wasn't deemed necessary. It would be interesting to query our API users to see how many of them use the events and which events they use - Rtp, Rtcp or Shared
Beispiel #1
0
 protected virtual void RtpStreamRemoved(object sender, RtpEvents.RtpStreamEventArgs ea)
 {
     if (ChannelType == ea.RtpStream.PayloadType)
         ea.RtpStream.FrameReceived -= new RtpStream.FrameReceivedEventHandler(FrameReceived);
 }
 protected override void ParticipantAdded(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     fModel.AddPendingParticipant(ea.RtpParticipant);
 }
Beispiel #3
0
 public WorkItem(RtpEvents.RaiseEvent method, object[] parameters)
 {
     this.method = method;
     this.parameters = parameters;
 }
Beispiel #4
0
 protected override void ParticipantRemoved(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     Console.WriteLine("Removed: CNAME: {0} Name: {1}", 
         ea.RtpParticipant.CName, ea.RtpParticipant.Name);
 }
Beispiel #5
0
 protected virtual void RtpStreamAdded(object sender, RtpEvents.RtpStreamEventArgs ea)
 {
     ea.RtpStream.FrameReceived += new RtpStream.FrameReceivedEventHandler(FrameReceived);
 }
Beispiel #6
0
        /// <summary>
        /// Put a work item on a queue for in order execution by a background thread.
        /// </summary>
        /// <param name="del">The delegate that will be called.</param>
        /// <param name="parameters">The parameters that will be passed to the delegate</param>
        internal static void QueueUserWorkItem(RtpEvents.RaiseEvent del, object[] parameters)
        {
            syncWorkItems.Enqueue(new WorkItem(del, parameters));

            if( peakQueueLength < syncWorkItems.Count )
                peakQueueLength = syncWorkItems.Count;
            
            newWorkItem.Set();
        }
Beispiel #7
0
 protected virtual void ParticipantJoined(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     //Console.WriteLine("Participant Joined: {0}", ea.RtpParticipant.Name);
 }
Beispiel #8
0
 protected virtual void ParticipantLeft(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     //ShowMessage(string.Format(CultureInfo.CurrentCulture, Strings.HasLeftTheChatSession,
     //    ea.RtpParticipant.Name));
 }
Beispiel #9
0
 // CF5 Receive data from network
 protected virtual void RtpParticipantAdded(object sender, RtpEvents.RtpParticipantEventArgs ea)
 {
     Console.WriteLine("Participant Joined: {0}", ea.RtpParticipant.Name);
     //ShowMessage(string.Format(CultureInfo.CurrentCulture, Strings.HasJoinedTheChatSession,
     //    ea.RtpParticipant.Name));
 }
Beispiel #10
0
        /// <summary>
        /// This constructor is the same as "RtpSession(IPEndPoint multicastEP, RtpParticipant participant, bool rtpTraffic, bool receiveData)",
        /// except that it is capable of using a Unicast-Multicast reflector.
        /// </summary>
        /// <param name="multicastEP"></param>
        /// <param name="participant"></param>
        /// <param name="rtpTraffic"></param>
        /// <param name="reflectorEPArg">The IP address and port number of the reflector</param>
        public RtpSession(IPEndPoint multicastEP, RtpParticipant participant, bool rtpTraffic, bool receiveData, IPEndPoint reflectorEP)
        {
            fEvents = new RtpEvents();

            #region Parameter Validation

            if(multicastEP == null)
            {
                throw new ArgumentNullException("multicastEP");
            }

            // A null participant is a special state for diagnostic purposes
            // The rtpTraffic flag must be false in order to be consistent
            if(participant == null && rtpTraffic)
            {
                throw new ArgumentException(Strings.IncompatibleArgumentsStatus);
            }

            if(!receiveData && (participant != null || !rtpTraffic))
            {
                throw new ArgumentException(Strings.IncompatibleArgumentsMessageShort);
            }

            #endregion Parameter Validation

            Utility.multicastIP = multicastEP.Address;

            if (null != reflectorEP)
                this.multicastEP = reflectorEP; // Use the reflector as a Unicast EndPoint
            else
                this.multicastEP = multicastEP;

            // Same as the "old" three argument constructor ...
            this.participant = participant;
            this.rtpTraffic = rtpTraffic;
            this.receiveData = receiveData;
                       
            // Initialize threads, perf counters, network, etc.
            //Initialize();
        }
Beispiel #11
0
 protected virtual void RtpStreamRemoved(object sender, RtpEvents.RtpStreamEventArgs ea)
 {
     if (PayloadType.xApplication2 == ea.RtpStream.PayloadType)
         ea.RtpStream.FrameReceived -= new RtpStream.FrameReceivedEventHandler(GDICommandReceived);
 }
Beispiel #12
0
        protected virtual void RtpStreamRemoved(object sender, RtpEvents.RtpStreamEventArgs ea)
        {
            if (ChannelType != ea.RtpStream.PayloadType)
                return;

            if (fUseFrameReceived)
            {
                ea.RtpStream.FrameReceived -= FrameReceived;
            }
            fIsReadyToSend = false;
            fStream = null;
        }
Beispiel #13
0
        protected virtual void RtpStreamAdded(object sender, RtpEvents.RtpStreamEventArgs ea)
        {
            if (ChannelType != ea.RtpStream.PayloadType)
                return;

            if (fUseFrameReceived)
            {
                ea.RtpStream.FrameReceived += FrameReceived;
            }

            fIsReadyToSend = true;
            fStream = ea.RtpStream;
        }