当前位置: 首页>>代码示例>>C++>>正文


C++ Timestamp::epochMicroseconds方法代码示例

本文整理汇总了C++中poco::Timestamp::epochMicroseconds方法的典型用法代码示例。如果您正苦于以下问题:C++ Timestamp::epochMicroseconds方法的具体用法?C++ Timestamp::epochMicroseconds怎么用?C++ Timestamp::epochMicroseconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在poco::Timestamp的用法示例。


在下文中一共展示了Timestamp::epochMicroseconds方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: lock

uint32_t MeetingFrameImpl::StartPublishVideo2(uint64_t ulToUserID,uint32_t ulChannelID,IVideoWin*videoWin)
{
	Mutex::ScopedLock lock(m_Mutex);
	if(ulChannelID <0)
		return 0;
	int count = GetVideoCaptureDeviceCount();
	if(count == 0)
		return 0;

	if(ulChannelID>GetVideoCaptureDeviceCount()-1)
		ulChannelID = 0;
	if(m_bHasStartVideo2 == true)
		return 0;
	m_bHasStartVideo2 = true;
	m_bVideoMonitor = true;
	uint64_t myGuid ;
	Poco::Timestamp t;
	uint32_t ulSSRC = unsigned int(t.epochMicroseconds()&0xFFFFFFFF);
	if(videoWin)
	{
		videoWin->SetUserID(0);
		videoWin->SetUserName(GetUserName(ulToUserID));
		m_myUserInfo.ulVideoSSRC = m_pIZYMediaStreamManager->StartVideoSender(ulSSRC,ulChannelID,
			videoWin, MeetingConnImpl::GetInstance()->GetRoomID());
		if(m_myUserInfo.ulVideoSSRC > 0)
		{
			return ulSSRC;
		}
	}
	else
	{
		return 0;
	}
}
开发者ID:ACEZLY,项目名称:openmeeting2,代码行数:34,代码来源:MeetingFrameImpl.cpp

示例2: main

int main(int argc, char**argv) {
  dsosg::DSOSG *dsosg;
  Poco::Timestamp time;
  bool done;

  osg::ArgumentParser arguments(&argc, argv);
  arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
  arguments.getApplicationUsage()->setDescription("Manual display/camera calibration utility");
  arguments.getApplicationUsage()->addCommandLineOption("--config <filename>","Display server config JSON file");
  arguments.getApplicationUsage()->addCommandLineOption("--display-mode <name>","Display mode");

  osg::ApplicationUsage::Type help = arguments.readHelpType();
  if (help != osg::ApplicationUsage::NO_HELP) {
      arguments.getApplicationUsage()->write(std::cout);
      exit(0);
  }

  std::string config_filename = "~/flyvr-devel/flyvr/flyvr/config/config.json";
  while(arguments.read("--config", config_filename));

  std::string display_mode = "vr_display";
  while(arguments.read("--display-mode", display_mode));

  std::string flyvr_basepath = "/home/john/Programming/flyvr.git/flyvr/";
  float observer_radius = 0.01;
  bool two_pass = false;
  bool show_geom_coords = false;

  osg::Vec3 observer_position(0,0,0);
  osg::Quat observer_orientation(0,0,0,1);

  dsosg = new dsosg::DSOSG(
                        flyvr_basepath,
                        display_mode,
                        observer_radius,
                        config_filename,
                        two_pass,
                        show_geom_coords);

  dsosg->setup_viewer("display_server","{}");
  dsosg->set_stimulus_plugin("Stimulus3DDemo");

  done = false;
  while (!done) {
    float now;

    time.update();
    now = time.epochMicroseconds() * 1e6; /* microseconds to seconds */

    dsosg->update(now, observer_position, observer_orientation);
    dsosg->frame();
    done = dsosg->done();
  }

	return 0;
}
开发者ID:loopbio,项目名称:FreemooVR,代码行数:56,代码来源:main.cpp

示例3: run

void XplDevice::run ( void )
{
    if ( !m_bInitialised )
    {
        assert ( 0 );
        return;
    }

    while ( !m_bExitThread )
    {
        // Deal with heartbeats
        int64_t currentTime;
        Poco::Timestamp tst;
        tst.update();
        currentTime = tst.epochMicroseconds();
        //GetSystemTimeAsFileTime( (FILETIME*)&currentTime );
        
        if ( m_nextHeartbeat <= currentTime )
        {
            poco_debug( devLog, "Sending heartbeat" );
            // It is time to send a heartbeat
            if ( m_bConfigRequired )
            {
                // Send a config heartbeat, then calculate the time of the next one
                m_pComms->SendConfigHeartbeat ( m_completeId, m_heartbeatInterval, m_version );
            }
            else
            {
                // Send a heartbeat, then calculate the time of the next one
                m_pComms->SendHeartbeat ( m_completeId, m_heartbeatInterval, m_version );
            }

            SetNextHeartbeatTime();
        }
        // Calculate the time (in milliseconds) until the next heartbeat
        int32 heartbeatTimeout = ( int32 ) ( ( m_nextHeartbeat - currentTime ) ); // Divide by 10000 to convert 100 nanosecond intervals to milliseconds.
        poco_debug ( devLog, "Sleeping " + NumberFormatter::format ( heartbeatTimeout/1000 ) + " seconds till next hbeat" );
        m_hRxInterrupt->tryWait ( heartbeatTimeout );
        //Thread::sleep();
        poco_debug ( devLog, "Woken up for hbeat or interrupt" );

    }
// 	cout << "exiting dev thread (ret)\n";
    return;
}
开发者ID:zeroping,项目名称:xPLsdk-poco,代码行数:45,代码来源:XplDevice.cpp

示例4: SetNextHeartbeatTime

void XplDevice::SetNextHeartbeatTime()
{
    // Set the new heartbeat time
    int64_t currentTime;
    Poco::Timestamp tst;
    tst.update();
    currentTime = tst.epochMicroseconds();
    //GetSystemTimeAsFileTime( (FILETIME*)&currentTime );

    // If we're waiting for a hub, we have to send at more
    // rapid intervals - every 3 seconds for the first two
    // minutes, then once every 30 seconds after that.
    if ( m_bWaitingForHub )
    {
        if ( m_rapidHeartbeatCounter )
        {
            // This counter starts at 40 for 2 minutes of
            // heartbeats at 3 second intervals.
            --m_rapidHeartbeatCounter;


            m_nextHeartbeat = currentTime + ( ( int64_t ) c_rapidHeartbeatFastInterval * 1000l );
        }
        else
        {
            // one second
            m_nextHeartbeat = currentTime + ( ( int64_t ) c_rapidHeartbeatSlowInterval * 1000l );
        }
    }
    else
    {
        // It is time to send a heartbeat
        if ( m_bConfigRequired )
        {
            // one minute
            m_nextHeartbeat = currentTime + 60*1000l;
        }
        else
        {
            // 60000000 is one minute in the 100 nanosecond intervals
            // that the system time is measured in.
            m_nextHeartbeat = currentTime + ( ( int64_t ) m_heartbeatInterval * 60*1000l );
        }
    }
}
开发者ID:zeroping,项目名称:xPLsdk-poco,代码行数:45,代码来源:XplDevice.cpp

示例5: TestSchedule

//----------------------------------------
//	TestSchedule
//----------------------------------------
void TestSchedule(ScopedLogMessage& msg, Poco::Util::Timer& timer)
{
	msg.Message("--- schedule ---");

	const Poco::Timestamp::TimeDiff kTimeDiff = 500000;	// 500msec

	Poco::Event event;
	MyTimerTask task(msg, event);
	Poco::Util::TimerTask::Ptr pTask = new Poco::Util::TimerTaskAdapter<MyTimerTask>(task, &MyTimerTask::onTimer);

	Poco::Timestamp time;
	time += kTimeDiff;
	timer.schedule(pTask, time);
	
	event.wait();
	msg.Message(Poco::format("    execution delay from scheduled: %Ldusec"
							, pTask->lastExecution().epochMicroseconds()-time.epochMicroseconds()));
}
开发者ID:schidler,项目名称:MeCloud,代码行数:21,代码来源:UtilTimerTest.cpp

示例6: On_MeetingEvent_Enter_Room_Result

