QXmpp  Version:0.9.3
QXmppRtcpPacket.h
00001 /*
00002  * Copyright (C) 2008-2014 The QXmpp developers
00003  *
00004  * Author:
00005  *  Jeremy Lainé
00006  *
00007  * Source:
00008  *  https://github.com/qxmpp-project/qxmpp
00009  *
00010  * This file is a part of QXmpp library.
00011  *
00012  * This library is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU Lesser General Public
00014  * License as published by the Free Software Foundation; either
00015  * version 2.1 of the License, or (at your option) any later version.
00016  *
00017  * This library is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00020  * Lesser General Public License for more details.
00021  *
00022  */
00023 
00024 #ifndef QXMPPRTCPPACKET_H
00025 #define QXMPPRTCPPACKET_H
00026 
00027 #include <QSharedDataPointer>
00028 
00029 #include "QXmppGlobal.h"
00030 
00031 class QXmppRtcpPacketPrivate;
00032 class QXmppRtcpReceiverReport;
00033 class QXmppRtcpReceiverReportPrivate;
00034 class QXmppRtcpSenderInfo;
00035 class QXmppRtcpSenderInfoPrivate;
00036 class QXmppRtcpSourceDescription;
00037 class QXmppRtcpSourceDescriptionPrivate;
00038 
00042 
00043 class QXMPP_EXPORT QXmppRtcpPacket
00044 {
00045 public:
00046     enum Type {
00047         SenderReport        = 200,
00048         ReceiverReport      = 201,
00049         SourceDescription   = 202,
00050         Goodbye             = 203,
00051     };
00052 
00053     QXmppRtcpPacket();
00054     QXmppRtcpPacket(const QXmppRtcpPacket &other);
00055     ~QXmppRtcpPacket();
00056 
00057     bool decode(const QByteArray &ba);
00058     QByteArray encode() const;
00059 
00060     bool read(QDataStream &stream);
00061     void write(QDataStream &stream) const;
00062 
00063     QString goodbyeReason() const;
00064     void setGoodbyeReason(const QString &goodbyeReason);
00065 
00066     QList<quint32> goodbyeSsrcs() const;
00067     void setGoodbyeSsrcs(const QList<quint32> &goodbyeSsrcs);
00068 
00069     QList<QXmppRtcpReceiverReport> receiverReports() const;
00070     void setReceiverReports(const QList<QXmppRtcpReceiverReport> &reports);
00071 
00072     QXmppRtcpSenderInfo senderInfo() const;
00073     void setSenderInfo(const QXmppRtcpSenderInfo &senderInfo);
00074 
00075     QList<QXmppRtcpSourceDescription> sourceDescriptions() const;
00076     void setSourceDescriptions(const QList<QXmppRtcpSourceDescription> &descriptions);
00077 
00078     quint32 ssrc() const;
00079     void setSsrc(quint32 ssrc);
00080 
00081     quint8 type() const;
00082     void setType(quint8 type);
00083 
00084 private:
00085     QSharedDataPointer<QXmppRtcpPacketPrivate> d;
00086 };
00087 
00089 
00090 class QXMPP_EXPORT QXmppRtcpReceiverReport
00091 {
00092 public:
00093     QXmppRtcpReceiverReport();
00094     QXmppRtcpReceiverReport(const QXmppRtcpReceiverReport &other);
00095     ~QXmppRtcpReceiverReport();
00096 
00097     quint32 dlsr() const;
00098     void setDlsr(quint32 dlsr);
00099 
00100     quint8 fractionLost() const;
00101     void setFractionLost(quint8 fractionLost);
00102 
00103     quint32 jitter() const;
00104     void setJitter(quint32 jitter);
00105 
00106     quint32 lsr() const;
00107     void setLsr(quint32 lsr);
00108 
00109     quint32 ssrc() const;
00110     void setSsrc(quint32 ssrc);
00111 
00112     quint32 totalLost() const;
00113     void setTotalLost(quint32 totalLost);
00114 
00115 private:
00116     friend class QXmppRtcpPacket;
00117     QSharedDataPointer<QXmppRtcpReceiverReportPrivate> d;
00118 };
00119 
00121 
00122 class QXMPP_EXPORT QXmppRtcpSenderInfo
00123 {
00124 public:
00125     QXmppRtcpSenderInfo();
00126     QXmppRtcpSenderInfo(const QXmppRtcpSenderInfo &other);
00127     ~QXmppRtcpSenderInfo();
00128 
00129     quint64 ntpStamp() const;
00130     void setNtpStamp(quint64 ntpStamp);
00131 
00132     quint32 rtpStamp() const;
00133     void setRtpStamp(quint32 rtpStamp);
00134 
00135     quint32 octetCount() const;
00136     void setOctetCount(quint32 count);
00137 
00138     quint32 packetCount() const;
00139     void setPacketCount(quint32 count);
00140 
00141 private:
00142     friend class QXmppRtcpPacket;
00143     QSharedDataPointer<QXmppRtcpSenderInfoPrivate> d;
00144 };
00145 
00147 
00148 class QXMPP_EXPORT QXmppRtcpSourceDescription
00149 {
00150 public:
00151     QXmppRtcpSourceDescription();
00152     QXmppRtcpSourceDescription(const QXmppRtcpSourceDescription &other);
00153     ~QXmppRtcpSourceDescription();
00154 
00155     QString cname() const;
00156     void setCname(const QString &name);
00157 
00158     QString name() const;
00159     void setName(const QString &name);
00160 
00161     quint32 ssrc() const;
00162     void setSsrc(const quint32 ssrc);
00163 
00164 private:
00165     friend class QXmppRtcpPacket;
00166     QSharedDataPointer<QXmppRtcpSourceDescriptionPrivate> d;
00167 };
00168 
00169 #endif
 All Classes Functions Enumerations Enumerator Properties