[hydra-commits] ken.hunt: branch techdemo/ken.hunt/benchmark r647 - in /techdemo/team/ken.hun...

SVN commits to the Hydra project hydra-commits at lists.digium.com
Fri May 28 18:10:11 CDT 2010


Author: ken.hunt
Date: Fri May 28 18:10:10 2010
New Revision: 647

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=647
Log:
rtp benchmarking

Added:
    techdemo/team/ken.hunt/benchmark/
    techdemo/team/ken.hunt/benchmark/rtp/
    techdemo/team/ken.hunt/benchmark/rtp/CMakeLists.txt   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/build/
    techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/driver/
    techdemo/team/ken.hunt/benchmark/rtp/driver/CMakeLists.txt   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/
    techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/CMakeLists.txt   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/client.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/
    techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/CMakeLists.txt   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/server.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/CMakeLists.txt   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/CMakeLists.txt   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/bla.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/collisiontestje.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/extratransmitters/
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/extratransmitters/rtpfaketransmitter.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/extratransmitters/rtpfaketransmitter.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/extratransmitters/rtpipv4nataddress.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/extratransmitters/rtpipv4nataddress.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/extratransmitters/rtpipv4natdestination.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/extratransmitters/rtpudpv4nattransmitter.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/extratransmitters/rtpudpv4nattransmitter.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/forwarder.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/ipv6test.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/packbuildtest.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/randport.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpapppacket.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpapppacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpbyepacket.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpbyepacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpcompoundpacket.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpcompoundpacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpcompoundpacketbuilder.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpcompoundpacketbuilder.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcppacket.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcppacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcppacketbuilder.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcppacketbuilder.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcprrpacket.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcprrpacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpscheduler.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpscheduler.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpsdesinfo.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpsdesinfo.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpsdespacket.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpsdespacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpsrpacket.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpsrpacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtcpunknownpacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpaddress.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpcollisionlist.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpcollisionlist.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpconfig.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpconfig_win.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpdebug.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpdebug.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpdefines.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtperrors.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtperrors.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtphashtable.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpinternalsourcedata.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpinternalsourcedata.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpipv4address.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpipv4address.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpipv4destination.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpipv6address.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpipv6address.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpipv6destination.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpkeyhashtable.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtplibraryversion.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtplibraryversion.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpmemorymanager.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpmemoryobject.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtppacket.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtppacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtppacketbuilder.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtppacketbuilder.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtppollthread.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtppollthread.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtprandom.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtprandom.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtprawpacket.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsession.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsession.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsessionparams.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsessionparams.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsessionsources.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsessionsources.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsourcedata.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsourcedata.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsources.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpsources.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpstructs.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtptimeutilities.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtptimeutilities.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtptransmitter.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtptypes.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtptypes_unix.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtptypes_win.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpudpv4transmitter.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpudpv4transmitter.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpudpv6transmitter.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/rtpudpv6transmitter.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/simplesoundtest.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/testje.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/testje3.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/testje4.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/testje5.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/src/translator.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/tools/
    techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/tools/gettypes.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/CMakeLists.txt   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/CMakeLists.txt   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/jmutex.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/jmutexautolock.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/jthread.h   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/pthread/
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/pthread/jmutex.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/pthread/jthread.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/win32/
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/win32/jmutex.cpp   (with props)
    techdemo/team/ken.hunt/benchmark/rtp/jthread-1.2.1/src/win32/jthread.cpp   (with props)

Added: techdemo/team/ken.hunt/benchmark/rtp/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/CMakeLists.txt?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/CMakeLists.txt Fri May 28 18:10:10 2010
@@ -1,0 +1,11 @@
+cmake_minimum_required(VERSION 2.6)
+
+project(benchmark)
+set(BUILD_SHARED_LIBS TRUE)
+
+set(BENCHMARK_INCLUDE_DIRECTORIES "" CACHE INTERNAL benchmark FORCE)
+set(BENCHMARK_LIB_DIRECTORIES "" CACHE INTERNAL benchmark FORCE)
+
+add_subdirectory(jthread-1.2.1)
+add_subdirectory(jrtplib-3.7.1)
+add_subdirectory(driver)

