예제 #1
0
        /// <summary>
        /// Add CapabilityViewer Icons to a Participant Icon to graphically show an end user what CapabilityViewers are available for a Participant
        /// (AKA are they sending video? sending audio? sharing a whiteboard? sharing a PowerPoint?
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        internal static Bitmap CreateDecoratedParticipantImage(Participant p)
        {
            Bitmap partBit = new Bitmap(p.Icon);
            Graphics g = Graphics.FromImage(partBit);

            // Indicate which stream's are available for the participant
            bool sendingAudio = false;
            bool sendingVideo = false;

            foreach (ICapability cv in p.Capabilities)
            {
                // Pri2: Bind this to the object type somehow -- watch interdependencies
                MSR.LST.Net.Rtp.PayloadType pt = (MSR.LST.Net.Rtp.PayloadType)cv.PayloadType;
                if (pt == MSR.LST.Net.Rtp.PayloadType.dynamicVideo)
                {
                    sendingVideo = true;
                }
                if (pt == MSR.LST.Net.Rtp.PayloadType.dynamicAudio)
                {
                    sendingAudio = true;
                }
            }

            // Draw audio, video, or audiovideo icons on bitmap
            if (sendingAudio && sendingVideo)
            {
                System.IO.Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MSR.LST.ConferenceXP.AudioAndVideoDecoration.png");
                g.DrawImage(new Bitmap(stream), new Rectangle(new Point(1,1), new Size(32,24)));
            }
            else
                if (sendingAudio)
            {
                System.IO.Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MSR.LST.ConferenceXP.AudioDecoration.png");
                g.DrawImage(new Bitmap(stream), new Rectangle(new Point(1,1), new Size(32,24)));
            }
            else
                if (sendingVideo)
            {
                System.IO.Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("MSR.LST.ConferenceXP.VideoDecoration.png");
                g.DrawImage(new Bitmap(stream), new Rectangle(new Point(1,1), new Size(32,24)));
            }

            // Write out the new bitmap
            MemoryStream ms = new MemoryStream();
            partBit.Save(ms, ImageFormat.Png);
            return new Bitmap(ms);
        }
예제 #2
0
        private static void GetLocalParticipant()
        {
            Participant p = null;

            // Are we configured to use a Venue Service?
            if (venues.VenueServiceUrl != null)
            {
                p = venues.GetParticipantUnmediated(Identity.Identifier);

                if (p == null && !venues.IsUnreachable) // We talked to the Venue Server properly, but no record was found
                {
                    if (createParticipantUIShowed == false)
                    {
                        createParticipantUIShowed = true; // Allows opt out to succeed
                        RaiseCreateProfile(); // This calls us back recursively
                        return;
                    }
                }
            }

            if (p == null)
            {
                // We're explicitly configured *not* to use a Venue Service, so use a default participant.
                // Create a minimal participant
                VenueService.Participant vp = new VenueService.Participant();
                vp.Identifier = Identity.Identifier;
                vp.Name = vp.Identifier;

                p = new Participant(vp);
            }

            localParticipant = p;

            // We may be refreshing the Local Participant after edits
            participants[localParticipant.Identifier] = localParticipant;
        }