예제 #1
0
MediaStatistics VideoStream::GetStatistics()
{
	MediaStatistics stats;

	//Fill stats
	stats.isReceiving	= IsReceiving();
	stats.isSending		= IsSending();
	stats.lostRecvPackets   = rtp.GetLostRecvPackets();
	stats.numRecvPackets	= rtp.GetNumRecvPackets();
	stats.numSendPackets	= rtp.GetNumSendPackets();
	stats.totalRecvBytes	= rtp.GetTotalRecvBytes();
	stats.totalSendBytes	= rtp.GetTotalSendBytes();

	//Return it
	return stats;
}
예제 #2
0
파일: uv++-udp.cpp 프로젝트: LiTianjue/uvpp
    int Udp::Send(/* [in] */ Buffer &buf,
                  /* [in] */ const Address &addr,
                  /* [in] */ SendHandler *handler)
    {
        assert(IsOpened());
        assert(! IsSending());

        int result = uv_udp_send(&m_sendReq,
                                 *this,
                                 buf,
                                 1,
                                 addr,
                                 OnSend);
        if(! result) {
            Ref();
            m_pSendBuffer = buf.Ref();
            m_pSendBuffer->Lock();
            m_pSendHandler = handler;
        }

        return result;
    }