void MeetingFrameImpl::On_MeetingEvent_Enter_Room_Result(uint32_t status,  char* pData)
{
	Mutex::ScopedLock lock(m_Mutex);
	
	switch(status)
	{  
	case 0:
		{
			if(m_mapOnlineUser.size()>0){
				//断线重新连接成功,清空在线用户
				m_mapOnlineUser.clear();
			}

			m_myUserInfo.userRole = MeetingConnImpl::GetInstance()->m_userRole;
			PROOM_INFO pRoomInfo = (PROOM_INFO)pData;
			m_pRoomInfo = new ROOM_INFO();
			memcpy((void*)(m_pRoomInfo),pData,sizeof(ROOM_INFO));
			kAudioMode = pRoomInfo->bMixAudio;
			m_orgi_user_role = MeetingConnImpl::GetInstance()->m_userRole;
			m_myUserInfo.userRole = MeetingConnImpl::GetInstance()->m_userRole;
			//启动音频接收
			if(kAudioMode == 1)
			{
				Poco::Timestamp t;
				m_ulMixAudioSSRC = unsigned int(t.epochMicroseconds()&0xFFFFFFFF)+rand();
				m_ulAudioPlaySSRC = m_ulMixAudioSSRC;
				m_pIZYMediaStreamManager->StartAudioRecver(m_ulMixAudioSSRC,m_mainHWND,MeetingConnImpl::GetInstance()->GetRoomID(),
					kAudioMode,m_pRoomInfo->sampleRate);
			}
			if(m_pEvent)
			{
				m_pEvent->On_MeetingEvent_UpdateUI();
			}
		}
		break;
	case kLoginResult_Meeting_NoRoom:             //房间号错误
		printf("not find room ! \n");
		break;
	case kLoginResult_Meeting_RoomPwd_NOTCorrent:        //密码错误
		printf("password not correct! \n");
		break;
	case kLoginResult_Meeting_NotAuth:            //没有权限进入
		break;
	}
开发者ID:ACEZLY,项目名称:openmeeting2,代码行数:44,代码来源:MeetingFrameImpl.cpp

示例7: TestInterval

//----------------------------------------
//	TestInterval
//----------------------------------------
void TestInterval(ScopedLogMessage& msg, Poco::Util::Timer& timer)
{
	msg.Message("--- schedule interval ---");

	Poco::Event event;
	MyTimerTask task(msg, event);
	Poco::Util::TimerTask::Ptr pTask = new Poco::Util::TimerTaskAdapter<MyTimerTask>(task, &MyTimerTask::onTimer);

	Poco::Timestamp time;
	timer.schedule(pTask, 500, 500);	// 500msec

	Poco::Timestamp::TimeVal val;
	val = WaitAndShowTime(msg, event, pTask, "    delay   :", time.epochMicroseconds());
	for(int i=0; i<2; ++i)
	{
		val = WaitAndShowTime(msg, event, pTask, "    interval:", val);
	}
	pTask->cancel();
}
开发者ID:schidler,项目名称:MeCloud,代码行数:22,代码来源:UtilTimerTest.cpp

示例8: StartPublishVideo

void MeetingFrameImpl::StartPublishVideo(uint64_t ulToUserID,uint32_t ulChannelID,IVideoWin*videoWin)
{
	Mutex::ScopedLock lock(m_Mutex);
	if(ulChannelID <0)
		return;
	int count = GetVideoCaptureDeviceCount();
	if(count == 0)
		return;

	if(ulChannelID>GetVideoCaptureDeviceCount()-1)
		ulChannelID = 0;
	if(m_bStartVideo == true)
		return;
	m_bStartVideo = true;
	uint64_t myGuid ;
	Poco::Timestamp t;
	uint32_t ulSSRC = unsigned int(t.epochMicroseconds()&0xFFFFFFFF);
	if(videoWin)
	{
		videoWin->SetUserID(0);
		videoWin->SetUserName(m_myUserInfo.strUserName);
		m_myUserInfo.ulVideoSSRC = m_pIZYMediaStreamManager->StartVideoSender(ulSSRC,ulChannelID,
			videoWin, MeetingConnImpl::GetInstance()->GetRoomID());
		m_bBroadcast = true;
		if(m_myUserInfo.ulVideoSSRC > 0)
		{
			char pData[64];
			myGuid = m_pIZYMediaStreamManager->GetGUID();
			memcpy(pData,&myGuid,8);
			memcpy(pData+8,&m_myUserInfo.ulVideoSSRC,4);
			char subMsg[512] = {0};
			sprintf(subMsg,"{\"cmd\":\"recvMyVideo\",\"ssrc\":%u,\"fromSessionID\":%I64u,\"channelID\":%u}"
				,m_myUserInfo.ulVideoSSRC,m_myUserInfo.sessionID,ulChannelID);
			MeetingConnImpl::GetInstance()->TransParentRoomCommand(0,subMsg);
		}
		
	}
	else
	{
		OutputDebugStringW(L"Get New IVideoWin Failed!\n");
	}
}
开发者ID:ACEZLY,项目名称:openmeeting2,代码行数:42,代码来源:MeetingFrameImpl.cpp

示例9: sizeof

void SHA1EngineExt::update(const Poco::Timestamp &data)
{
	Poco::Timestamp::TimeVal val = data.epochMicroseconds();
	SHA1Engine::update(&val, sizeof(val));
}
开发者ID:vok1980,项目名称:DistributedBudget,代码行数:5,代码来源:SHA1EngineExt.cpp


注:本文中的poco::Timestamp::epochMicroseconds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。