blob: 26b5a24ad480f09ee15ae4231aea1dbc147177b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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 media = Unknown, std::string bandwidthType = "",
std::string bandwidthValue = "", boost::uint32_t ssrc = 0) :
media(media), bandwidthType(bandwidthType), bandwidthValue(bandwidthValue), ssrc(ssrc) {}
void setMedia(MediaType media) { this->media = media; }
MediaType getMedia() const { return media; }
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 media;
std::string bandwidthType;
std::string bandwidthValue;
boost::uint32_t ssrc;
std::vector<RTPPayloadType> payloadTypes;
};
}
|