Exemplo n.º 1
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            try
            {
                //specifying the video handler location
                Rectangle rect    = new Rectangle(0, 0, pnlVideoArea.Width, pnlVideoArea.Height);
                int       szRect  = Marshal.SizeOf(rect);
                IntPtr    ptrRect = Marshal.AllocCoTaskMem(szRect);
                Marshal.StructureToPtr(rect, ptrRect, true);

                //Specifying logging information
                Vidyo32.VidyoClientLogParams logParams = new Vidyo32.VidyoClientLogParams();

                logParams.logSize = 500000;
                //log path must exist before running (this is done by Visual Studio build steps here)
                logParams.setpathToLogDir(".\\logs\\");
                logParams.setlogBaseFileName("VidyoSampleApplication");
                logParams.setLogLevelsAndCategories("warning all@App debug@AppEvents");
                logParams.setPathToDumpDir(".\\logs\\");


                int    szLog  = Marshal.SizeOf(logParams);
                IntPtr ptrLog = Marshal.AllocCoTaskMem(szLog);
                Marshal.StructureToPtr(logParams, ptrLog, true);

                Vidyo32.VidyoClientProfileParams profileParams = new Vidyo32.VidyoClientProfileParams();
                //this is where in the registry settings get stored betweeen runs. Empty value defaults to VidyoDesktop's location and settings (but also reuses VidyoDesktop EID)
                profileParams.setCONFIG_KEY_PATH("");
                profileParams.setMYDOCS_DIR("");
                profileParams.portNumber = 65000; //VidyoDesktop uses 63457
                profileParams.setPRODUCT_NAME("VidyoSampleApplication");
                profileParams.setPROGFILES_DIR("");
                profileParams.setVIDYO_DIR("");
                //this is where the CA base certificate is read from - here we're using Vidyo Desktop's version.
                profileParams.setCERT_FILE_DIR(".\\");
                profileParams.setINSTALLED_APP_DIR(".\\");


                int    szProfile  = Marshal.SizeOf(profileParams);
                IntPtr ptrProfile = Marshal.AllocCoTaskMem(szProfile);
                Marshal.StructureToPtr(profileParams, ptrProfile, true);

                //Starting the client
                Int32 startRes = Vidyo32.VidyoClientStart(m_myDelegate, // callback
                                                          IntPtr.Zero,  // data ptr
                                                          ptrLog,       //logParams,
                                                          pnlVideoArea.Handle,
                                                          ptrRect,      // Initial RECT
                                                          IntPtr.Zero,  //reserved
                                                          ptrProfile,   //profileParams,
                                                          false);       //reserved
                SetFlag(cVcStarted);
            }

            catch (Exception ex)
            {
            }
        }
Exemplo n.º 2
0
        private void buttonStart_Click(object sender, EventArgs e)
        {
            try
            {
                //specifying the video handler location
                Rectangle rect    = new Rectangle(0, 0, pnlVideoArea.Width, pnlVideoArea.Height);
                int       szRect  = Marshal.SizeOf(rect);
                IntPtr    ptrRect = Marshal.AllocCoTaskMem(szRect);
                Marshal.StructureToPtr(rect, ptrRect, true);

                //Specifying logging information
                Vidyo32.VidyoClientLogParams logParams = new Vidyo32.VidyoClientLogParams();

                logParams.logSize = 500000;
                //log path must exist before running (this is done by Visual Studio build steps here)
                logParams.setpathToLogDir(".\\logs\\");
                logParams.setlogBaseFileName("VidyoSampleApplication");
                logParams.setLogLevelsAndCategories("warning all@App all@AppEvents all@LmiApp");
                logParams.setPathToDumpDir(".\\logs\\");


                int    szLog  = Marshal.SizeOf(logParams);
                IntPtr ptrLog = Marshal.AllocCoTaskMem(szLog);
                Marshal.StructureToPtr(logParams, ptrLog, true);

                Vidyo32.VidyoClientProfileParams profileParams = new Vidyo32.VidyoClientProfileParams();
                //this is where in the registry settings get stored betweeen runs. Empty value defaults to VidyoDesktop's location and settings (but also reuses VidyoDesktop EID)
                profileParams.setCONFIG_KEY_PATH("");
                profileParams.setMYDOCS_DIR("");
                profileParams.portNumber = 65000; //VidyoDesktop uses 63457
                profileParams.setPRODUCT_NAME("VidyoSampleApplication");
                profileParams.setPROGFILES_DIR("");
                profileParams.setVIDYO_DIR("");
                //this is where the CA base certificate is read from - here we're using Vidyo Desktop's version.
                profileParams.setCERT_FILE_DIR(".\\");
                profileParams.setINSTALLED_APP_DIR(".\\");


                int    szProfile  = Marshal.SizeOf(profileParams);
                IntPtr ptrProfile = Marshal.AllocCoTaskMem(szProfile);
                Marshal.StructureToPtr(profileParams, ptrProfile, true);

                //Starting the client
                Int32 startRes = Vidyo32.VidyoClientStart(m_myDelegate, // callback
                                                          IntPtr.Zero,  // data ptr
                                                          ptrLog,       //logParams,
                                                          pnlVideoArea.Handle,
                                                          ptrRect,      // Initial RECT
                                                          IntPtr.Zero,  //reserved
                                                          ptrProfile,   //profileParams,
                                                          false);       //reserved
                SetFlag(cVcStarted);

                //Enable window share feature
                Vidyo32.VidyoClientRequestEnableAppShare enableShare = new Vidyo32.VidyoClientRequestEnableAppShare();
                enableShare.isEnable = Vidyo32.VIDYO_TRUE;
                int nEnableSize = Marshal.SizeOf(enableShare);

                IntPtr ptrEnableShares = Marshal.AllocCoTaskMem(nEnableSize);
                Marshal.StructureToPtr(enableShare, ptrEnableShares, true);
                int szShares2 = Marshal.SizeOf(ptrEnableShares);

                uint error = Vidyo32.VidyoClientSendRequest(Vidyo32.VidyoClientRequest.VIDYO_CLIENT_REQUEST_ENABLE_APP_SHARE,
                                                            ptrEnableShares, nEnableSize);
                if (error != 0)
                {
                    return;
                }


                Vidyo32.VidyoClientRequestConfiguration config = new Vidyo32.VidyoClientRequestConfiguration();
                int nconfigSize = Marshal.SizeOf(config);

                IntPtr ptrConfig = Marshal.AllocCoTaskMem(nconfigSize);
                Marshal.StructureToPtr(config, ptrConfig, true);
                int nconfigSize2 = Marshal.SizeOf(ptrConfig);

                uint error2 = Vidyo32.VidyoClientSendRequest(Vidyo32.VidyoClientRequest.VIDYO_CLIENT_REQUEST_GET_CONFIGURATION,
                                                             ptrConfig, nconfigSize);
                if (error2 != 0)
                {
                    return;
                }
            }

            catch (Exception ex)
            {
            }
        }