void MicView::spin(){ ros::Rate looprate(50); while(ros::ok()){ ros::spinOnce(); sendMicData(); looprate.sleep(); } }
void AudioZrtpSession::run() { // Set recording sampling rate call_.setRecordingSmplRate(getCodecSampleRate()); DEBUG("Entering mainloop for call %s", call_.getCallId().c_str()); uint32 timeout = 0; while (isActive()) { if (timeout < 1000) timeout = getSchedulingTimeout(); // Send session if (DtmfPending()) sendDtmfEvent(); else sendMicData(); controlReceptionService(); controlTransmissionService(); uint32 maxWait = timeval2microtimeout(getRTCPCheckInterval()); // make sure the scheduling timeout is // <= the check interval for RTCP // packets timeout = (timeout > maxWait) ? maxWait : timeout; if (timeout < 1000) { // !(timeout/1000) // dispatchDataPacket(); timerTick(); } else { if (isPendingData(timeout / 1000)) { if (isActive()) takeInDataPacket(); } timeout = 0; } } DEBUG("Left main loop for call %s", call_.getCallId().c_str()); }