User Manual, Developers Guide and API Documentation

VideoTelephony.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef APPLICATIONS_SESSION_CLIENT_VIDEOTELEPHONY_HPP
00029 #define APPLICATIONS_SESSION_CLIENT_VIDEOTELEPHONY_HPP
00030 
00031 #include <APPLICATIONS/session/client/Session.hpp>
00032 
00033 namespace applications { namespace session { namespace client {
00034 
00035       /* VideoTelephonyStates are used to see the voice Sessionphase */
00036       enum VideoTelephonyState
00037     {
00038       active = 1,
00039       inactive = 2
00040     };
00041 
00042       class VideoTelephony :
00043     public applications::session::client::Session
00044       {
00045       public:
00046     VideoTelephony(const wns::pyconfig::View& _pyco);
00047     ~VideoTelephony();
00048 
00049     void
00050     logNormalProjectedFarima(std::deque<double> _x, std::deque<double> _phiold, double _y,
00051                  double _phi, double _theta, double _m, double _sqrValue,
00052                  double _variance, int _k, double _logMean, double _logStd);
00053 
00054     void
00055     onData(const wns::osi::PDUPtr& _pdu);
00056 
00057     void
00058     onTimeout(const Timeout& _t);
00059 
00060     void
00061     onConnectionEstablished(wns::service::tl::Connection* _connection);
00062 
00063     void
00064     calculateSLRangeDependency();
00065 
00066       private:
00067     bool byteFlag;
00068     int i;
00069     int j;
00070     int limit;
00071     int idx;
00072 
00073     /***** I Frame Generating *****/
00074     double fracI;
00075     double hurstI;
00076     int kI;
00077     std::deque<double> autocorrI;
00078     std::deque<double> phiInew;
00079     std::deque<double> phiIold;
00080     double pI;
00081     double nI;
00082     double dI;
00083     /* According to "IEEE 802.16m Evaluation Methodology Document(2009), Page 118,
00084        section 10.5", the I-frame packetsize is Weibull distributed. */
00085     wns::distribution::Distribution* logNormDisI;
00086     double logNormValueI;
00087     double logMeanI;
00088     double logStdI;
00089     double meanI;
00090     double varianceI;
00091     std::deque<double> xI;
00092     double yI;
00093     double phiI;
00094     double thetaI;
00095     double mI;
00096     double sqrValueI;
00097 
00098     /***** B Frame Generating*****/
00099     double fracB;
00100     double hurstB;
00101     int kB;
00102     std::deque<double> autocorrB;
00103     std::deque<double> phiBnew;
00104     std::deque<double> phiBold;
00105     double pB;
00106     double nB;
00107     double dB;
00108     /* According to "IEEE 802.16m Evaluation Methodology Document(2009), Page 118,
00109        section 10.5", the B-frame packetsize is Lognormal distributed. */
00110     wns::distribution::Distribution* logNormDisB;
00111     double logNormValueB;
00112     double logMeanB;
00113     double logStdB;
00114     double meanB;
00115     double varianceB;
00116     std::deque<double> xB;
00117     double yB;
00118     double phiB;
00119     double thetaB;
00120     double mB;
00121     double sqrValueB;
00122     /***** P Frame Generating*****/
00123     double fracP;
00124     double hurstP;
00125     int kP;
00126     std::deque<double> autocorrP;
00127     std::deque<double> phiPnew;
00128     std::deque<double> phiPold;
00129     double pP;
00130     double nP;
00131     double dP;
00132     /* According to "IEEE 802.16m Evaluation Methodology Document(2009), Page 118,
00133        section 10.5", the P-frame packetsize is Lognormal distributed. */
00134     wns::distribution::Distribution* logNormDisP;
00135     double logNormValueP;
00136     double logMeanP;
00137     double logStdP;
00138     double meanP;
00139     double varianceP;
00140     std::deque<double> xP;
00141     double yP;
00142     double phiP;
00143     double thetaP;
00144     double mP;
00145     double sqrValueP;
00146 
00147     /* Used in logNormalProjectedFarima() */
00148     double mean;
00149     int n;
00150     wns::distribution::Distribution* distribution;
00151     double distributionValue;
00152     double normMean;
00153     double variance;
00154 
00155     /* Voice parameters */
00156     bool comfortNoise;
00157     Bit voicePacketSize;
00158     Bit comfortNoisePacketSize;
00159 
00160     wns::simulator::Time voicePacketIat;
00161 
00162     wns::simulator::Time videoPacketIat;
00163     int videoFrameRate;
00164 
00165     private:
00166     /* According to "IMT-Adv. ITU-R M.2135" every 20ms it is decided if a state transition takes place. */
00167     wns::distribution::Distribution* stateTransitionDistribution;
00168     int cnCounter;
00169 
00170     applications::session::client::VideoTelephonyState voiceState;
00171 
00172     int bFrameCounter;
00173     int gopCounter;
00174     bool newGOP;
00175 
00176       };
00177     } // namespace client
00178   } // namespace session
00179 } // namespace applications
00180 
00181 #endif //APPLICATIONS_SESSION_CLIENT_VIDEOTELEPHONY

Generated on Sun May 27 03:32:16 2012 for openWNS by  doxygen 1.5.5