RTP Audio System  2.0.0
streamdescription.h
Go to the documentation of this file.
00001 // ##########################################################################
00002 // ####                                                                  ####
00003 // ####                   Master Thesis Implementation                   ####
00004 // ####  Management of Layered Variable Bitrate Multimedia Streams over  ####
00005 // ####                 DiffServ with A Priori Knowledge                 ####
00006 // ####                                                                  ####
00007 // #### ================================================================ ####
00008 // ####                                                                  ####
00009 // ####                                                                  ####
00010 // #### Stream Description                                               ####
00011 // ####                                                                  ####
00012 // ####           Copyright (C) 1999-2012 by Thomas Dreibholz            ####
00013 // ####                                                                  ####
00014 // #### Contact:                                                         ####
00015 // ####    EMail: dreibh@iem.uni-due.de                                  ####
00016 // ####    WWW:   https://www.nntb.no/~dreibh/rtpaudio                ####
00017 // ####                                                                  ####
00018 // #### ---------------------------------------------------------------- ####
00019 // ####                                                                  ####
00020 // #### This program is free software: you can redistribute it and/or    ####
00021 // #### modify it under the terms of the GNU General Public License as   ####
00022 // #### published by the Free Software Foundation, either version 3 of   ####
00023 // #### the License, or (at your option) any later version.              ####
00024 // ####                                                                  ####
00025 // #### This program is distributed in the hope that it will be useful,  ####
00026 // #### but WITHOUT ANY WARRANTY; without even the implied warranty of   ####
00027 // #### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    ####
00028 // #### GNU General Public License for more details.                     ####
00029 // ####                                                                  ####
00030 // #### You should have received a copy of the GNU General Public        ####
00031 // #### License along with this program.  If not, see                    ####
00032 // #### <http://www.gnu.org/licenses/>.                                  ####
00033 // ####                                                                  ####
00034 // ##########################################################################
00035 // $Id: streamdescription.h 1307 2011-12-22 07:36:29Z dreibh $
00036 
00037 
00038 #ifndef STREAMDESCRIPTION_H
00039 #define STREAMDESCRIPTION_H
00040 
00041 
00042 #include "tdsystem.h"
00043 #include "servicelevelagreement.h"
00044 #include "trafficclassvalues.h"
00045 #include "managedstreaminterface.h"
00046 #include "abstractqosdescription.h"
00047 #include "sessiondescription.h"
00048 
00049 
00053 static const cardinal MaxRUEntries = 256;
00054 
00055 
00064 class StreamDescription
00065 {
00066    // ====== Constructor/Destructor =========================================
00067    public:
00071    StreamDescription();
00072 
00076    ~StreamDescription();
00077 
00078 
00079    // ====== Initialization =================================================
00091    void init(ManagedStreamInterface*      stream,
00092              const ServiceLevelAgreement* sla,
00093              const cardinal               maxPoints,
00094              const card64                 bwThreshold,
00095              const double                 utThreshold,
00096              const double                 systemDelayTolerance,
00097              const bool                   unlayeredAllocation);
00098 
00099 
00100    // ====== Layer -> DiffServ class mapping and bandwidth allocation =======
00115    bool tryAllocation(const ServiceLevelAgreement* sla,
00116                       card64&                      totalAvailableBandwidth,
00117                       card64*                      classAvailableBandwidthArray,
00118                       ResourceUtilizationPoint&    rup,
00119                       const card64                 bandwidthLimit = (card64)-1);
00120 
00121 
00122    // ====== Stream and session information =================================
00126    ManagedStreamInterface* Interface;
00127 
00131    AbstractQoSDescription* QoSDescription;
00132 
00136    SessionDescription* Session;
00137 
00141    card64 StreamID;
00142 
00146    cardinal Layers;
00147 
00148 
00149    // ====== Resource/utilization list ======================================
00153    cardinal RUEntries;
00154 
00158    ResourceUtilizationPoint RUList[MaxRUEntries];
00159 
00160 
00161    // ====== Newly allocated bandwidths and classes =========================
00165    cardinal NewLayerClassNumber[RTPConstants::RTPMaxQualityLayers];
00166 
00170    card64 NewLayerClassBandwidth[RTPConstants::RTPMaxQualityLayers];
00171 
00175    double NewCostPerSecond;
00176 
00180    ResourceUtilizationPoint NewQuality;
00181 
00185    double LastUtilization;
00186 
00187 
00188    // ====== Current allocated bandwidths and classes =======================
00192    cardinal CurrentLayerClassNumber[RTPConstants::RTPMaxQualityLayers];
00193 
00197    card64 CurrentLayerClassBandwidth[RTPConstants::RTPMaxQualityLayers];
00198 
00202    double CurrentCostPerSecond;
00203 
00207    ResourceUtilizationPoint CurrentQuality;
00208 
00212    card64 ReservationTimeStamp;
00213 
00214 
00215    // ====== Statistics =====================================================
00219    double TotalCost;
00220 
00224    double TotalBandwidthUsage;
00225 
00229    double TotalUtilization;
00230 
00234    double TotalRuntime;
00235 
00239    cardinal TotalReservationUpdates;
00240 
00244    cardinal PartialRemappings;
00245 
00249    cardinal CompleteRemappings;
00250 
00256    cardinal Inits;
00257 
00261    cardinal BufferFlushes;
00262 
00266    card64 LastInitDuration;
00267 
00268 
00269 
00270    // ====== Network quality ================================================
00274    double ReportedLossRate[RTPConstants::RTPMaxQualityLayers];
00275 
00279    double ReportedJitter[RTPConstants::RTPMaxQualityLayers];
00280 
00284    double MeasuredTransferDelay[TrafficClassValues::MaxValues];
00285 
00286 
00287    // ====== Miscellaneous data =============================================
00291    InternetAddress RoundTripTimeDestination;
00292 
00296    card64 NextInterval;
00297 
00303    bool MaximumReached;
00304 
00308    bool UnlayeredAllocation;
00309 
00310 
00311    // ====== Private methods ================================================
00312    private:
00313    bool calculatePossibleLayerClassMappings(
00314            ResourceUtilizationPoint&     rup,
00315            const ServiceLevelAgreement*  sla,
00316            const AbstractQoSDescription* aqd);
00317 };
00318 
00319 
00320 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines