RTP Audio System  2.0.0
abstractqosdescription.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 // #### Abstract QoS Description Inlines                                 ####
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: abstractqosdescription.h 1308 2011-12-22 07:43:26Z dreibh $
00036 
00037 
00038 #ifndef ABSTRACTQOSDESCRIPTION_H
00039 #define ABSTRACTQOSDESCRIPTION_H
00040 
00041 
00042 #include "tdsystem.h"
00043 #include "frameratescalabilityinterface.h"
00044 #include "abstractlayerdescription.h"
00045 #include "rtppacket.h"
00046 #include "resourceutilizationpoint.h"
00047 
00048 
00056 class AbstractQoSDescription : virtual public FrameRateScalabilityInterface
00057 {
00058    // ====== Constructor/Destructor =========================================
00059    public:
00063    AbstractQoSDescription();
00064 
00068    virtual ~AbstractQoSDescription();
00069 
00070 
00071    // ====== Initialization/update ==========================================
00077    inline void initDescription(const double frameRate);
00078 
00085    virtual void updateDescription(const cardinal pktHeaderSize,
00086                                   const cardinal pktMaxSize) = 0;
00087 
00088 
00089    // ====== Frame rate methods =============================================
00095    inline double getFrameRate() const;
00096 
00103    inline double setFrameRate(const double frameRate);
00104 
00110    inline double getNextFrameRate() const;
00111 
00117    inline double getPrevFrameRate() const;
00118 
00125    inline double getFrameRateScaleFactor() const;
00126 
00127 
00128    // ====== Total bandwidth methods ========================================
00134    card64 getMinBandwidth() const;
00135 
00141    card64 getMaxBandwidth() const;
00142 
00143 
00144    // ====== Position =======================================================
00150    inline card64 getPosition() const;
00151 
00157    inline void setPosition(const card64 position);
00158 
00159 
00160    // ====== Abstract layer methods =========================================
00166    virtual cardinal getLayers() const = 0;
00167 
00174    virtual AbstractLayerDescription* getLayer(const cardinal layer) const = 0;
00175 
00176 
00177    // ====== Get/set resources, calculate utilization for bandwidths ========
00184    double getResources(ResourceUtilizationPoint& rup) const;
00185 
00192    double setResources(const ResourceUtilizationPoint& rup);
00193 
00202    virtual double calculateUtilizationForLayerBandwidths(
00203                      const double    frameRate,
00204                      const cardinal  layers,
00205                      const card64*   bandwidth) const;
00206 
00207 
00208    // ====== Resource/Utilization calculation ===============================
00221    virtual cardinal getPrecomputedResourceUtilizationList(
00222                        ResourceUtilizationPoint* rup,
00223                        const card64              bwThreshold,
00224                        const double              utThreshold,
00225                        const cardinal            maxPoints) const = 0;
00226 
00238    virtual cardinal calculateResourceUtilizationList(
00239                        ResourceUtilizationPoint* rup,
00240                        const card64              bwThreshold,
00241                        const double              utThreshold,
00242                        const cardinal            maxPoints) const;
00243 
00254    inline double calculateMaxUtilizationForBandwidth(
00255                     const card64              totalBandwidth,
00256                     ResourceUtilizationPoint& rup) const;
00257 
00265    virtual void calculateMaxUtilizationForBandwidthArray(
00266                    const card64*             totalBandwidthArray,
00267                    ResourceUtilizationPoint* rupArray,
00268                    const cardinal            points) const;
00269 
00270 
00271    // ====== Wanted quality settings ========================================
00277    inline double getWantedUtilization() const;
00278 
00284    inline void setWantedUtilization(const double utilization);
00285 
00291    card64 getMinWantedBandwidth() const;
00292 
00298    card64 getMaxWantedBandwidth() const;
00299 
00305    void setMinWantedBandwidth(const card64 bandwidth);
00306 
00312    void setMaxWantedBandwidth(const card64 bandwidth);
00313 
00319    inline int8 getStreamPriority() const;
00320 
00326    inline void setStreamPriority(const int8 priority);
00327 
00333    inline int8 getSessionPriority() const;
00334 
00340    inline void setSessionPriority(const int8 priority);
00341 
00342 
00343    // ====== Protected data =================================================
00344    protected:
00345    double   WantedUtilization;
00346    card64   MinWantedBandwidth;
00347    card64   MaxWantedBandwidth;
00348    double   FrameRate;
00349    card64   Position;
00350    cardinal PktHeaderSize;
00351    cardinal PktMaxSize;
00352    int8     StreamPriority;
00353    int8     SessionPriority;
00354 
00355 
00356    // ====== Private data ===================================================
00357    private:
00358    void doResourceUtilizationIteration(
00359            ResourceUtilizationPoint* rup,
00360            const card64              bwThreshold,
00361            const double              utThreshold,
00362            double*                   utilizationCache,
00363            card64*                   bandwidthCache,
00364            const cardinal            maxPoints,
00365            const cardinal            maxCachePoints,
00366            const cardinal            start,
00367            const cardinal            end,
00368            const card64              startBandwidth,
00369            const card64              endBandwidth,
00370            const cardinal            level,
00371            const cardinal            maxLevel,
00372            cardinal&                 count) const;
00373 
00374    void calculateBandwidthInfo(const cardinal layer,
00375                                BandwidthInfo& bandwidthInfo) const;
00376 };
00377 
00378 
00382 std::ostream& operator<<(std::ostream& os, const AbstractQoSDescription& aqd);
00383 
00384 
00385 #include "abstractqosdescription.icc"
00386 
00387 
00388 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines