コード例 #1
0
        private void onTryingCall(object sender, TryCallArguments e)
        {
            if (isCalling == true)
            {
                return;
            }
            else
            {
                isCalling = true;
            }
            waveIn            = new WaveIn();
            waveIn.WaveFormat = new WaveFormat(8000, 16, 1);
            IPEndPoint remotePoint = new IPEndPoint(e.Adress, 5555);

            waveIn.DataAvailable += (sender1, e1) =>
            {
                try
                {
                    socket.SendTo(e1.Buffer, remotePoint);
                }
                catch (Exception ex)
                {
                    senderView.ShowError(ex);
                }
            };

            socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
            waveIn.StartRecording();


            videoCaptureDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);

            IPEndPoint ipep = new IPEndPoint(e.Adress, 6666);

            imageSocket = new Socket(AddressFamily.InterNetwork,
                                     SocketType.Stream, ProtocolType.Tcp);
            imageSocket.Connect(ipep);

            camera           = new VideoCaptureDevice(videoCaptureDevices[0].MonikerString);
            camera.NewFrame += camera_NewFrame;
            camera.Start();
        }
コード例 #2
0
 public void Call(TryCallArguments a)
 {
     TryCall.Invoke(this, a);
 }