public EndpointStats(IntPtr obj)
        {
            objPtr = obj;

            List <LocalVideoSourceStats> csLocalCameraStats = new List <LocalVideoSourceStats>();
            int    nLocalCameraStatsSize  = 0;
            IntPtr nLocalCameraStats      = VidyoEndpointStatsGetlocalCameraStatsArrayNative(VidyoEndpointStatsGetlocalCameraStatsNative(objPtr), ref nLocalCameraStatsSize);
            int    nLocalCameraStatsIndex = 0;

            while (nLocalCameraStatsIndex < nLocalCameraStatsSize)
            {
                LocalVideoSourceStats csTlocalCameraStats = new LocalVideoSourceStats(Marshal.ReadIntPtr(nLocalCameraStats + (nLocalCameraStatsIndex * Marshal.SizeOf(nLocalCameraStats))));
                csLocalCameraStats.Add(csTlocalCameraStats);
                nLocalCameraStatsIndex++;
            }

            List <LocalMicrophoneStats> csLocalMicrophoneStats = new List <LocalMicrophoneStats>();
            int    nLocalMicrophoneStatsSize  = 0;
            IntPtr nLocalMicrophoneStats      = VidyoEndpointStatsGetlocalMicrophoneStatsArrayNative(VidyoEndpointStatsGetlocalMicrophoneStatsNative(objPtr), ref nLocalMicrophoneStatsSize);
            int    nLocalMicrophoneStatsIndex = 0;

            while (nLocalMicrophoneStatsIndex < nLocalMicrophoneStatsSize)
            {
                LocalMicrophoneStats csTlocalMicrophoneStats = new LocalMicrophoneStats(Marshal.ReadIntPtr(nLocalMicrophoneStats + (nLocalMicrophoneStatsIndex * Marshal.SizeOf(nLocalMicrophoneStats))));
                csLocalMicrophoneStats.Add(csTlocalMicrophoneStats);
                nLocalMicrophoneStatsIndex++;
            }

            List <LocalVideoSourceStats> csLocalMonitorStats = new List <LocalVideoSourceStats>();
            int    nLocalMonitorStatsSize  = 0;
            IntPtr nLocalMonitorStats      = VidyoEndpointStatsGetlocalMonitorStatsArrayNative(VidyoEndpointStatsGetlocalMonitorStatsNative(objPtr), ref nLocalMonitorStatsSize);
            int    nLocalMonitorStatsIndex = 0;

            while (nLocalMonitorStatsIndex < nLocalMonitorStatsSize)
            {
                LocalVideoSourceStats csTlocalMonitorStats = new LocalVideoSourceStats(Marshal.ReadIntPtr(nLocalMonitorStats + (nLocalMonitorStatsIndex * Marshal.SizeOf(nLocalMonitorStats))));
                csLocalMonitorStats.Add(csTlocalMonitorStats);
                nLocalMonitorStatsIndex++;
            }

            List <LocalRendererStats> csLocalRendererStats = new List <LocalRendererStats>();
            int    nLocalRendererStatsSize  = 0;
            IntPtr nLocalRendererStats      = VidyoEndpointStatsGetlocalRendererStatsArrayNative(VidyoEndpointStatsGetlocalRendererStatsNative(objPtr), ref nLocalRendererStatsSize);
            int    nLocalRendererStatsIndex = 0;

            while (nLocalRendererStatsIndex < nLocalRendererStatsSize)
            {
                LocalRendererStats csTlocalRendererStats = new LocalRendererStats(Marshal.ReadIntPtr(nLocalRendererStats + (nLocalRendererStatsIndex * Marshal.SizeOf(nLocalRendererStats))));
                csLocalRendererStats.Add(csTlocalRendererStats);
                nLocalRendererStatsIndex++;
            }

            List <LocalSpeakerStats> csLocalSpeakerStats = new List <LocalSpeakerStats>();
            int    nLocalSpeakerStatsSize  = 0;
            IntPtr nLocalSpeakerStats      = VidyoEndpointStatsGetlocalSpeakerStatsArrayNative(VidyoEndpointStatsGetlocalSpeakerStatsNative(objPtr), ref nLocalSpeakerStatsSize);
            int    nLocalSpeakerStatsIndex = 0;

            while (nLocalSpeakerStatsIndex < nLocalSpeakerStatsSize)
            {
                LocalSpeakerStats csTlocalSpeakerStats = new LocalSpeakerStats(Marshal.ReadIntPtr(nLocalSpeakerStats + (nLocalSpeakerStatsIndex * Marshal.SizeOf(nLocalSpeakerStats))));
                csLocalSpeakerStats.Add(csTlocalSpeakerStats);
                nLocalSpeakerStatsIndex++;
            }

            List <LocalVideoSourceStats> csLocalWindowShareStats = new List <LocalVideoSourceStats>();
            int    nLocalWindowShareStatsSize  = 0;
            IntPtr nLocalWindowShareStats      = VidyoEndpointStatsGetlocalWindowShareStatsArrayNative(VidyoEndpointStatsGetlocalWindowShareStatsNative(objPtr), ref nLocalWindowShareStatsSize);
            int    nLocalWindowShareStatsIndex = 0;

            while (nLocalWindowShareStatsIndex < nLocalWindowShareStatsSize)
            {
                LocalVideoSourceStats csTlocalWindowShareStats = new LocalVideoSourceStats(Marshal.ReadIntPtr(nLocalWindowShareStats + (nLocalWindowShareStatsIndex * Marshal.SizeOf(nLocalWindowShareStats))));
                csLocalWindowShareStats.Add(csTlocalWindowShareStats);
                nLocalWindowShareStatsIndex++;
            }

            List <NetworkInterfaceStats> csNetworkInterfaceStats = new List <NetworkInterfaceStats>();
            int    nNetworkInterfaceStatsSize  = 0;
            IntPtr nNetworkInterfaceStats      = VidyoEndpointStatsGetnetworkInterfaceStatsArrayNative(VidyoEndpointStatsGetnetworkInterfaceStatsNative(objPtr), ref nNetworkInterfaceStatsSize);
            int    nNetworkInterfaceStatsIndex = 0;

            while (nNetworkInterfaceStatsIndex < nNetworkInterfaceStatsSize)
            {
                NetworkInterfaceStats csTnetworkInterfaceStats = new NetworkInterfaceStats(Marshal.ReadIntPtr(nNetworkInterfaceStats + (nNetworkInterfaceStatsIndex * Marshal.SizeOf(nNetworkInterfaceStats))));
                csNetworkInterfaceStats.Add(csTnetworkInterfaceStats);
                nNetworkInterfaceStatsIndex++;
            }

            List <UserStats> csUserStats = new List <UserStats>();
            int    nUserStatsSize        = 0;
            IntPtr nUserStats            = VidyoEndpointStatsGetuserStatsArrayNative(VidyoEndpointStatsGetuserStatsNative(objPtr), ref nUserStatsSize);
            int    nUserStatsIndex       = 0;

            while (nUserStatsIndex < nUserStatsSize)
            {
                UserStats csTuserStats = new UserStats(Marshal.ReadIntPtr(nUserStats + (nUserStatsIndex * Marshal.SizeOf(nUserStats))));
                csUserStats.Add(csTuserStats);
                nUserStatsIndex++;
            }

            applicationTag   = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetapplicationTagNative(objPtr));
            buildTag         = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetbuildTagNative(objPtr));
            bytesReceivedTcp = VidyoEndpointStatsGetbytesReceivedTcpNative(objPtr);
            bytesReceivedUdp = VidyoEndpointStatsGetbytesReceivedUdpNative(objPtr);
            bytesSentTcp     = VidyoEndpointStatsGetbytesSentTcpNative(objPtr);
            bytesSentUdp     = VidyoEndpointStatsGetbytesSentUdpNative(objPtr);
            connectTime      = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetconnectTimeNative(objPtr));
            id                              = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetidNative(objPtr));
            libraryVersion                  = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetlibraryVersionNative(objPtr));
            localCameraStats                = csLocalCameraStats;
            localMicrophoneStats            = csLocalMicrophoneStats;
            localMonitorStats               = csLocalMonitorStats;
            localRendererStats              = csLocalRendererStats;
            localSpeakerStats               = csLocalSpeakerStats;
            localWindowShareStats           = csLocalWindowShareStats;
            loginTimeConsumedMs             = VidyoEndpointStatsGetloginTimeConsumedMsNative(objPtr);
            maxEncodePixelRateInitial       = VidyoEndpointStatsGetmaxEncodePixelRateInitialNative(objPtr);
            mediaEnableTimeConsumedMs       = VidyoEndpointStatsGetmediaEnableTimeConsumedMsNative(objPtr);
            mediaRouteAcquireTimeConsumedMs = VidyoEndpointStatsGetmediaRouteAcquireTimeConsumedMsNative(objPtr);
            networkInterfaceStats           = csNetworkInterfaceStats;
            osName                          = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetosNameNative(objPtr));
            osVersion                       = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetosVersionNative(objPtr));
            processorBrand                  = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetprocessorBrandNative(objPtr));
            processorLogicalCores           = VidyoEndpointStatsGetprocessorLogicalCoresNative(objPtr);
            processorModel                  = Marshal.PtrToStringAnsi(VidyoEndpointStatsGetprocessorModelNative(objPtr));
            processorPhysicalCores          = VidyoEndpointStatsGetprocessorPhysicalCoresNative(objPtr);
            processorSpeed                  = VidyoEndpointStatsGetprocessorSpeedNative(objPtr);
            roomEnterTimeConsumedMs         = VidyoEndpointStatsGetroomEnterTimeConsumedMsNative(objPtr);
            timeStamp                       = Marshal.PtrToStringAnsi(VidyoEndpointStatsGettimeStampNative(objPtr));
            userStats                       = csUserStats;
            VidyoEndpointStatsFreeuserStatsArrayNative(nUserStats, nUserStatsSize);
            VidyoEndpointStatsFreenetworkInterfaceStatsArrayNative(nNetworkInterfaceStats, nNetworkInterfaceStatsSize);
            VidyoEndpointStatsFreelocalWindowShareStatsArrayNative(nLocalWindowShareStats, nLocalWindowShareStatsSize);
            VidyoEndpointStatsFreelocalSpeakerStatsArrayNative(nLocalSpeakerStats, nLocalSpeakerStatsSize);
            VidyoEndpointStatsFreelocalRendererStatsArrayNative(nLocalRendererStats, nLocalRendererStatsSize);
            VidyoEndpointStatsFreelocalMonitorStatsArrayNative(nLocalMonitorStats, nLocalMonitorStatsSize);
            VidyoEndpointStatsFreelocalMicrophoneStatsArrayNative(nLocalMicrophoneStats, nLocalMicrophoneStatsSize);
            VidyoEndpointStatsFreelocalCameraStatsArrayNative(nLocalCameraStats, nLocalCameraStatsSize);
        }
Esempio n. 2
0
        public Boolean GetStats(LocalVideoSourceStats stats)
        {
            Boolean ret = VidyoVirtualWindowShareGetStatsNative(objPtr, (stats != null) ? stats.GetObjectPtr():IntPtr.Zero);

            return(ret);
        }