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

SVN commits to the Hydra project hydra-commits at lists.digium.com
Fri Jun 4 17:52:30 CDT 2010


Author: ken.hunt
Date: Fri Jun  4 17:52:29 2010
New Revision: 662

URL: https://origsvn.digium.com/svn-view/hydra?view=rev&rev=662
Log:
Some updates.

Removed:
    techdemo/team/ken.hunt/benchmark/rtp/build/runcmake.bat
Modified:
    techdemo/team/ken.hunt/benchmark/bin/install_debug.bat
    techdemo/team/ken.hunt/benchmark/bin/media.config
    techdemo/team/ken.hunt/benchmark/ice/driver/source/source.cpp
    techdemo/team/ken.hunt/benchmark/rtp/driver/source/source.cpp

Modified: techdemo/team/ken.hunt/benchmark/bin/install_debug.bat
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/bin/install_debug.bat?view=diff&rev=662&r1=661&r2=662
==============================================================================
--- techdemo/team/ken.hunt/benchmark/bin/install_debug.bat (original)
+++ techdemo/team/ken.hunt/benchmark/bin/install_debug.bat Fri Jun  4 17:52:29 2010
@@ -2,4 +2,8 @@
 echo off
 copy /Y /B ..\build\ice\driver\sink\Debug\icesink.exe .
 copy /Y /B ..\build\ice\driver\source\Debug\icesource.exe .
-copy /Y /B ..\build\ice\slice\Debug\MediaIf_CXXd.dll  .
+copy /Y /B ..\build\ice\slice\Debug\MediaIf_CXXd.dll  .
+
+
+copy /Y /B ..\build\rtp\driver\sink\Debug\rtpsink.exe .
+copy /Y /B ..\build\rtp\driver\source\Debug\rtpsource.exe .

Modified: techdemo/team/ken.hunt/benchmark/bin/media.config
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/bin/media.config?view=diff&rev=662&r1=661&r2=662
==============================================================================
--- techdemo/team/ken.hunt/benchmark/bin/media.config (original)
+++ techdemo/team/ken.hunt/benchmark/bin/media.config Fri Jun  4 17:52:29 2010
@@ -1,12 +1,20 @@
+
+
+Ice.UDP.RcvSize=65535
+Ice.UDP.SndSize=65535
 
 Sink.Endpoints=udp -h 127.0.0.1 -p 10011 
 
 MediaSink=MediaSink:udp -h 127.0.0.1 -p 10011
 
+MediaSink.NumPackets=50000
+
 # Fixed or Random
-MediaSink.NumPackets=10000
-MediaSink.SizeType=Fixed
-MediaSink.FixedSize=8000 
+MediaSink.SizeType=Random
+
+# The packet size if SizeType is Fixed
+MediaSink.FixedSize=65200 
 
 # Variable or Large
-MediaSink.RandomType=Large
+MediaSink.RandomType=Variable
+

Modified: techdemo/team/ken.hunt/benchmark/ice/driver/source/source.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/ice/driver/source/source.cpp?view=diff&rev=662&r1=661&r2=662
==============================================================================
--- techdemo/team/ken.hunt/benchmark/ice/driver/source/source.cpp (original)
+++ techdemo/team/ken.hunt/benchmark/ice/driver/source/source.cpp Fri Jun  4 17:52:29 2010
@@ -9,8 +9,6 @@
 const string MCAST_IP("239.216.30.54");
 const int MCAST_PORT(4000);
 const int SERVER_PORT(5000);
-
-//const int MAX_PACKET_SIZE((1024 * 64) - 1)
 
 // Ice max datagram size
 const int MAX_ICE_DATAGRAM(65507);
@@ -26,11 +24,14 @@
                              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, 
+const int PSEUDO_RANDOM_BIG[] = {64422, 62776, 64023, 63946, 
+                                 64126, 60323, 62186, 58437, 
+                                 60356, 62485, 63748, 64475, 
                                  61576, 59045, 60545, 62843};
 char mTestBuf[MAX_PACKET_SIZE];
