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


C++ Participant::getSDESItem方法代码示例

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


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

示例1: onGotHello

void RTPAudio::onGotHello(const SyncSource &src)
{
	RTPEvent *event = RTPEvent::first;

	slog(Slog::levelDebug) << "hello(" << src.getID() << ") ";
        Participant* p = src.getParticipant();
	slog() << p->getSDESItem(SDESItemTypeCNAME) << std::endl;

	while(event)
	{
		event->gotHello(src);
		event = event->next;
	}
}
开发者ID:dyfet,项目名称:ccrtp,代码行数:14,代码来源:rtp.cpp

示例2: onGotGoodbye

void RTPAudio::onGotGoodbye(const SyncSource &src, const string& reason)
{
	RTPEvent *event = RTPEvent::first;

	slog(Slog::levelDebug) << "bye(" << src.getID() << ") ";
	Participant* p = src.getParticipant();
	slog() << p->getSDESItem(SDESItemTypeCNAME) << "; " << reason;
	slog() << std::endl;

	while(event)
	{
		event->gotGoodbye(src, reason);
		event = event->next;
	}
}
开发者ID:dyfet,项目名称:ccrtp,代码行数:15,代码来源:rtp.cpp

示例3: doTest

    int doTest()
    {
        const uint32 NSESSIONS = 10;
        RTPSession rx(pattern.getDestinationAddress(),pattern.getDestinationPort());
        RTPSession **tx = new RTPSession* [NSESSIONS];
        for ( uint32 i = 0; i < NSESSIONS; i++ ) {
            tx[i] = new RTPSession(InetHostAddress("localhost"));
        }
        for ( uint32 i = 0; i  < NSESSIONS; i++) {
            tx[i]->setSchedulingTimeout(10000);
            tx[i]->setExpireTimeout(1000000);
            tx[i]->setPayloadFormat(StaticPayloadFormat(sptPCMU));
            if ( !tx[i]->addDestination(pattern.getDestinationAddress(), pattern.getDestinationPort()) ) {
                return 1;
            }
        }

        rx.setPayloadFormat(StaticPayloadFormat(sptPCMU));
        rx.setSchedulingTimeout(5000);
        rx.setExpireTimeout(10000000); // 10 seconds!
        rx.startRunning();

        for ( uint32 i = 0; i  < NSESSIONS; i++) {
            tx[i]->startRunning();
        }
        uint32 period = 20;
        TimerPort::setTimer(period);
        for ( uint32 i = 0; i < pattern.getPacketsNumber(); i++ ) {
            if ( i == 70 ) {
                RTPApplication &app = defaultApplication();
                app.setSDESItem(SDESItemTypeCNAME,"[email protected]");
            }
            for ( uint32 s = 0; s  < NSESSIONS; s++) {
            // 50 packets per second (packet duration of 20ms)
                uint16 inc =
                    tx[s]->getCurrentRTPClockRate()/50;
                tx[s]->putData(i*inc, pattern.getPacketData(i), pattern.getPacketSize(i));
            }
            Thread::sleep(TimerPort::getTimer());
            TimerPort::incTimer(period);
        }

        Thread::sleep(5000);
        for ( uint32 i = 0; i < NSESSIONS; i++ ) {
            delete tx[i];
        }
        RTPSession::SyncSourcesIterator it;
        cout << "Sources of synchronization:" << endl;
        for (it = rx.begin() ; it != rx.end(); it++) {
            const SyncSource &s = *it;
            cout << s.getID();
            if ( s.isSender() )
                cout << " (sender) ";
            cout << s.getNetworkAddress() << ":" <<
                s.getControlTransportPort() << "/" <<
                s.getDataTransportPort();
            Participant *p = s.getParticipant();
            cout << " (" <<
                p->getSDESItem(SDESItemTypeCNAME)
                 << ") " << endl;
        }
        RTPApplication &app = defaultApplication();
        RTPApplication::ParticipantsIterator ai;
        cout << "Participants:" << endl;
        for ( ai = app.begin(); ai != app.end(); ai++ ) {
            const Participant &p = *ai;
            cout << p.getSDESItem(SDESItemTypeCNAME) << endl;
            //cout << p.getPRIVPrefix();
        }
        delete[] tx;
        return 0;
    }
开发者ID:dyfet,项目名称:ccrtp,代码行数:72,代码来源:ccrtptest.cpp


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