Chromium Code Reviews

Side by Side Diff: webrtc/api/jsepsessiondescription.h

Issue 2680273002: Adding more comments to every header file in api/ subdirectory. (Closed)
Patch Set: Merge with master Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « webrtc/api/jsepicecandidate.h ('k') | webrtc/api/mediaconstraintsinterface.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // TODO(deadbeef): Move this out of api/; it's an implementation detail and
12 // shouldn't be used externally.
12 13
13 #ifndef WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ 14 #ifndef WEBRTC_API_JSEPSESSIONDESCRIPTION_H_
14 #define WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ 15 #define WEBRTC_API_JSEPSESSIONDESCRIPTION_H_
15 16
16 #include <memory> 17 #include <memory>
17 #include <string> 18 #include <string>
18 #include <vector> 19 #include <vector>
19 20
20 #include "webrtc/api/jsep.h" 21 #include "webrtc/api/jsep.h"
21 #include "webrtc/api/jsepicecandidate.h" 22 #include "webrtc/api/jsepicecandidate.h"
22 #include "webrtc/base/constructormagic.h" 23 #include "webrtc/base/constructormagic.h"
23 #include "webrtc/p2p/base/candidate.h" 24 #include "webrtc/p2p/base/candidate.h"
24 25
25 namespace cricket { 26 namespace cricket {
26 class SessionDescription; 27 class SessionDescription;
27 } 28 }
28 29
29 namespace webrtc { 30 namespace webrtc {
30 31
32 // Implementation of SessionDescriptionInterface.
31 class JsepSessionDescription : public SessionDescriptionInterface { 33 class JsepSessionDescription : public SessionDescriptionInterface {
32 public: 34 public:
33 explicit JsepSessionDescription(const std::string& type); 35 explicit JsepSessionDescription(const std::string& type);
34 virtual ~JsepSessionDescription(); 36 virtual ~JsepSessionDescription();
35 37
36 // |error| can be NULL if don't care about the failure reason. 38 // |error| may be NULL.
37 bool Initialize(const std::string& sdp, SdpParseError* error); 39 bool Initialize(const std::string& sdp, SdpParseError* error);
38 40
39 // Takes ownership of |description|. 41 // Takes ownership of |description|.
42 // TODO(deadbeef): Make this use an std::unique_ptr<>, so ownership logic is
43 // more clear.
40 bool Initialize(cricket::SessionDescription* description, 44 bool Initialize(cricket::SessionDescription* description,
41 const std::string& session_id, 45 const std::string& session_id,
42 const std::string& session_version); 46 const std::string& session_version);
43 47
44 virtual cricket::SessionDescription* description() { 48 virtual cricket::SessionDescription* description() {
45 return description_.get(); 49 return description_.get();
46 } 50 }
47 virtual const cricket::SessionDescription* description() const { 51 virtual const cricket::SessionDescription* description() const {
48 return description_.get(); 52 return description_.get();
49 } 53 }
50 virtual std::string session_id() const { 54 virtual std::string session_id() const {
51 return session_id_; 55 return session_id_;
52 } 56 }
53 virtual std::string session_version() const { 57 virtual std::string session_version() const {
54 return session_version_; 58 return session_version_;
55 } 59 }
56 virtual std::string type() const { 60 virtual std::string type() const {
57 return type_; 61 return type_;
58 } 62 }
59 // Allow changing the type. Used for testing. 63 // Allows changing the type. Used for testing.
60 void set_type(const std::string& type) { type_ = type; } 64 void set_type(const std::string& type) { type_ = type; }
61 virtual bool AddCandidate(const IceCandidateInterface* candidate); 65 virtual bool AddCandidate(const IceCandidateInterface* candidate);
62 virtual size_t RemoveCandidates( 66 virtual size_t RemoveCandidates(
63 const std::vector<cricket::Candidate>& candidates); 67 const std::vector<cricket::Candidate>& candidates);
64 virtual size_t number_of_mediasections() const; 68 virtual size_t number_of_mediasections() const;
65 virtual const IceCandidateCollection* candidates( 69 virtual const IceCandidateCollection* candidates(
66 size_t mediasection_index) const; 70 size_t mediasection_index) const;
67 virtual bool ToString(std::string* out) const; 71 virtual bool ToString(std::string* out) const;
68 72
69 static const int kDefaultVideoCodecId; 73 static const int kDefaultVideoCodecId;
70 static const char kDefaultVideoCodecName[]; 74 static const char kDefaultVideoCodecName[];
71 75
72 private: 76 private:
73 std::unique_ptr<cricket::SessionDescription> description_; 77 std::unique_ptr<cricket::SessionDescription> description_;
74 std::string session_id_; 78 std::string session_id_;
75 std::string session_version_; 79 std::string session_version_;
76 std::string type_; 80 std::string type_;
77 std::vector<JsepCandidateCollection> candidate_collection_; 81 std::vector<JsepCandidateCollection> candidate_collection_;
78 82
79 bool GetMediasectionIndex(const IceCandidateInterface* candidate, 83 bool GetMediasectionIndex(const IceCandidateInterface* candidate,
80 size_t* index); 84 size_t* index);
81 int GetMediasectionIndex(const cricket::Candidate& candidate); 85 int GetMediasectionIndex(const cricket::Candidate& candidate);
82 86
83 RTC_DISALLOW_COPY_AND_ASSIGN(JsepSessionDescription); 87 RTC_DISALLOW_COPY_AND_ASSIGN(JsepSessionDescription);
84 }; 88 };
85 89
86 } // namespace webrtc 90 } // namespace webrtc
87 91
88 #endif // WEBRTC_API_JSEPSESSIONDESCRIPTION_H_ 92 #endif // WEBRTC_API_JSEPSESSIONDESCRIPTION_H_
OLDNEW
« no previous file with comments | « webrtc/api/jsepicecandidate.h ('k') | webrtc/api/mediaconstraintsinterface.h » ('j') | no next file with comments »

Powered by Google App Engine