コード例 #1
0
        private void button_PuchVideo_Click(object sender, EventArgs e)
        {
            try
            {
                // Start Capturing
                if (!MePaused)
                {
                    if (capture != null)
                    {
                        if (capture.PreviewWindow != panelVideo)
                        {
                            capture.PreviewWindow = panelVideo;
                        }
                        capture.FrameEvent2 += new Capture.HeFrame(CaptureDone);
                        capture.GrapImg();

                        PeerIP_TXT.Enabled       = false;
                        button_PuchVideo.Enabled = false;
                        mnuDevices.Enabled       = false;
                        menuItem7.Enabled        = false;
                        isSending = true;
                    }
                    AudioSender.Start_AudioSender();
                }
                else
                {
                    ChatBox.SendMessage("_stop_pause");
                }
            }
            catch (Exception) { }
        }
コード例 #2
0
        private void P2PVideoCall_Load(object sender, EventArgs e)
        {
            try
            {
                PeerIP_TXT.Text = Properties.Settings.Default.P2P_IP;
            }
            catch (Exception) { }

            ServerThread = new Thread(new ThreadStart(server));
            ServerThread.IsBackground = true;
            ServerThread.Start();

            if (capture != null)
            {
                capture.FrameRate = 15;
                capture.FrameSize = new Size(320, 240);
            }
            AudioSender.Initialize_AudioSender();
        }
コード例 #3
0
        private void P2PVideoCall_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (!stoped)
            {
                try
                {
                    isSending = false;
                    server_sock.Close();
                    ServerThread.Abort();
                }
                catch (Exception) { }

                try
                {
                    capture.PreviewWindow = null;
                    if (capture != null)
                    {
                        capture.Stop();
                    }
                }
                catch (Exception) { }
                AudioSender.Stop_AudioSender();
            }
        }