Search:

SENF Extensible Network Framework

  • Home
  • Download
  • Wiki
  • BerliOS
  • ChangeLog
  • Browse SVN
  • Bug Tracker
  • Overview
  • Examples
  • HowTos
  • Glossary
  • PPI
  • Packets
  • Scheduler
  • Socket
  • Utils
  • Console
  • Daemon
  • Logger
  • Termlib
  • Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

DefaultBundle/RTPPacket.cc

Go to the documentation of this file.
00001 // $Id: RTPPacket.cc 1754 2010-12-09 15:45:42Z tho $
00002 //
00003 // Copyright (C) 2008
00004 // Fraunhofer (FOKUS)
00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY
00006 //     Philipp Batroff <pug@berlios.de>
00007 //
00008 // This program is free software; you can redistribute it and/or modify
00009 // it under the terms of the GNU General Public License as published by
00010 // the Free Software Foundation; either version 2 of the License, or
00011 // (at your option) any later version.
00012 //
00013 // This program is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 //
00018 // You should have received a copy of the GNU General Public License
00019 // along with this program; if not, write to the
00020 // Free Software Foundation, Inc.,
00021 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00026 #include "RTPPacket.hh"
00027 
00028 // Custom includes
00029 #include <boost/io/ios_state.hpp>
00030 
00031 #define prefix_
00032 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00033 
00034 namespace
00035 {
00036     std::string ptName(int pt)
00037     {
00038         struct pt_item
00039         {
00040             int pt;
00041             std::string name;
00042         };
00043         static pt_item ptList[27] = {
00044             {0,"PCMU"},{1,"1016"},{2,"G721"},{3,"GSM"},
00045             {5,"DVI8"},{6,"DVI16"},{7,"LPC"},{8,"PCMA"},
00046             {9,"G722"},{10,"L16"},{11,"L16S"},{14,"MPA"},
00047             {25,"CELB"},{26,"JPEG"},{31,"H261"},{32,"MPV"},
00048             {33,"MP2T"},{34,"263"},{110,"MPEG AAC"},{111,"11L16"},
00049             {112,"11L16S"},{113,"22L16"},{114,"22L16S"},{115,"32L16"},
00050             {116,"32L16S"},{127,"HTML"},{-1,""}
00051         };
00052         int n = 0;
00053         while (ptList[n].pt != -1)
00054         {
00055             if (ptList[n].pt == pt)
00056                 return ptList[n].name;
00057             ++n;
00058         }
00059 
00060         return "UNKNOWN";
00061     }
00062 }
00063 
00064 prefix_ void senf::RTPPacketType::dump(packet p, std::ostream & os)
00065 {
00066     boost::io::ios_all_saver ias(os);
00067     os << "Real Time Protocol:\n"
00068        << senf::fieldName("version")               << p->version() << "\n"
00069        << senf::fieldName("padding")               << p->padding() << "\n"
00070        << senf::fieldName("extension")             << p->extension() << "\n"
00071        << senf::fieldName("contributing source cnt")   << p->csrcCount() << "\n"
00072        << senf::fieldName("marker")                << p->marker() << "\n"
00073        << senf::fieldName("payload type")          << p->payloadType() << " "
00074            << ptName(p->payloadType() ) <<"\n"
00075        << senf::fieldName("sequence number")       << p->seqNumber() << "\n"
00076        << senf::fieldName("timestamp")             << p->timeStamp() << "\n"
00077        << senf::fieldName("sync source id")        << p->synSourceId() << "\n";
00078 }
00079 
00080 //-/////////////////////////////////////////////////////////////////////////////////////////////////
00081 #undef prefix_

Contact: senf-dev@lists.berlios.de | © 2006-2010 Fraunhofer Institute for Open Communication Systems, Network Research