zhihuang | 55adc0e | 2017-03-10 18:33:45 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_API_ORTC_SESSIONDESCRIPTION_H_ |
| 12 | #define WEBRTC_API_ORTC_SESSIONDESCRIPTION_H_ |
| 13 | |
| 14 | #include <string> |
| 15 | #include <utility> |
| 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | // A structured representation of an SDP session description. |
| 20 | class SessionDescription { |
| 21 | public: |
zhihuang | 30e0da4 | 2017-03-13 11:00:54 -0700 | [diff] [blame^] | 22 | SessionDescription(int64_t session_id, std::string session_version) |
| 23 | : session_id_(session_id), session_version_(std::move(session_version)) {} |
zhihuang | 55adc0e | 2017-03-10 18:33:45 -0800 | [diff] [blame] | 24 | |
| 25 | // https://tools.ietf.org/html/rfc4566#section-5.2 |
| 26 | // o=<username> <sess-id> <sess-version> <nettype> <addrtype> |
| 27 | // <unicast-address> |
| 28 | // session_id_ is the "sess-id" field. |
| 29 | // session_version_ is the "sess-version" field. |
zhihuang | 30e0da4 | 2017-03-13 11:00:54 -0700 | [diff] [blame^] | 30 | int64_t session_id() { return session_id_; } |
| 31 | void set_session_id(int64_t session_id) { session_id_ = session_id; } |
zhihuang | 55adc0e | 2017-03-10 18:33:45 -0800 | [diff] [blame] | 32 | |
| 33 | const std::string& session_version() const { return session_version_; } |
| 34 | void set_session_version(std::string session_version) { |
| 35 | session_version_ = std::move(session_version); |
| 36 | } |
| 37 | |
| 38 | private: |
zhihuang | 30e0da4 | 2017-03-13 11:00:54 -0700 | [diff] [blame^] | 39 | int64_t session_id_; |
zhihuang | 55adc0e | 2017-03-10 18:33:45 -0800 | [diff] [blame] | 40 | std::string session_version_; |
| 41 | }; |
| 42 | |
| 43 | } // namespace webrtc |
| 44 | |
| 45 | #endif // WEBRTC_API_ORTC_SESSIONDESCRIPTION_H_ |