예제 #1
0
파일: QLManager.cs 프로젝트: dazhouhu/QLSDK
        /// <summary>
        /// 应用程序回调
        /// </summary>
        private static void AddAppCallbackF(IntPtr appHandle, IntPtr appNamePtr)
        {
            var appName = IntPtrHelper.IntPtrTostring(appNamePtr);

            log.Info("AddAppCallbackF: appHandle:" + appHandle + "  appName:" + appName);
            var app = new QLApp(appHandle, appName);

            callView.Invoke(new Action(() =>
            {
                QLManager.GetInstance().apps.Add(app);
            }));
        }
예제 #2
0
파일: QLManager.cs 프로젝트: dazhouhu/QLSDK
        /// <summary>
        /// 日志回调
        /// </summary>
        private static void AddLogCallbackF(long timestamp, bool expired, int funclevel, int pid, int tid, IntPtr lev, IntPtr comp, IntPtr msg, int len)
        {
            var output    = string.Empty;
            var level     = IntPtrHelper.IntPtrToUTF8string(lev);
            var component = IntPtrHelper.IntPtrTostring(comp);
            var message   = IntPtrHelper.IntPtrTostring(msg);

            if (string.IsNullOrEmpty(component))
            {
                component = "wrapper";
            }

            output += string.Format(" [PID:{0}][TID:{1}] ", pid, tid);;

            output += component + "  " + message;

            for (int i = 0; i < funclevel; i++)
            {
                output += "  ";
            }

            if (level == "DEBUG")
            {
                log.Debug(output);
            }
            else if (level == "INFO")
            {
                log.Info(output);
            }
            else if (level == "WARN")
            {
                log.Warn(output);
            }
            else if (level == "ERROR")
            {
                log.Error(output);
            }
            else
            {
                log.Fatal(output);
            }
        }
예제 #3
0
파일: QLManager.cs 프로젝트: dazhouhu/QLSDK
        /// <summary>
        /// 统计信息回调
        /// </summary>
        private static void DisplayMediaStatisticsCallbackF(IntPtr channelNamePtr, IntPtr participantNamePtr, IntPtr remoteSystemIdPtr, IntPtr callRatePtr, IntPtr packetsLostPtr, IntPtr packetLossPtr,
                                                            IntPtr videoProtocolPtr, IntPtr videoRatePtr, IntPtr videoRateUsedPtr, IntPtr videoFrameRatePtr, IntPtr videoPacketsLostPtr, IntPtr videoJitterPtr,
                                                            IntPtr videoFormatPtr, IntPtr errorConcealmentPtr, IntPtr audioProtocolPtr, IntPtr audioRatePtr, IntPtr audioPacketsLostPtr, IntPtr audioJitterPtr,
                                                            IntPtr audioEncryptPtr, IntPtr videoEncryptPtr, IntPtr feccEncryptPtr, IntPtr audioReceivedPacketPtr, IntPtr roundTripTimePtr,
                                                            IntPtr fullIntraFrameRequestPtr, IntPtr intraFrameSentPtr, IntPtr packetsCountPtr, IntPtr overallCPULoadPtr, IntPtr channelNumPtr)
        {
            var channelName           = IntPtrHelper.IntPtrTostring(channelNamePtr);
            var participantName       = IntPtrHelper.IntPtrTostring(participantNamePtr);
            var remoteSystemId        = IntPtrHelper.IntPtrTostring(remoteSystemIdPtr);
            var callRate              = IntPtrHelper.IntPtrTostring(callRatePtr);
            var packetsLost           = IntPtrHelper.IntPtrTostring(packetsLostPtr);
            var packetLoss            = IntPtrHelper.IntPtrTostring(packetLossPtr);
            var videoProtocol         = IntPtrHelper.IntPtrTostring(videoProtocolPtr);
            var videoRate             = IntPtrHelper.IntPtrTostring(videoRatePtr);
            var videoRateUsed         = IntPtrHelper.IntPtrTostring(videoRateUsedPtr);
            var videoFrameRate        = IntPtrHelper.IntPtrTostring(videoFrameRatePtr);
            var videoPacketsLost      = IntPtrHelper.IntPtrTostring(videoPacketsLostPtr);
            var videoJitter           = IntPtrHelper.IntPtrTostring(videoJitterPtr);
            var videoFormat           = IntPtrHelper.IntPtrTostring(videoFormatPtr);
            var errorConcealment      = IntPtrHelper.IntPtrTostring(errorConcealmentPtr);
            var audioProtocol         = IntPtrHelper.IntPtrTostring(audioProtocolPtr);
            var audioRate             = IntPtrHelper.IntPtrTostring(audioRatePtr);
            var audioPacketsLost      = IntPtrHelper.IntPtrTostring(audioPacketsLostPtr);
            var audioJitter           = IntPtrHelper.IntPtrTostring(audioJitterPtr);
            var audioEncrypt          = IntPtrHelper.IntPtrTostring(audioEncryptPtr);
            var videoEncrypt          = IntPtrHelper.IntPtrTostring(videoEncryptPtr);
            var feccEncrypt           = IntPtrHelper.IntPtrTostring(feccEncryptPtr);
            var audioReceivedPacket   = IntPtrHelper.IntPtrTostring(audioReceivedPacketPtr);
            var roundTripTime         = IntPtrHelper.IntPtrTostring(roundTripTimePtr);
            var fullIntraFrameRequest = IntPtrHelper.IntPtrTostring(fullIntraFrameRequestPtr);
            var intraFrameSent        = IntPtrHelper.IntPtrTostring(intraFrameSentPtr);
            var packetsCount          = IntPtrHelper.IntPtrTostring(packetsCountPtr);
            var overallCPULoad        = IntPtrHelper.IntPtrTostring(overallCPULoadPtr);
            int channelNo             = 0;

            if (int.TryParse(IntPtrHelper.IntPtrTostring(channelNumPtr), out channelNo))
            {
                var statistics = new QLMediaStatistics()
                {
                    ChannelName           = channelName == "(null)"?string.Empty:channelName,
                    ParticipantName       = participantName == "(null)" ? string.Empty : participantName,
                    RemoteSystemId        = remoteSystemId == "(null)" ? string.Empty : remoteSystemId,
                    CallRate              = callRate == "(null)" ? string.Empty : callRate,
                    PacketsLost           = packetsLost == "(null)" ? string.Empty : packetsLost,
                    PacketLoss            = packetLoss == "(null)" ? string.Empty : packetLoss,
                    VideoProtocol         = videoProtocol == "(null)" ? string.Empty : videoProtocol,
                    VideoRate             = videoRate == "(null)" ? string.Empty : videoRate,
                    VideoRateUsed         = videoRateUsed == "(null)" ? string.Empty : videoRateUsed,
                    VideoFrameRate        = videoFrameRate == "(null)" ? string.Empty : videoFrameRate,
                    VideoPacketsLost      = videoPacketsLost == "(null)" ? string.Empty : videoPacketsLost,
                    VideoJitter           = videoJitter == "(null)" ? string.Empty : videoJitter,
                    VideoFormat           = videoFormat == "(null)" ? string.Empty : videoFormat,
                    ErrorConcealment      = errorConcealment == "(null)" ? string.Empty : errorConcealment,
                    AudioProtocol         = audioProtocol == "(null)" ? string.Empty : audioProtocol,
                    AudioRate             = audioRate == "(null)" ? string.Empty : audioRate,
                    AudioPacketsLost      = audioPacketsLost == "(null)" ? string.Empty : audioPacketsLost,
                    AudioJitter           = audioJitter == "(null)" ? string.Empty : audioJitter,
                    AudioEncrypt          = audioEncrypt == "(null)" ? string.Empty : audioEncrypt,
                    VideoEncrypt          = videoEncrypt == "(null)" ? string.Empty : videoEncrypt,
                    FeccEncrypt           = feccEncrypt == "(null)" ? string.Empty : feccEncrypt,
                    AudioReceivedPacket   = audioReceivedPacket == "(null)" ? string.Empty : audioReceivedPacket,
                    RoundTripTime         = roundTripTime == "(null)" ? string.Empty : roundTripTime,
                    FullIntraFrameRequest = fullIntraFrameRequest == "(null)" ? string.Empty : fullIntraFrameRequest,
                    IntraFrameSent        = intraFrameSent == "(null)" ? string.Empty : intraFrameSent,
                    PacketsCount          = packetsCount == "(null)" ? string.Empty : packetsCount,
                    OverallCPULoad        = overallCPULoad == "(null)" ? string.Empty : overallCPULoad,
                    ChannelNum            = channelNo
                };
                callView.Invoke(new Action(() =>
                {
                    QLManager.GetInstance().mediaStatistics.Add(statistics);
                }));
            }
        }
예제 #4
0
파일: QLManager.cs 프로젝트: dazhouhu/QLSDK
        /// <summary>
        /// 事件回调
        /// </summary>
        private static void AddEventCallbackF(IntPtr eventHandle, int call, IntPtr placeId, int eventType, IntPtr callerName,
                                              IntPtr calleeName, int userCode, IntPtr reason, int wndWidth, int wndHeight, bool plugDeviceStatus, IntPtr plugDeviceName, IntPtr deviceHandle, IntPtr ipAddress, int callMode,
                                              int streamId, int activeSpeakerStreamId, int remoteVideoChannelNum, IntPtr remoteChannelDisplayName, bool isActiveSpeaker, int isTalkingFlag, IntPtr regID, IntPtr sipCallId, IntPtr version, IntPtr serialNumber, IntPtr notBefore, IntPtr notAfter,
                                              IntPtr issuer, IntPtr subject, IntPtr signatureAlgorithm, IntPtr fingerPrintAlgorithm, IntPtr fingerPrint, IntPtr publickey, IntPtr basicContraints, IntPtr keyUsage, IntPtr rxtendedKeyUsage,
                                              IntPtr subjectAlternateNames, IntPtr pemCert, bool isCertHostNameOK, int certFailReason, int certConfirmId, IntPtr transcoderTaskId, IntPtr transcoderInputFileName, int iceStatus, IntPtr sutLiteMessage, bool isVideoOK, IntPtr mediaIPAddr, int discoveryStatus)
        {
            var strplaceId                  = IntPtrHelper.IntPtrTostring(placeId);
            var strcallerName               = IntPtrHelper.IntPtrTostring(callerName);
            var strcalleeName               = IntPtrHelper.IntPtrTostring(calleeName);
            var strreason                   = IntPtrHelper.IntPtrTostring(reason);
            var strplugDeviceName           = IntPtrHelper.IntPtrTostring(plugDeviceName);
            var strdeviceHandle             = IntPtrHelper.IntPtrTostring(deviceHandle);
            var stripAddress                = IntPtrHelper.IntPtrTostring(ipAddress);
            var strremoteChannelDisplayName = IntPtrHelper.IntPtrTostring(remoteChannelDisplayName);
            var strregID                   = IntPtrHelper.IntPtrTostring(regID);
            var strsipCallId               = IntPtrHelper.IntPtrTostring(sipCallId);
            var strVersion                 = IntPtrHelper.IntPtrTostring(version);
            var strSerialNumber            = IntPtrHelper.IntPtrTostring(serialNumber);
            var strNotBefore               = IntPtrHelper.IntPtrTostring(notBefore);
            var strNotAfter                = IntPtrHelper.IntPtrTostring(notAfter);
            var strIssuer                  = IntPtrHelper.IntPtrTostring(issuer);
            var strSubject                 = IntPtrHelper.IntPtrTostring(subject);
            var strSignatureAlgorithm      = IntPtrHelper.IntPtrTostring(signatureAlgorithm);
            var strFingerPrintAlgorithm    = IntPtrHelper.IntPtrTostring(fingerPrintAlgorithm);
            var strFingerPrint             = IntPtrHelper.IntPtrTostring(fingerPrint);
            var strPublickey               = IntPtrHelper.IntPtrTostring(publickey);
            var strBasicContraints         = IntPtrHelper.IntPtrTostring(basicContraints);
            var strKeyUsage                = IntPtrHelper.IntPtrTostring(keyUsage);
            var strExtendedKeyUsage        = IntPtrHelper.IntPtrTostring(rxtendedKeyUsage);
            var strSubjectAlternateNames   = IntPtrHelper.IntPtrTostring(subjectAlternateNames);
            var strPemCert                 = IntPtrHelper.IntPtrTostring(pemCert);
            var strtranscoderInputFileName = IntPtrHelper.IntPtrTostring(transcoderInputFileName);
            var strSUTLiteMessage          = IntPtrHelper.IntPtrTostring(sutLiteMessage);
            var strMediaIPAddr             = IntPtrHelper.IntPtrTostring(mediaIPAddr);
            var evt = new QLEvent(eventHandle, call, strplaceId, (EventType)eventType, strcallerName,
                                  strcalleeName, userCode, strreason,
                                  wndWidth, wndHeight, plugDeviceStatus, strplugDeviceName, strdeviceHandle, stripAddress, (CallMode)callMode,
                                  streamId, activeSpeakerStreamId, remoteVideoChannelNum, strremoteChannelDisplayName, isActiveSpeaker, isTalkingFlag, strregID, strsipCallId,
                                  strVersion,
                                  strSerialNumber,
                                  strNotBefore,
                                  strNotAfter,
                                  strIssuer,
                                  strSubject,
                                  strSignatureAlgorithm,
                                  strFingerPrintAlgorithm,
                                  strFingerPrint,
                                  strPublickey,
                                  strBasicContraints,
                                  strKeyUsage,
                                  strExtendedKeyUsage,
                                  strSubjectAlternateNames,
                                  strPemCert,
                                  isCertHostNameOK,
                                  certFailReason,
                                  certConfirmId,
                                  transcoderTaskId,
                                  strtranscoderInputFileName,
                                  (ICEStatus)iceStatus,
                                  strSUTLiteMessage,
                                  isVideoOK,
                                  strMediaIPAddr,
                                  (AutoDiscoveryStatus)discoveryStatus);

            AddEvent(evt);
        }