+MediaFrame mPreBuiltPackets[NUMVALUES];
+MediaFrame mStartMarker;
+MediaFrame mEndMarker;
 
 /**
  * A customization of Ice::Application for this simple command line app. 
@@ -46,7 +47,7 @@
 	void PrintUsage(const string& appName);
    void PrintSettings();
    void SendFrames();
-   void SendFrame(FrameType type, int size);
+   void SendFrame(int counter, FrameType type, int size);
    void SendByteSeq();
 
 private:
@@ -94,6 +95,47 @@
 
 }
 
+void BuildEmptyPacket(ByteSeq &byteSeq, int packetsize)
+{
+   byteSeq.clear();
+   for (int i=0; i < packetsize; i++) // size; i++)  
+   {
+      byteSeq.push_back(0);
+   }
+}
+
+void PreBuildPackets()
+{
+   mStartMarker.header.Type = START;
+   mStartMarker.data.push_back(1);
+
+   mEndMarker.header.Type = FINAL;
+   mEndMarker.data.push_back(1);
+
+   if (mFixedSize)
+   {
+      mPreBuiltPackets[0].header.Type = AUDIO;
+      BuildEmptyPacket(mPreBuiltPackets[0].data, mPacketSize);
+      return;
+   }
+
+   if (mRandomLarge)
+   {
+      for(int i=0; i < NUMVALUES; i++)
+      {
+         mPreBuiltPackets[i].header.Type = AUDIO;
+         BuildEmptyPacket(mPreBuiltPackets[i].data, PSEUDO_RANDOM_BIG[i]);
+         return;
+      }
+   }
+
+   for(int i=0; i < NUMVALUES; i++)
+   {
+      mPreBuiltPackets[i].header.Type = AUDIO;
+      BuildEmptyPacket(mPreBuiltPackets[i].data, PSEUDO_RANDOM[i]);
+   }
+}
+
 /**
  * Overload of the Ice::Application::run method. 
  */
@@ -153,6 +195,8 @@
 
    PrintSettings();
 
+   PreBuildPackets();
+
     // Test 1
     SendFrames();
 
@@ -174,7 +218,6 @@
 	 _exit(EXIT_SUCCESS);
 }
 
-
 int GetPacketSize(int counter)
 {
    if (mFixedSize)
@@ -191,78 +234,110 @@
    return PSEUDO_RANDOM[index];
 }
 
