示例#1
0
 private void LeaveRtpSession()
 {
     if (rtpSession != null)
     {
         // Clean up all outstanding objects owned by the RtpSession
         rtpSession.Dispose();
         rtpSession = null;
     }
 }
示例#2
0
 private void LeaveRtpSession()
 {
     try
     {
         if (rtpSession != null)
         {
             // Clean up all outstanding objects owned by the RtpSession
             rtpSession.Dispose();
             rtpSession = null;
             rtpSender = null;
         }
     }
     catch (Exception err)
     {
         logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);
     }
 }
示例#3
0
 // CF2 Create participant, join session
 // CF3 Retrieve RtpSender
 private void JoinRtpSession(string name)
 {
     try
     {
         rtpSession = new RtpSession(ep, new RtpParticipant(name, name), true, true);
         Console.WriteLine("JoinedRtpSession");
     }
     catch (Exception ex)
     {
         Console.WriteLine("JoinedRtpSession Error : " + ex.Message);
         //MessageBox.Show("Please make sure that you are connceted with the network so " + ex.Message); 
     }
 }
示例#4
0
        public RtpListener(RtpSession rtpSession)
        {
            this.rtpSession = rtpSession;

            returnBufferHandler = new ReturnBufferHandler(ReturnBuffer);
            getBufferHandler = new GetBufferHandler(GetBuffer);

            InitializeBufferPool();
            InitializePerformanceCounters();
            InitializeNetwork();
            InitializeThreads();
        }
示例#5
0
        // CF2 Create participant, join session
        // CF3 Retrieve RtpSender
        private void JoinRtpSession(string name)
        {
            try
            {
                Hashtable payloadPara = new Hashtable();
                payloadPara.Add("Width", Width);
                payloadPara.Add("Height", Height);
                payloadPara.Add("Quality", Quality);

                rtpSession = new RtpSession(ep, new RtpParticipant(name, name), true, true);
                rtpSender = rtpSession.CreateRtpSender(name, PayloadType.JPEG, null, payloadPara);
            }
            catch (Exception err)
            {
                logger.Log(LogLevel.Error, err.Message + " " + err.Source + " " + err.StackTrace);
            }
        }
示例#6
0
 // CF2 Create participant, join session
 // CF3 Retrieve RtpSender
 private void JoinRtpSession(string name)
 {
     try
     {
         rtpSession = new RtpSession(ep, new RtpParticipant(name, name), true, true);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }
示例#7
0
        // CF2 Create participant, join session
        // CF3 Retrieve RtpSender
        private void JoinRtpSession(string name)
        {
            try
            {
                Hashtable payloadPara = new Hashtable();
                payloadPara.Add("Width", ImgWidth);
                payloadPara.Add("Height", ImgHeight);
                payloadPara.Add("Quality", Quality);

                rtpSession = new RtpSession(ep, new RtpParticipant(name, name), true, true);
                rtpSender = rtpSession.CreateRtpSender(name, PayloadType.JPEG, null, payloadPara);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                //MessageBox.Show("Please make sure that you are connceted with the network so " + ex.Message); 
            }
        }
示例#8
0
        public void Dispose()
        {
            lock(classLock)
            {
                try
                {
                    disposed = true;

                    // Unhook events
                    RtpEvents.ReceiverReport            -= new RtpEvents.ReceiverReportEventHandler(RtpReceiverReport);
                    RtpEvents.DuplicateCNameDetected    -= new RtpEvents.DuplicateCNameDetectedEventHandler(DuplicateCNameDetected);

                    if(updateThread != null)
                    {
                        updateThread.Dispose();
                        updateThread = null;
                    }

                    if(rtpSession != null)
                    {
                        rtpSession.Dispose();
                        rtpSession = null;
                        rtpSender = null;
                    }
                }
                catch(Exception e)
                {
                    eventLog.WriteEntry("Error disposing ConnectivityDetector. \n" + e.ToString(),
                        EventLogEntryType.Error, 0);
                }
            }
        }
示例#9
0
        private void InitializeNetwork()
        {
            RtpEvents.ReceiverReport            += new RtpEvents.ReceiverReportEventHandler(RtpReceiverReport);
            RtpEvents.DuplicateCNameDetected    += new RtpEvents.DuplicateCNameDetectedEventHandler(DuplicateCNameDetected);

            // Create participant
            rtpParticipant = new RtpParticipant(cName, name);
            rtpParticipant.SetTool(true);

            // Create session with Participant and Rtp data
            rtpSession = new RtpSession(new IPEndPoint(IPAddress.Parse(ipAddress), port), rtpParticipant, true, true);

            // Create RtpSender
            rtpSender = rtpSession.CreateRtpSender(HostName, PayloadType.PipecleanerSignal, null, null);
        }
示例#10
0
文件: Events.cs 项目: tdhieu/openvss
 public HiddenSocketExceptionEventArgs( RtpSession session, System.Net.Sockets.SocketException ex )
 {
     Session = session;
     Exception = ex;
 }