OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 // Implements the SessionDescriptionInterface. | 11 // Implements the SessionDescriptionInterface. |
12 | 12 |
13 #ifndef WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ | 13 #ifndef WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ |
14 #define WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ | 14 #define WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ |
15 | 15 |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 | 18 |
19 #include "webrtc/api/jsep.h" | 19 #include "webrtc/api/jsep.h" |
20 #include "webrtc/api/jsepicecandidate.h" | 20 #include "webrtc/api/jsepicecandidate.h" |
21 #include "webrtc/base/scoped_ptr.h" | 21 #include "webrtc/base/scoped_ptr.h" |
22 #include "webrtc/p2p/base/candidate.h" | |
23 | 22 |
24 namespace cricket { | 23 namespace cricket { |
25 class SessionDescription; | 24 class SessionDescription; |
26 } | 25 } |
27 | 26 |
28 namespace webrtc { | 27 namespace webrtc { |
29 | 28 |
30 class JsepSessionDescription : public SessionDescriptionInterface { | 29 class JsepSessionDescription : public SessionDescriptionInterface { |
31 public: | 30 public: |
32 explicit JsepSessionDescription(const std::string& type); | 31 explicit JsepSessionDescription(const std::string& type); |
(...skipping 18 matching lines...) Expand all Loading... |
51 } | 50 } |
52 virtual std::string session_version() const { | 51 virtual std::string session_version() const { |
53 return session_version_; | 52 return session_version_; |
54 } | 53 } |
55 virtual std::string type() const { | 54 virtual std::string type() const { |
56 return type_; | 55 return type_; |
57 } | 56 } |
58 // Allow changing the type. Used for testing. | 57 // Allow changing the type. Used for testing. |
59 void set_type(const std::string& type) { type_ = type; } | 58 void set_type(const std::string& type) { type_ = type; } |
60 virtual bool AddCandidate(const IceCandidateInterface* candidate); | 59 virtual bool AddCandidate(const IceCandidateInterface* candidate); |
61 virtual size_t RemoveCandidates( | |
62 const std::vector<cricket::Candidate>& candidates); | |
63 virtual size_t number_of_mediasections() const; | 60 virtual size_t number_of_mediasections() const; |
64 virtual const IceCandidateCollection* candidates( | 61 virtual const IceCandidateCollection* candidates( |
65 size_t mediasection_index) const; | 62 size_t mediasection_index) const; |
66 virtual bool ToString(std::string* out) const; | 63 virtual bool ToString(std::string* out) const; |
67 | 64 |
68 // Default video encoder settings. The resolution is the max resolution. | 65 // Default video encoder settings. The resolution is the max resolution. |
69 // TODO(perkj): Implement proper negotiation of video resolution. | 66 // TODO(perkj): Implement proper negotiation of video resolution. |
70 static const int kDefaultVideoCodecId; | 67 static const int kDefaultVideoCodecId; |
71 static const int kDefaultVideoCodecFramerate; | 68 static const int kDefaultVideoCodecFramerate; |
72 static const char kDefaultVideoCodecName[]; | 69 static const char kDefaultVideoCodecName[]; |
73 static const int kMaxVideoCodecWidth; | 70 static const int kMaxVideoCodecWidth; |
74 static const int kMaxVideoCodecHeight; | 71 static const int kMaxVideoCodecHeight; |
75 static const int kDefaultVideoCodecPreference; | 72 static const int kDefaultVideoCodecPreference; |
76 | 73 |
77 private: | 74 private: |
78 rtc::scoped_ptr<cricket::SessionDescription> description_; | 75 rtc::scoped_ptr<cricket::SessionDescription> description_; |
79 std::string session_id_; | 76 std::string session_id_; |
80 std::string session_version_; | 77 std::string session_version_; |
81 std::string type_; | 78 std::string type_; |
82 std::vector<JsepCandidateCollection> candidate_collection_; | 79 std::vector<JsepCandidateCollection> candidate_collection_; |
83 | 80 |
84 bool GetMediasectionIndex(const IceCandidateInterface* candidate, | 81 bool GetMediasectionIndex(const IceCandidateInterface* candidate, |
85 size_t* index); | 82 size_t* index); |
86 int GetMediasectionIndex(const cricket::Candidate& candidate); | |
87 | 83 |
88 RTC_DISALLOW_COPY_AND_ASSIGN(JsepSessionDescription); | 84 RTC_DISALLOW_COPY_AND_ASSIGN(JsepSessionDescription); |
89 }; | 85 }; |
90 | 86 |
91 } // namespace webrtc | 87 } // namespace webrtc |
92 | 88 |
93 #endif // WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ | 89 #endif // WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ |
OLD | NEW |