summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordknn <yoann.blein@free.fr>2012-06-02 22:41:35 (GMT)
committerdknn <yoann.blein@free.fr>2012-09-22 08:49:55 (GMT)
commit174d01d9812694d201f6f3939fc7b8bf4650cfa2 (patch)
tree2662370404afd5027afea8dd8f990a81d9df83b2 /Swiften/Elements
parented95bc3cb17285a16a201f8ffe26ac38a4403f47 (diff)
downloadswift-contrib-174d01d9812694d201f6f3939fc7b8bf4650cfa2.zip
swift-contrib-174d01d9812694d201f6f3939fc7b8bf4650cfa2.tar.bz2
Major part of a RTP description element
Diffstat (limited to 'Swiften/Elements')
-rw-r--r--Swiften/Elements/JingleRTPDescription.h56
-rw-r--r--Swiften/Elements/RTPPayloadType.h2
2 files changed, 57 insertions, 1 deletions
diff --git a/Swiften/Elements/JingleRTPDescription.h b/Swiften/Elements/JingleRTPDescription.h
new file mode 100644
index 0000000..5337aa8
--- /dev/null
+++ b/Swiften/Elements/JingleRTPDescription.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2012 Yoann Blein
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#pragma once
+
+#include <boost/shared_ptr.hpp>
+#include <vector>
+
+#include <Swiften/Elements/JingleDescription.h>
+#include <Swiften/Elements/RTPPayloadType.h>
+
+namespace Swift {
+ class JingleRTPDescription : public JingleDescription {
+ public:
+ typedef boost::shared_ptr<JingleRTPDescription> ref;
+
+ enum MediaType {
+ Audio,
+ Video,
+ Unknown,
+ };
+
+ public:
+ JingleRTPDescription(MediaType mediaType = Unknown, std::string bandwidthType = "",
+ std::string bandwidthValue = "", boost::uint32_t ssrc = 0) :
+ mediaType(mediaType), bandwidthType(bandwidthType), bandwidthValue(bandwidthValue), ssrc(ssrc) {}
+
+ void setMediaType(MediaType mediaType) { this->mediaType = mediaType; }
+ MediaType getMediaType() const { return mediaType; }
+
+ void setBandwidth(const std::string& type, const std::string& value) {
+ bandwidthType = type;
+ bandwidthValue = value;
+ }
+ void getBandwidth(std::string &type, std::string& value) const {
+ type = bandwidthType;
+ value = bandwidthValue;
+ }
+
+ void setSSRC(boost::uint32_t ssrc) { this->ssrc = ssrc; }
+ boost::uint32_t getSSRC() const { return ssrc; }
+
+ void addPayloadType(const RTPPayloadType& offer) { payloadTypes.push_back(offer); }
+ const std::vector<RTPPayloadType>& getPayloadTypes() const { return payloadTypes; }
+
+ private:
+ MediaType mediaType;
+ std::string bandwidthType;
+ std::string bandwidthValue;
+ boost::uint32_t ssrc;
+ std::vector<RTPPayloadType> payloadTypes;
+ };
+}
diff --git a/Swiften/Elements/RTPPayloadType.h b/Swiften/Elements/RTPPayloadType.h
index 4e737ee..b06b29d 100644
--- a/Swiften/Elements/RTPPayloadType.h
+++ b/Swiften/Elements/RTPPayloadType.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 Yoann Blein
+ * Copyright (c) 2012 Yoann Blein
* Licensed under the simplified BSD license.
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/