private void Start_Click(object sender, RoutedEventArgs e) { Console.WriteLine("Inside StartCall Button"); string sIP = "192.168.57.121"; //string sIP = "38.127.68.60"; //string sIP = "60.68.127.38"; int iFriendPort = 60002; int iRet = 0; P2PWrapper p2pWrapper = P2PWrapper.GetInstance(); iRet = p2pWrapper.InitializeLibraryR(100 /*UserID*/); System.Console.WriteLine("MediaEngineLib==> InitializeLibrary, iRet = " + iRet); p2pWrapper.CreateSessionR(200 /*FriendID*/, 1 /*Audio*/, sIP, iFriendPort); p2pWrapper.CreateSessionR(200, 2 /*Video*/, sIP, iFriendPort); p2pWrapper.SetRelayServerInformationR(200, 1, sIP, iFriendPort); p2pWrapper.SetRelayServerInformationR(200, 2, sIP, iFriendPort); iRet = p2pWrapper.StartAudioCallR(200); iRet = p2pWrapper.StartVideoCallR(200, 288 /*Height*/, 352 /*Width*/); System.Diagnostics.Debug.WriteLine("MediaEngineLib==> StartVideoCall, iRet = " + iRet); p2pWrapper.SetLoggingStateR(true, 5); p2pWrapper.LinkWithConnectivityLib(null); AudioSender oAlpha = new AudioSender(); oAlpha.AudioData = System.IO.File.ReadAllBytes(@"AudioSending(1).pcm"); //oAlpha.bStartSending = true; Thread oThread = new Thread(new ThreadStart(oAlpha.StartSendingAudio)); oThread.Start(); }
private void Stop_Click_1(object sender, RoutedEventArgs e) { Console.WriteLine("Inside EndCall Button"); P2PWrapper p2pWrapper = P2PWrapper.GetInstance(); p2pWrapper.StopAudioCallR(200); p2pWrapper.StopAudioCallR(200); p2pWrapper.CloseSessionR(200, 1); p2pWrapper.CloseSessionR(200, 2); }
private void Button_Click(object sender, RoutedEventArgs e) { P2PWrapper p2pWrapper = P2PWrapper.GetInstance(); Console.WriteLine("Inside CheckCap Button"); p2pWrapper.InitializeLibraryR(100 /*UserID*/); p2pWrapper.LinkWithConnectivityLib(null); //p2pWrapper.CheckDeviceCapabilityR(100, 640, 480, 352, 288); p2pWrapper.CheckDeviceCapabilityR(100, 480, 640, 288, 352); }
public void InitRingIDSDKLib() { //string sIP = "192.168.8.29"; string sIP = "38.127.68.60"; //string sIP = "60.68.127.38"; int iFriendPort = 60007; int iRet = 0; P2PWrapper p2pWrapper = P2PWrapper.GetInstance(); iRet = p2pWrapper.InitializeLibraryR(100 /*UserID*/); System.Console.WriteLine("MediaEngineLib==> InitializeLibrary, iRet = " + iRet); p2pWrapper.CreateSessionR(200 /*FriendID*/, 1 /*Audio*/, sIP, iFriendPort); p2pWrapper.CreateSessionR(200, 2 /*Video*/, sIP, iFriendPort); p2pWrapper.SetRelayServerInformationR(200, 1, sIP, iFriendPort); p2pWrapper.SetRelayServerInformationR(200, 2, sIP, iFriendPort); iRet = p2pWrapper.StartAudioCallR(200); iRet = p2pWrapper.StartVideoCallR(200, height /*Height*/, width /*Width*/); System.Diagnostics.Debug.WriteLine("MediaEngineLib==> StartVideoCall, iRet = " + iRet); p2pWrapper.SetLoggingStateR(true, 5); p2pWrapper.LinkWithConnectivityLib(null); }
public int BufferCB(double sampleTime, IntPtr pBuffer, int bufferLen) { Console.WriteLine("VampireEngg--> TimeDiff = " + (GetCurrentTimeStamp() - lastFrame)); lastFrame = GetCurrentTimeStamp(); iFpsControl++; //if (iFpsControl % 2 == 1) return 0; Marshal.Copy(pBuffer, TempFrameRGB24, 0, bufferLen); //P2PWrapper.iRenderHeight = height; //P2PWrapper.iRenderWidth = width; //P2PWrapper.framesQueue.Enqueue(TempFrameRGB24); int iRet = P2PWrapper.GetInstance().SendVideoDataR(200, TempFrameRGB24, bufferLen, 1, 0); //Console.WriteLine("VampireENgg--> Capturing RGB24 Data..... bufferLen = " + bufferLen + ", Returned = " + iRet); return(0); /* * //Console.WriteLine("VampireENgg--> bufferLen = " + (bufferLen - width * height * 3) ); * * * byte[] TempFrame = new byte[width * height * 3]; * byte[] YUVI420 = new byte[width * height * 3/2]; * * //capturedYUY2Buffer = new byte[bufferLen]; * // Marshal.Copy(pBuffer, capturedYUY2Buffer, 0, bufferLen); * * Marshal.Copy(pBuffer, TempFrame, 0, bufferLen); * * //YUY2ToI420(capturedYUY2Buffer, outputYUV420, width, height); * * //P2PWrapper.SendVideoData(200, capturedYUY2Buffer, capturedYUY2Buffer.Length, 1); * long milliseconds, milliseconds2; * * milliseconds = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; * TransformRGB24(TempFrame, YUVI420, width, height); * milliseconds2 = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond - milliseconds; * Console.WriteLine("RGB2YUV420Managed2 time = " + milliseconds2); * * if (iTemp == 0) * { * System.IO.File.WriteAllBytes("TestYuv420.yuv", YUVI420); * iTemp = 1; * } * else * { * P2PWrapper.AppendAllBytes("TestYuv420.yuv", YUVI420); * } * * * milliseconds = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond; * YUV2RGBManaged2(outputYUV420, TempFrame, width, height); * milliseconds2 = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond - milliseconds; * Console.WriteLine("YUV2RGBManaged2 time = " + milliseconds2); * * * * * * * Console.WriteLine("TheKing-->BufferCB: " + bufferLen); * for (int i = 0; i < 10; i++) * { * Console.Write(TempFrame[i] + " "); * } * Console.WriteLine(""); * * P2PWrapper.framesQueue.Enqueue(TempFrame); * //frameArrived = true; * * return 0; */ }