public RoomStats(IntPtr obj) { objPtr = obj; BandwidthSummaryStats csBandwidthApp = new BandwidthSummaryStats(VidyoRoomStatsGetbandwidthAppNative(objPtr)); BandwidthSummaryStats csBandwidthAudio = new BandwidthSummaryStats(VidyoRoomStatsGetbandwidthAudioNative(objPtr)); BandwidthSummaryStats csBandwidthVideo = new BandwidthSummaryStats(VidyoRoomStatsGetbandwidthVideoNative(objPtr)); List <ParticipantGenerationStats> csParticipantGenerationStats = new List <ParticipantGenerationStats>(); int nParticipantGenerationStatsSize = 0; IntPtr nParticipantGenerationStats = VidyoRoomStatsGetparticipantGenerationStatsArrayNative(VidyoRoomStatsGetparticipantGenerationStatsNative(objPtr), ref nParticipantGenerationStatsSize); int nParticipantGenerationStatsIndex = 0; while (nParticipantGenerationStatsIndex < nParticipantGenerationStatsSize) { ParticipantGenerationStats csTparticipantGenerationStats = new ParticipantGenerationStats(Marshal.ReadIntPtr(nParticipantGenerationStats + (nParticipantGenerationStatsIndex * Marshal.SizeOf(nParticipantGenerationStats)))); csParticipantGenerationStats.Add(csTparticipantGenerationStats); nParticipantGenerationStatsIndex++; } List <ParticipantStats> csParticipantStats = new List <ParticipantStats>(); int nParticipantStatsSize = 0; IntPtr nParticipantStats = VidyoRoomStatsGetparticipantStatsArrayNative(VidyoRoomStatsGetparticipantStatsNative(objPtr), ref nParticipantStatsSize); int nParticipantStatsIndex = 0; while (nParticipantStatsIndex < nParticipantStatsSize) { ParticipantStats csTparticipantStats = new ParticipantStats(Marshal.ReadIntPtr(nParticipantStats + (nParticipantStatsIndex * Marshal.SizeOf(nParticipantStats)))); csParticipantStats.Add(csTparticipantStats); nParticipantStatsIndex++; } RateShaperStats csRateShaperApp = new RateShaperStats(VidyoRoomStatsGetrateShaperAppNative(objPtr)); RateShaperStats csRateShaperAudio = new RateShaperStats(VidyoRoomStatsGetrateShaperAudioNative(objPtr)); RateShaperStats csRateShaperVideo = new RateShaperStats(VidyoRoomStatsGetrateShaperVideoNative(objPtr)); List <MediaConnectionTransportInfo> csTransportInformation = new List <MediaConnectionTransportInfo>(); int nTransportInformationSize = 0; IntPtr nTransportInformation = VidyoRoomStatsGettransportInformationArrayNative(VidyoRoomStatsGettransportInformationNative(objPtr), ref nTransportInformationSize); int nTransportInformationIndex = 0; while (nTransportInformationIndex < nTransportInformationSize) { MediaConnectionTransportInfo csTtransportInformation = new MediaConnectionTransportInfo(Marshal.ReadIntPtr(nTransportInformation + (nTransportInformationIndex * Marshal.SizeOf(nTransportInformation)))); csTransportInformation.Add(csTtransportInformation); nTransportInformationIndex++; } availableDecodeBwPercent = VidyoRoomStatsGetavailableDecodeBwPercentNative(objPtr); availableDecodeCpuPercent = VidyoRoomStatsGetavailableDecodeCpuPercentNative(objPtr); availableEncodeBwPercent = VidyoRoomStatsGetavailableEncodeBwPercentNative(objPtr); availableEncodeCpuPercent = VidyoRoomStatsGetavailableEncodeCpuPercentNative(objPtr); bandwidthApp = csBandwidthApp; bandwidthAudio = csBandwidthAudio; bandwidthVideo = csBandwidthVideo; callId = (string)MarshalPtrToUtf8.GetInstance().MarshalNativeToManaged(VidyoRoomStatsGetcallIdNative(objPtr)); conferenceId = (string)MarshalPtrToUtf8.GetInstance().MarshalNativeToManaged(VidyoRoomStatsGetconferenceIdNative(objPtr)); cpuUsage = VidyoRoomStatsGetcpuUsageNative(objPtr); currentBandwidthDecodePixelRate = VidyoRoomStatsGetcurrentBandwidthDecodePixelRateNative(objPtr); currentBandwidthEncodePixelRate = VidyoRoomStatsGetcurrentBandwidthEncodePixelRateNative(objPtr); currentCpuDecodePixelRate = VidyoRoomStatsGetcurrentCpuDecodePixelRateNative(objPtr); currentCpuEncodePixelRate = VidyoRoomStatsGetcurrentCpuEncodePixelRateNative(objPtr); id = (string)MarshalPtrToUtf8.GetInstance().MarshalNativeToManaged(VidyoRoomStatsGetidNative(objPtr)); maxDecodePixelRate = VidyoRoomStatsGetmaxDecodePixelRateNative(objPtr); maxEncodePixelRate = VidyoRoomStatsGetmaxEncodePixelRateNative(objPtr); maxVideoSources = VidyoRoomStatsGetmaxVideoSourcesNative(objPtr); participantGenerationStats = csParticipantGenerationStats; participantStats = csParticipantStats; rateShaperApp = csRateShaperApp; rateShaperAudio = csRateShaperAudio; rateShaperVideo = csRateShaperVideo; receiveBitRateAvailable = VidyoRoomStatsGetreceiveBitRateAvailableNative(objPtr); receiveBitRateTotal = VidyoRoomStatsGetreceiveBitRateTotalNative(objPtr); reflectorId = (string)MarshalPtrToUtf8.GetInstance().MarshalNativeToManaged(VidyoRoomStatsGetreflectorIdNative(objPtr)); sendBitRateAvailable = VidyoRoomStatsGetsendBitRateAvailableNative(objPtr); sendBitRateTotal = VidyoRoomStatsGetsendBitRateTotalNative(objPtr); staticSources = VidyoRoomStatsGetstaticSourcesNative(objPtr); transportInformation = csTransportInformation; VidyoRoomStatsFreetransportInformationArrayNative(nTransportInformation, nTransportInformationSize); VidyoRoomStatsFreeparticipantStatsArrayNative(nParticipantStats, nParticipantStatsSize); VidyoRoomStatsFreeparticipantGenerationStatsArrayNative(nParticipantGenerationStats, nParticipantGenerationStatsSize); }
public RoomStats(IntPtr obj) { objPtr = obj; List <ParticipantGenerationStats> csParticipantGenerationStats = new List <ParticipantGenerationStats>(); int nParticipantGenerationStatsSize = 0; IntPtr nParticipantGenerationStats = VidyoRoomStatsGetparticipantGenerationStatsArrayNative(VidyoRoomStatsGetparticipantGenerationStatsNative(objPtr), ref nParticipantGenerationStatsSize); int nParticipantGenerationStatsIndex = 0; while (nParticipantGenerationStatsIndex < nParticipantGenerationStatsSize) { ParticipantGenerationStats csTparticipantGenerationStats = new ParticipantGenerationStats(Marshal.ReadIntPtr(nParticipantGenerationStats + (nParticipantGenerationStatsIndex * Marshal.SizeOf(nParticipantGenerationStats)))); csParticipantGenerationStats.Add(csTparticipantGenerationStats); nParticipantGenerationStatsIndex++; } List <ParticipantStats> csParticipantStats = new List <ParticipantStats>(); int nParticipantStatsSize = 0; IntPtr nParticipantStats = VidyoRoomStatsGetparticipantStatsArrayNative(VidyoRoomStatsGetparticipantStatsNative(objPtr), ref nParticipantStatsSize); int nParticipantStatsIndex = 0; while (nParticipantStatsIndex < nParticipantStatsSize) { ParticipantStats csTparticipantStats = new ParticipantStats(Marshal.ReadIntPtr(nParticipantStats + (nParticipantStatsIndex * Marshal.SizeOf(nParticipantStats)))); csParticipantStats.Add(csTparticipantStats); nParticipantStatsIndex++; } List <MediaConnectionTransportInfo> csTransportInformation = new List <MediaConnectionTransportInfo>(); int nTransportInformationSize = 0; IntPtr nTransportInformation = VidyoRoomStatsGettransportInformationArrayNative(VidyoRoomStatsGettransportInformationNative(objPtr), ref nTransportInformationSize); int nTransportInformationIndex = 0; while (nTransportInformationIndex < nTransportInformationSize) { MediaConnectionTransportInfo csTtransportInformation = new MediaConnectionTransportInfo(Marshal.ReadIntPtr(nTransportInformation + (nTransportInformationIndex * Marshal.SizeOf(nTransportInformation)))); csTransportInformation.Add(csTtransportInformation); nTransportInformationIndex++; } availableDecodeBwCpuPercent = VidyoRoomStatsGetavailableDecodeBwCpuPercentNative(objPtr); availableDecodeCpuPercent = VidyoRoomStatsGetavailableDecodeCpuPercentNative(objPtr); availableEncodeBwCpuPercent = VidyoRoomStatsGetavailableEncodeBwCpuPercentNative(objPtr); availableEncodeCpuPercent = VidyoRoomStatsGetavailableEncodeCpuPercentNative(objPtr); callId = Marshal.PtrToStringAnsi(VidyoRoomStatsGetcallIdNative(objPtr)); conferenceId = Marshal.PtrToStringAnsi(VidyoRoomStatsGetconferenceIdNative(objPtr)); cpuUsage = VidyoRoomStatsGetcpuUsageNative(objPtr); currentBandwidthDecodePixelRate = VidyoRoomStatsGetcurrentBandwidthDecodePixelRateNative(objPtr); currentBandwidthEncodePixelRate = VidyoRoomStatsGetcurrentBandwidthEncodePixelRateNative(objPtr); currentCpuDecodePixelRate = VidyoRoomStatsGetcurrentCpuDecodePixelRateNative(objPtr); currentCpuEncodePixelRate = VidyoRoomStatsGetcurrentCpuEncodePixelRateNative(objPtr); id = Marshal.PtrToStringAnsi(VidyoRoomStatsGetidNative(objPtr)); maxDecodePixelRate = VidyoRoomStatsGetmaxDecodePixelRateNative(objPtr); maxEncodePixelRate = VidyoRoomStatsGetmaxEncodePixelRateNative(objPtr); maxVideoSources = VidyoRoomStatsGetmaxVideoSourcesNative(objPtr); participantGenerationStats = csParticipantGenerationStats; participantStats = csParticipantStats; receiveBitRateAvailable = VidyoRoomStatsGetreceiveBitRateAvailableNative(objPtr); receiveBitRateTotal = VidyoRoomStatsGetreceiveBitRateTotalNative(objPtr); reflectorId = Marshal.PtrToStringAnsi(VidyoRoomStatsGetreflectorIdNative(objPtr)); sendBitRateAvailable = VidyoRoomStatsGetsendBitRateAvailableNative(objPtr); sendBitRateTotal = VidyoRoomStatsGetsendBitRateTotalNative(objPtr); staticSources = VidyoRoomStatsGetstaticSourcesNative(objPtr); transportInformation = csTransportInformation; VidyoRoomStatsFreetransportInformationArrayNative(nTransportInformation, nTransportInformationSize); VidyoRoomStatsFreeparticipantStatsArrayNative(nParticipantStats, nParticipantStatsSize); VidyoRoomStatsFreeparticipantGenerationStatsArrayNative(nParticipantGenerationStats, nParticipantGenerationStatsSize); }