Propchange: techdemo/team/ken.hunt/benchmark/rtp/CMakeLists.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/CMakeLists.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/CMakeLists.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat Fri May 28 18:10:10 2010
@@ -1,0 +1,6 @@
+ at ECHO OFF
+REM  -Wdev: Enable developer warnings.
+REM --build <sourcedir> : for out-of-source building 
+
+cmake -Wdev --build ..
+

Propchange: techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/driver/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/driver/CMakeLists.txt?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/driver/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/driver/CMakeLists.txt Fri May 28 18:10:10 2010
@@ -1,0 +1,3 @@
+
+add_subdirectory(driverclient)
+add_subdirectory(driverserver)

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/CMakeLists.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/CMakeLists.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/CMakeLists.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/CMakeLists.txt?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/CMakeLists.txt Fri May 28 18:10:10 2010
@@ -1,0 +1,24 @@
+
+set(BOOST_ROOT $ENV{BOOST_HOME})
+find_package(Boost REQUIRED)
+
+include_directories (${BENCHMARK_INCLUDE_DIRECTORIES} ${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIR}) 
+link_directories(${BENCHMARK_LIB_DIRECTORIES} ${Boost_LIBRARY_DIRS})
+
+message(STATUS "Adding includes to client: ${BENCHMARK_INCLUDE_DIRECTORIES} ${CMAKE_CURRENT_SOURCE_DIR}")
+message(STATUS "Adding link dirs to client: ${BENCHMARK_LIB_DIRECTORIES}")
+
+set(SRCLIST "")
+set(SRCLIST ${SRCLIST}  client.cpp)
+set(SRCLIST ${SRCLIST}  RTPAppSession.cpp)
+
+add_executable(driverclient ${SRCLIST})
+
+set(LIBS jrtplib-3.7.1  jthread-1.2.1)
+if(WIN32)
+  set(LIBS ${LIBS} Ws2_32)
+endif()
+
+target_link_libraries(driverclient  ${LIBS})
+
+install(TARGETS driverclient DESTINATION bin/)

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/CMakeLists.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/CMakeLists.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/CMakeLists.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.cpp?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.cpp (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.cpp Fri May 28 18:10:10 2010
@@ -1,0 +1,53 @@
+/*---------------------------------------------------------------------------*/
+/* RTPAppSession.cpp
+/*---------------------------------------------------------------------------*/
+#include <iostream>
+#include "RTPAppSession.h"
+
+using namespace std;
+
+RTPAppSession::RTPAppSession() : mCount(0), mRunning(false), mStart(0)
+{
+   /**
+   boost::xtime_get(&mStart, boost::TIME_UTC);
+   **/
+}
+
+void RTPAppSession::OnRTPPacket(RTPPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
+{
+   uint8_t type = pack->GetPayloadType();
+
+   switch (type)
+   {
+   case 1:       // Reset flag. May get more than one each run.
+      mCount = 0;
+      if (!mRunning)
+      {
+         mRunning = true;
+         cout << "Received start of stream indicator." << endl;
+         mStart = receivetime;
+      }
+      break;
+
+   case 0:
+      mCount++;
+      break;
+
+   case 2:
+      if (mRunning)
+      {
+         mRunning = false;
+
+         RTPTime now = receivetime;
+
+         //unsigned int seconds = now.GetSeconds() - mStart.GetSeconds();
+         //unsigned int micros = now.GetMicroSeconds() - mStart.GetMicroSeconds();
+         double timeD = now.GetDouble() - mStart.GetDouble();
+
+         cout << "Received end of stream indicator." << endl;
+         cout << "  " << mCount << " packets received, Elapsed time:" << timeD << " seconds." << endl;
+  
+      }
+      break;
+   }
+}

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.h
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.h?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.h (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.h Fri May 28 18:10:10 2010
@@ -1,0 +1,29 @@
+/*---------------------------------------------------------------------------*/
+/* RtpSessionWrapper.h
+/* Since the RTPSession class creates a background thread that processes
+/*  incomming RTP & RTCP packets, the class is derived from so that the
+/*  callback methods can be overridden.
+/*---------------------------------------------------------------------------*/
+#ifndef _RTPAPPSESSION_H_
+#define _RTPAPPSESSION_H_
+
+#include "RTPSession.h"
+#include "RTPPacket.h"
+
+/*------------------------------------------*/
+/* RTPAppSession
+/*------------------------------------------*/
+class RTPAppSession : public RTPSession
+{
+public:
+   RTPAppSession();
+	virtual void OnRTPPacket(RTPPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress);
+   int GetCount() {return mCount;}
+
+private:
+   int mCount;
+   bool mRunning;
+   RTPTime mStart;
+};
+
+#endif

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.h
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/RTPAppSession.h
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/client.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/client.cpp?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/client.cpp (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/client.cpp Fri May 28 18:10:10 2010
@@ -1,0 +1,160 @@
+/*---------------------------------------------------------------------------*/
+/* main.cpp
+/*---------------------------------------------------------------------------*/
+#include <iostream>
+#include "RTPAppSession.h"
+#include <crtdbg.h> //for _ASSERT
+//JRTP includes
+#include "RTPIPv4Address.h"
+#include "RTPSessionParams.h"
+#include "RTPUDPv4Transmitter.h"
+
+#define MCAST_IP		"239.216.30.54"
+#define MCAST_PORT		4000
+
+std::string mDestAddress(MCAST_IP);
+int mDestPort(MCAST_PORT);
+
+#define MAX_PACKET_SIZE	((1024 * 64) - 1)
+using namespace std;
+/*-------------------------------------------------------*/
+/* ReportError
+/* Checking & display of RTP status codes
+/* Returns true if there was an error, false otherwise
+/*-------------------------------------------------------*/
+int ReportError(int errCode)
+{
+	int isErr = (errCode < 0);
+	if (isErr) {
+		std::string stdErrStr = RTPGetErrorString(errCode);
+		printf("Error %d: %s\n", errCode, stdErrStr.c_str());
+		printf("======================================\nPress Enter to exit\n");
+		getchar();
+	}
+	return isErr;
+}
+
+/*-------------------------------------------------------*/
+/* RunRtpClient
+/*-------------------------------------------------------*/
+void RunRtpClient()
+{
+	RTPAppSession rtpSession;
+
+   //setup session parameters
+	RTPSessionParams sessParams;
+	sessParams.SetOwnTimestampUnit(1.0 / 30.0); //30 video frames per second
+	sessParams.SetUsePollThread(true); //background thread to call virtual callbacks - set by default, but just to be sure
+	sessParams.SetMaximumPacketSize(MAX_PACKET_SIZE);
+
+   //setup transmission parameters
+	RTPUDPv4TransmissionParams transParams;
+	transParams.SetPortbase(mDestPort);
+	//CREATE THE SESSION
+	int status = rtpSession.Create(sessParams, &transParams);
+	if (ReportError(status))
+		return; //unable to create the session
+	printf("RTP session created with portbase %d\n", mDestPort);
+
+	//JOIN THE MULTICAST
+	// - data will be handled in the RTPAppSession::OnRTPPacket callback
+   unsigned long intIP = inet_addr(mDestAddress.c_str());
+	_ASSERT(intIP != INADDR_NONE);
+	intIP = ntohl(intIP); //put in host byte order
+	RTPIPv4Address rtpAddr(intIP, mDestPort);
+	status = rtpSession.JoinMulticastGroup(rtpAddr);
+
+	if (!ReportError(status)) 
+   {
+		printf("Multicast group joined: %s port %d\n", mDestAddress, mDestPort);
+
+		//just sit here, with the background thread doing the work...
+		printf("\n======================================\nListening for data - Press Enter key to exit\n");
+		getchar();
+
+		//LEAVE THE MULTICAST
+		rtpSession.LeaveMulticastGroup(rtpAddr);
+	}
+	//DESTROY THE SESSION
+	rtpSession.Destroy();
+}
+
+void PrintUsage(const std::string& appName)
+{
+	cout << "Usage: " << appName << " [-i ipaddress] [-p port] " << endl;
+   cout << "  -i ipaddress   - The ipaddress to address packets to. Default: " << mDestAddress << endl;
+   cout << "  -p destport    - The port to send packets from. Default: " << mDestPort << endl;
+}
+
+void PrintSettings()
+{
+   cout << "Executing with the following settings:" << endl;
+   cout << "  - Destination:" << mDestAddress << ":" << mDestPort << endl;
+}
+
+void ProcessCommandLineArgs(int argc, char *argv[])
+{
+   for(int i=1; i < argc; i++)
+   {
+      std::string s(argv[i]);
+      if (s[0] == '-')
+      {
+         switch(s[1])
+         {
+         case 'i': // ipaddress
+             if ((i+1 == argc) ||
+                (argv[i+1][0] == '-'))
+            {
+               cout << "Missing value parameter for -i" << endl;
+               PrintUsage(argv[0]);
+               exit(-1);
+            }
+
+            mDestAddress = argv[i+1];
+            i++;
+            break;
+
+         case 'p':  // destport
+            if ((i+1 == argc) ||
+                (argv[i+1][0] == '-'))
+            {
+                cout << "Missing value parameter for -p" << endl;
+              PrintUsage(argv[0]);
+               exit(-1);
+            }
+            mDestPort = atoi(argv[i+1]);
+            i++;
+            break;
+
+         case 'h':
+            PrintUsage(argv[0]);
+            exit(0);
+            break;
+
+         default:
+            PrintUsage(argv[0]);
+            exit(-1);
+         }
+      }
+   }
+}
+
+/*-------------------------------------------------------*/
+/* main
+/* entry point for the application
+/*-------------------------------------------------------*/
+int main(int argc, char* argv[])
+{
+   ProcessCommandLineArgs(argc, argv);
+   PrintSettings();
+
+	//MUST call WSAStartup() to use WS2_32.DLL
+	WSADATA wsaData;
+	WORD wVersionRequested = MAKEWORD( 2, 2 );
+	WSAStartup(wVersionRequested, &wsaData); //WSACleanup called in OnDestroy
+
+	RunRtpClient();
+
+	WSACleanup();
+	return 0;
+}

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/client.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/client.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverclient/client.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/CMakeLists.txt?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/CMakeLists.txt Fri May 28 18:10:10 2010
@@ -1,0 +1,20 @@
+
+include_directories (${BENCHMARK_INCLUDE_DIRECTORIES} ${CMAKE_CURRENT_SOURCE_DIR}) 
+link_directories(${BENCHMARK_LIB_DIRECTORIES})
+
+message(STATUS "Adding includes to server: ${BENCHMARK_INCLUDE_DIRECTORIES} ${CMAKE_CURRENT_SOURCE_DIR}")
+message(STATUS "Adding link dirs to server: ${BENCHMARK_LIB_DIRECTORIES}")
+
+set(SRCLIST "")
+set(SRCLIST ${SRCLIST}  server.cpp)
+
+add_executable(driverserver ${SRCLIST})
+
+set(LIBS jrtplib-3.7.1  jthread-1.2.1)
+if(WIN32)
+  set(LIBS ${LIBS} Ws2_32)
+endif()
+
+target_link_libraries(driverserver ${LIBS})
+
+install(TARGETS driverserver DESTINATION bin/)

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/CMakeLists.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/CMakeLists.txt
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/CMakeLists.txt
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/server.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/server.cpp?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/server.cpp (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/server.cpp Fri May 28 18:10:10 2010
@@ -1,0 +1,326 @@
+/*---------------------------------------------------------------------------*/
+/* main.cpp
+/*---------------------------------------------------------------------------*/
+#include <iostream>
+#include <crtdbg.h> //for _ASSERT
+//JRTP includes
+#include "RTPSession.h"
+#include "RTPIPv4Address.h"
+#include "RTPSessionParams.h"
+#include "RTPUDPv4Transmitter.h"
+
+#define MCAST_IP		"239.216.30.54"
+#define MCAST_PORT		4000
+#define SERVER_PORT		5000
+
+#define MAX_PACKET_SIZE	((1024 * 64) - 1)
+
+std::string mDestAddress(MCAST_IP);
+int mDestPort(MCAST_PORT);
+int mServerPort(SERVER_PORT);
+
+bool mFixedSize(true);
+int mNumPackets(10000);
+bool mRandomLarge(false);
+
+int mPacketSize(MAX_PACKET_SIZE);
+const int NUMVALUES(16);
+const int PSEUDO_RANDOM[] = {10256, 4000, 32066, 48767, 
+                             645, 6012, 59276, 62186, 
+                             80, 18004, 60356, 24560, 
+                             389, 8, 49236, 48752};
+const int PSEUDO_RANDOM_BIG[] = {65422, 62776, 65023, 63946, 
+                                 65126, 60323, 62186, 58437, 
+                                 60356, 65485, 63748, 64475, 
+                                 61576, 59045, 60545, 62843};
+using namespace std;
+
+/*-------------------------------------------------------*/
+/* ReportError
+/* Checking & display of RTP status codes
+/* Returns true if there was an error, false otherwise
+/*-------------------------------------------------------*/
+int ReportError(int errCode)
+{
+	int isErr = (errCode < 0);
+	if (isErr) {
+		std::string stdErrStr = RTPGetErrorString(errCode);
+		printf("Error %d: %s\n", errCode, stdErrStr.c_str());
+		printf("======================================\nPress Enter to exit\n");
+		getchar();
+	}
+	return isErr;
+}
+
+bool IsMultiCast(std::string &address)
+{
+   size_t pos;
+
+   pos = address.find_first_of('.');
+   if (pos != address.npos)
+   {
+      std::string octet = address.substr(0, pos);
+      int num = atoi(octet.c_str());
+
+      if (num >= 224 && num <= 239)
+      {
+         return true;
+      }
+   }
+
+   return false;
+}
+
+int GetPacketSize(int counter)
+{
+   if (mFixedSize)
+   {
+      return mPacketSize;
+   }
+   int index = counter % NUMVALUES;
+
+   if (mRandomLarge)
+   {
+      return PSEUDO_RANDOM_BIG[index];
+   }
+
+   return PSEUDO_RANDOM[index];
+}
+void GenerateRTPStream()
+{
+	RTPSession rtpSession;
+
+   // Session config
+	RTPSessionParams sessParams;
+	sessParams.SetOwnTimestampUnit(1.0 / 30.0); //30 video frames per second
+	sessParams.SetUsePollThread(1); //background thread to call virtual callbacks - set by default, but just to be sure
+	sessParams.SetMaximumPacketSize(MAX_PACKET_SIZE);
+
+	//setup transmission parameters
+	RTPUDPv4TransmissionParams transParams;
+	transParams.SetPortbase(mServerPort);
+
+	//CREATE THE SESSION
+	int status = rtpSession.Create(sessParams, &transParams);
+	if (ReportError(status))
+		return; //unable to create the session
+	printf("RTP session created with portbase %d\n", mServerPort);
+
+	//SET TRANSMISSION DEFAULTS if we want to use them
+   rtpSession.SetDefaultPayloadType(0);
+	rtpSession.SetDefaultMark(false);
+	//rtpSession.SetDefaultTimestampIncrement(160);
+
+	//ADD THE address to our destination
+   unsigned long intIP = inet_addr(mDestAddress.c_str());
+	_ASSERT(intIP != INADDR_NONE);
+	intIP = ntohl(intIP); //put in host byte order
+	RTPIPv4Address rtpAddr(intIP, mDestPort);
+	status = rtpSession.AddDestination(rtpAddr);
+
+	if (ReportError(status)) 
+   {
+      return;
+   }
+
+	cout << "Transmitting stream to " << mDestAddress << " port " << mDestPort << endl;
+	char testBuf[MAX_PACKET_SIZE];
+
+   // Send 3 packets with START marker
+	rtpSession.SendPacket(testBuf, 8, 1, false, 10UL);
+	rtpSession.SendPacket(testBuf, 8, 1, false, 10UL);
+	rtpSession.SendPacket(testBuf, 8, 1, false, 10UL);
+
+	for (int i=0; i < mNumPackets; i++)
+   {
+		//SEND a packet
+		int size = GetPacketSize(i);
+		rtpSession.SendPacket(testBuf, size, 0, false, 10UL);
+	}
+
+   // Send 3 packets with END marker
+	rtpSession.SendPacket(testBuf, 8, 2, false, 10UL);
+	rtpSession.SendPacket(testBuf, 8, 2, false, 10UL);
+	rtpSession.SendPacket(testBuf, 8, 2, false, 10UL);
+
+	rtpSession.DeleteDestination(rtpAddr);
+
+	rtpSession.Destroy();
+
+   cout << "Transmission complete." << endl;
+}
+
+void PrintUsage(const std::string& appName)
+{
+	cout << "Usage: " << appName << " [-i ipaddress] [-p fromport] [-n numpackets] [[-f [fixedsize]]|[-r [V|L]] " << endl;
+   cout << "  -i ipaddress   - The ipaddress to address packets to. Default: " << mDestAddress << endl;
+   cout << "  -p destport    - The port to send packets from. Default: " << mDestPort << endl;
+   cout << "  -s serverport  - The port to send packets from. Default: " << mServerPort << endl;
+   cout << "  -f [fixedsize] - Send fixed-size packets. The default fixed size is " << mPacketSize << " bytes. " << endl;
+   cout << "  -r [V|L]       - Send (pseudo) random-sized packets. Set the S parameter for wide variation, or L for all large packets. " << endl;
+   cout << "  -n numpackets  - Number of packets to send. Default: " << mNumPackets << endl;
+}
+
+void PrintSettings()
+{
+   cout << "Executing with the following settings:" << endl;
+   cout << "  - Destination:" << mDestAddress << ":" << mDestPort << endl;
+   cout << "  - Server port:" << mServerPort << endl;
+ 
+   if (mFixedSize)
+   {
+      cout << "  - Packet size: Fixed at " << mPacketSize << endl;
+   }
+   else
+   {
+      if (mRandomLarge)
+      {
+          cout << "  - Packet size: Random with Large-sized packets." << endl;
+      }
+      else
+      {
+          cout << "  - Packet size: Random with varying sized packets." << endl;
+      }
+   }
+
+   cout << "  - Number of packets to send:" << mNumPackets << endl;
+
+}
+
+void ProcessCommandLineArgs(int argc, char *argv[])
+{
+   for(int i=1; i < argc; i++)
+   {
+      std::string s(argv[i]);
+      if (s[0] == '-')
+      {
+         switch(s[1])
+         {
+         case 'i': // ipaddress
+             if ((i+1 == argc) ||
+                (argv[i+1][0] == '-'))
+            {
+               cout << "Missing value parameter for -i" << endl;
+               PrintUsage(argv[0]);
+               exit(-1);
+            }
+
+            mDestAddress = argv[i+1];
+            i++;
+            break;
+
+         case 'p':  // destport
+            if ((i+1 == argc) ||
+                (argv[i+1][0] == '-'))
+            {
+                cout << "Missing value parameter for -p" << endl;
+              PrintUsage(argv[0]);
+               exit(-1);
+            }
+            mDestPort = atoi(argv[i+1]);
+            i++;
+            break;
+
+         case 's':  // serverport
+            if ((i+1 == argc) ||
+                (argv[i+1][0] == '-'))
+            {
+               cout << "Missing value parameter for -s" << endl;
+
+               PrintUsage(argv[0]);
+               exit(-1);
+            }
+            mServerPort = atoi(argv[i+1]);
+            i++;
+            break;
+
+         case 'f': // [fixedsize]
+            if (i+1 < argc &&
+                argv[i+1][0] != '-')
+            {
+               int size = atoi(argv[i+1]);
+               if (size != 0)
+               {
+                  mPacketSize = size;
+                  if (mPacketSize > MAX_PACKET_SIZE)
+                  {
+                     cout << "Maximum packet size of " << MAX_PACKET_SIZE << " exceeded!" << endl;
+                     cout << "Using " << MAX_PACKET_SIZE << endl;
+                     mPacketSize = MAX_PACKET_SIZE;
+                  }
+               }
+               i++;
+            }
+            mFixedSize = true;
+            break;
+
+         case 'r': // [V|L]
+            if (i+1 < argc &&
+                argv[i+1][0] != '-')
+            {
+               if (argv[i+1][0] == 'V' ||
+                   argv[i+1][0] == 'v')
+               {
+                  mRandomLarge = false;
+               }
+               else if (argv[i+1][0] == 'L' ||
+                        argv[i+1][0] == 'l')
+               {
+                  mRandomLarge = true;
+               }
+               else
+               {
+                  cout << "Invalid p-arameter for -r" << endl;
+
+                  PrintUsage(argv[0]);
+                  exit(-1);
+               }
+            }
+            mFixedSize = false;
+            break;
+
+         case 'n': // numpackets
+            if ((i+1 == argc) ||
+                (argv[i+1][0] == '-'))
+            {
+               cout << "Missing value parameter for -n" << endl;
+
+               PrintUsage(argv[0]);
+               exit(-1);
+            }
+            mNumPackets = atoi(argv[i+1]);
+            i++;
+            break;
+
+         case 'h':
+            PrintUsage(argv[0]);
+            exit(0);
+            break;
+
+         default:
+            PrintUsage(argv[0]);
+            exit(-1);
+         }
+      }
+   }
+}
+
+/*-------------------------------------------------------*/
+/* main
+/* entry point for the application
+/*-------------------------------------------------------*/
+int main(int argc, char* argv[])
+{
+   ProcessCommandLineArgs(argc, argv);
+   PrintSettings();
+
+	//MUST call WSAStartup() to use WS2_32.DLL
+	WSADATA wsaData;
+	WORD wVersionRequested = MAKEWORD( 2, 2 );
+	WSAStartup(wVersionRequested, &wsaData); //WSACleanup called in OnDestroy
+
+	GenerateRTPStream();
+
+	WSACleanup();
+	return 0;
+}

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/server.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/server.cpp
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: techdemo/team/ken.hunt/benchmark/rtp/driver/driverserver/server.cpp
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/CMakeLists.txt
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/CMakeLists.txt?view=auto&rev=647
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/CMakeLists.txt (added)
+++ techdemo/team/ken.hunt/benchmark/rtp/jrtplib-3.7.1/CMakeLists.txt Fri May 28 18:10:10 2010

[... 29299 lines stripped ...]




More information about the asterisk-scf-commits mailing list