void icServer_VideoPreviewStarted(int videoWidth, int videoHeight, string deviceName) { this.Dispatcher.Invoke(new MethodInvoker(delegate { //Initialize Codec -- MPEG 4, iframe frequency 20, bitrate 8000 bps icServer.SetEncoderProperties(VideoCodecs.MPEG4, 20, 8000, 0, 0, 0); if (!icServer.IsListening) { //listen for incoming connections icServer.Listen(true, icServer.GetLocalIp()[0].ToString(), 9990, 17860, 17861); } })); }
private void btnStartPreview_Click(object sender, EventArgs e) { int listeningVideoPort = Convert.ToInt32(txtVideoport.Text); int listeningAudioTcpPort = Convert.ToInt32(txtAudioporttcp.Text); int listeningAudioUdpPort = Convert.ToInt32(txtaudioportudp.Text); //start listening for incoming calls on local ip and listening ports if (!ics.IsListening) { ics.Listen(true, ics.GetLocalIp()[0].ToString(), listeningVideoPort, listeningAudioTcpPort, listeningAudioUdpPort); } btnStartPreview.Enabled = false; btnStopPreview.Enabled = true; }