-void Server::SendFrame(FrameType type, int size)
-{
-   MediaFrame frame;
-   frame.header.Type = type;
-   frame.data.clear();
-
-   for (int i=0; i < size; i++) // size; i++)  
-   {
-      frame.data.push_back('k');
-   }
-
-    mMediaSink->SendFrame(frame);
-
+void Server::SendFrame(int counter, FrameType type, int packetSize)
+{
+   MediaFrame *frame;
+
+   if (type == AUDIO)
+   {
+      if (mFixedSize)
+      {
+         frame = &mPreBuiltPackets[0];
+      }
+      else
+      {
+         int index = counter % NUMVALUES;
+         frame = &mPreBuiltPackets[index];
+      }
+   }
+   else if (type == START)
+   {
+      frame = &mStartMarker;
+   }
+   else
+   {
+      frame = &mEndMarker;
+   }
+
+   mMediaSink->SendFrame(*frame);
 }
 
 void Server::SendFrames()
 {
 	cout << "Transmitting frames... " << endl;
 
-   // Send 3 packets with START marker
-	SendFrame(START, 1);
- 	SendFrame(START, 1);
-  	SendFrame(START, 1);
-
-	for (int i=0; i < mNumPackets; i++)
-   {
-		//SEND a packet
-		int size = GetPacketSize(i);
-		SendFrame(AUDIO, size);
-	}
-
-   // Send 3 packets with END marker
-	SendFrame(FINAL, 1);
- 	SendFrame(FINAL, 1);
-  	SendFrame(FINAL, 1);
+   try
+   {
+      // Send 3 packets with START marker
+	   SendFrame(0, START, 1);
+ 	   SendFrame(0, START, 1);
+  	   SendFrame(0, START, 1);
+
+	   for (int i=0; i < mNumPackets; i++)
+      {
+		   //SEND a packet
+		   int packetSize = GetPacketSize(i);
+		   SendFrame(i, AUDIO, packetSize);
+	   }
+
+      // Send X packets with END marker
+      for (int i=0; i < 20; i++)
+      {
+	      SendFrame(0, FINAL, 1);
+      }
+
+   }
+   catch (std::exception &e)
+   {
+      cout << "Exception in SendFrames(): " << e.what() << endl;
+   }
+
     cout << "Transmission complete." << endl;
 }
 
 void Server::SendByteSeq()
 {
-    ByteSeq markerBytesBuf(1);
-    markerBytesBuf.resize(1);
-    pair<const Ice::Byte*, const Ice::Byte*> markerBytes;
-    markerBytes.first = &markerBytesBuf[0];
-    markerBytes.second = markerBytes.first + markerBytesBuf.size();
-
-    ByteSeq byteSeq(MAX_PACKET_SIZE);
-    pair<const Ice::Byte*, const Ice::Byte*> byteArr;
-    byteArr.first = &byteSeq[0];
-    byteArr.second = byteArr.first + byteSeq.size();
-    byteSeq[0] = '0';
-
-	cout << "Transmitting bytes... " << endl;
-
-   // Send 3 packets with START marker
-   markerBytesBuf[0] = '1';
-	mMediaSink->SendBytes(markerBytes);
- 	mMediaSink->SendBytes(markerBytes);
-  	mMediaSink->SendBytes(markerBytes);
-
-	for (int i=0; i < mNumPackets; i++)
-   {
-      int size = GetPacketSize(i);
-      byteArr.second = byteArr.first + size;
-      mMediaSink->SendBytes(byteArr);
-	}
-
-   // Send 3 packets with END marker
-   markerBytesBuf[0] = '2';
-	mMediaSink->SendBytes(markerBytes);
- 	mMediaSink->SendBytes(markerBytes);
-   mMediaSink->SendBytes(markerBytes);
+   try
+   {
+       ByteSeq markerBytesBuf(1);
+       markerBytesBuf.resize(1);
+       pair<const Ice::Byte*, const Ice::Byte*> markerBytes;
+       markerBytes.first = &markerBytesBuf[0];
+       markerBytes.second = markerBytes.first + markerBytesBuf.size();
+
+       ByteSeq byteSeq(MAX_PACKET_SIZE);
+       pair<const Ice::Byte*, const Ice::Byte*> byteArr;
+       byteArr.first = &byteSeq[0];
+       byteArr.second = byteArr.first + byteSeq.size();
+       byteSeq[0] = '0';
+
+	   cout << "Transmitting bytes... " << endl;
+
+      // Send 3 packets with START marker
+      markerBytesBuf[0] = '1';
+	   mMediaSink->SendBytes(markerBytes);
+ 	   mMediaSink->SendBytes(markerBytes);
+  	   mMediaSink->SendBytes(markerBytes);
+
+	   for (int i=0; i < mNumPackets; i++)
+      {
+         int size = GetPacketSize(i);
+         byteArr.second = byteArr.first + size;
+         mMediaSink->SendBytes(byteArr);
+	   }
+
+      // Send X packets with END marker
+      markerBytesBuf[0] = '2';
+      for (int i=0; i < 20; i++)
+      {
+	      mMediaSink->SendBytes(markerBytes);
+      }
+
+   }
+   catch (std::exception &e)
+   {
+      cout << "Exception in SendFrames(): " << e.what() << endl;
+   }
 
    cout << "Transmission complete." << endl;
 }

Modified: techdemo/team/ken.hunt/benchmark/rtp/driver/source/source.cpp
URL: https://origsvn.digium.com/svn-view/hydra/techdemo/team/ken.hunt/benchmark/rtp/driver/source/source.cpp?view=diff&rev=662&r1=661&r2=662
==============================================================================
--- techdemo/team/ken.hunt/benchmark/rtp/driver/source/source.cpp (original)
+++ techdemo/team/ken.hunt/benchmark/rtp/driver/source/source.cpp Fri Jun  4 17:52:29 2010
@@ -87,6 +87,7 @@
 
    return PSEUDO_RANDOM[index];
 }
+
 void GenerateRTPStream()
 {
 	RTPSession rtpSession;
@@ -127,6 +128,8 @@
 	cout << "Transmitting stream to " << mDestAddress << " port " << mDestPort << endl;
 	char testBuf[MAX_PACKET_SIZE];
 
+   try
+   {
    // Send 3 packets with START marker
 	rtpSession.SendPacket(testBuf, 8, 1, false, 10UL);
 	rtpSession.SendPacket(testBuf, 8, 1, false, 10UL);
@@ -143,6 +146,12 @@
 	rtpSession.SendPacket(testBuf, 8, 2, false, 10UL);
 	rtpSession.SendPacket(testBuf, 8, 2, false, 10UL);
 	rtpSession.SendPacket(testBuf, 8, 2, false, 10UL);
+
+   }
+   catch (const std::exception &e)
+   {
+      cout << "Exception in GenerateRTPStream: " << e.what() << endl;
+   }
 
 	rtpSession.DeleteDestination(rtpAddr);
 





More information about the asterisk-scf-commits mailing list