Example #1
0
        // Required ctor for ICapabilitySender
        public WMFileCapability()
            : base()
        {
            // Audio and video should go to the same form
            Guid sharedFormID = Guid.NewGuid();

            // RtpSender properties for Video
            videoProps = new Capability.RtpSenderProperties();
            videoProps.Channel = Channel;
            videoProps.OwnedByLocalParticipant = true;
            videoProps.DelayBetweenPackets = delayBetweenPackets;
            videoProps.FecChecksum = capProps.FecChecksum;
            videoProps.FecData = capProps.FecData;
            videoProps.ID = Guid.NewGuid();
            videoProps.Name = "Windows Media Playback";
            videoProps.PayloadType = MSR.LST.Net.Rtp.PayloadType.dynamicVideo;
            videoProps.SharedFormID = sharedFormID;

            // RtpSender properties for Audio
            audioProps = new Capability.RtpSenderProperties();
            audioProps.Channel = Channel;
            audioProps.OwnedByLocalParticipant = true;
            audioProps.DelayBetweenPackets = delayBetweenPackets;
            audioProps.FecChecksum = capProps.FecChecksum;
            audioProps.FecData = capProps.FecData;
            audioProps.ID = Guid.NewGuid();
            audioProps.Name = "Windows Media Playback";
            audioProps.PayloadType = MSR.LST.Net.Rtp.PayloadType.dynamicAudio;
            audioProps.SharedFormID = sharedFormID;
        }
        // Required ctor for ICapabilitySender
        public WMFileCapability()
            : base()
        {
            // Audio and video should go to the same form
            Guid sharedFormID = Guid.NewGuid();

            // RtpSender properties for Video
            videoProps         = new Capability.RtpSenderProperties();
            videoProps.Channel = Channel;
            videoProps.OwnedByLocalParticipant = true;
            videoProps.DelayBetweenPackets     = delayBetweenPackets;
            videoProps.FecChecksum             = capProps.FecChecksum;
            videoProps.FecData      = capProps.FecData;
            videoProps.ID           = Guid.NewGuid();
            videoProps.Name         = "Windows Media Playback";
            videoProps.PayloadType  = MSR.LST.Net.Rtp.PayloadType.dynamicVideo;
            videoProps.SharedFormID = sharedFormID;

            // RtpSender properties for Audio
            audioProps         = new Capability.RtpSenderProperties();
            audioProps.Channel = Channel;
            audioProps.OwnedByLocalParticipant = true;
            audioProps.DelayBetweenPackets     = delayBetweenPackets;
            audioProps.FecChecksum             = capProps.FecChecksum;
            audioProps.FecData      = capProps.FecData;
            audioProps.ID           = Guid.NewGuid();
            audioProps.Name         = "Windows Media Playback";
            audioProps.PayloadType  = MSR.LST.Net.Rtp.PayloadType.dynamicAudio;
            audioProps.SharedFormID = sharedFormID;
        }
Example #3
0
        protected RtpSender CreateRtpSender(RtpSenderProperties props)
        {
            // Setup private extensions
            Hashtable priExns = new Hashtable();

            // Add unique ID
            Debug.Assert(props.ID != Guid.Empty);
            priExns.Add(PEP_IDENTIFIER, props.ID.ToString());

            // Set the delay between packets now, so that it happens in the constructor and goes out with
            //  the first RTCP packet
            priExns.Add(Rtcp.PEP_DBP, props.DelayBetweenPackets.ToString(CultureInfo.InvariantCulture));

            // Set the channel-ness or ownership of the stream...
            if(props.Channel && props.OwnedByLocalParticipant)
            {
                throw new ArgumentException(Strings.CannotBeChannelAndOwned);
            }
            if(props.Channel)
            {
                priExns.Add(PEP_CHANNEL, true.ToString());
            }
            else if(props.OwnedByLocalParticipant)
            {
                priExns.Add(PEP_CHANNEL, false.ToString());
            }
            // else neither are true (i.e. it's owned but not by the local participant - a concept only possible in CXP...)

            // For capabilities with shared forms only
            if(props.SharedFormID != Guid.Empty)
            {
                priExns.Add(PEP_SHAREDFORM, props.SharedFormID.ToString());
            }

            // Create the sender
            RtpSender rtpSender = null;
            
            if(props.FecEnabled && props.FecChecksum > 0)
            {
                rtpSender = Conference.RtpSession.CreateRtpSenderFec(props.Name, 
                    props.PayloadType, priExns, props.FecData, props.FecChecksum);
            }
            else
            {
                rtpSender = Conference.RtpSession.CreateRtpSender(props.Name, 
                    props.PayloadType, priExns);
            }
            
            // Add to collection
            rtpSenders.Add(rtpSender);

            return rtpSender;
        }