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_MEDIADESCRIPTION_H_ |
| 12 | #define WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ |
| 13 | |
| 14 | #include <string> |
| 15 | #include <utility> |
| 16 | |
| 17 | #include "webrtc/base/optional.h" |
| 18 | |
| 19 | namespace webrtc { |
| 20 | |
| 21 | // A structured representation of a media description within an SDP session |
| 22 | // description. |
| 23 | class MediaDescription { |
| 24 | public: |
| 25 | explicit MediaDescription(std::string mid) : mid_(std::move(mid)) {} |
| 26 | |
| 27 | ~MediaDescription() {} |
| 28 | |
| 29 | // The mid(media stream identification) is used for identifying media streams |
| 30 | // within a session description. |
| 31 | // https://tools.ietf.org/html/rfc5888#section-6 |
| 32 | rtc::Optional<std::string> mid() const { return mid_; } |
| 33 | void set_mid(std::string mid) { mid_.emplace(std::move(mid)); } |
| 34 | |
| 35 | private: |
| 36 | rtc::Optional<std::string> mid_; |
| 37 | }; |
| 38 | |
| 39 | } // namespace webrtc |
| 40 | |
| 41 | #endif // WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ |