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> |
zstein | 7aeabd0 | 2017-03-17 19:10:37 -0700 | [diff] [blame^] | 16 | #include <vector> |
zhihuang | 55adc0e | 2017-03-10 18:33:45 -0800 | [diff] [blame] | 17 | |
| 18 | #include "webrtc/base/optional.h" |
zstein | 7aeabd0 | 2017-03-17 19:10:37 -0700 | [diff] [blame^] | 19 | #include "webrtc/media/base/cryptoparams.h" |
zhihuang | 55adc0e | 2017-03-10 18:33:45 -0800 | [diff] [blame] | 20 | |
| 21 | namespace webrtc { |
| 22 | |
| 23 | // A structured representation of a media description within an SDP session |
| 24 | // description. |
| 25 | class MediaDescription { |
| 26 | public: |
| 27 | explicit MediaDescription(std::string mid) : mid_(std::move(mid)) {} |
| 28 | |
| 29 | ~MediaDescription() {} |
| 30 | |
| 31 | // The mid(media stream identification) is used for identifying media streams |
| 32 | // within a session description. |
| 33 | // https://tools.ietf.org/html/rfc5888#section-6 |
| 34 | rtc::Optional<std::string> mid() const { return mid_; } |
| 35 | void set_mid(std::string mid) { mid_.emplace(std::move(mid)); } |
| 36 | |
zstein | 7aeabd0 | 2017-03-17 19:10:37 -0700 | [diff] [blame^] | 37 | // Security keys and parameters for this media stream. Can be used to |
| 38 | // negotiate parameters for SRTP. |
| 39 | // https://tools.ietf.org/html/rfc4568#page-5 |
| 40 | std::vector<cricket::CryptoParams>& sdes_params() { return sdes_params_; } |
| 41 | const std::vector<cricket::CryptoParams>& sdes_params() const { |
| 42 | return sdes_params_; |
| 43 | } |
| 44 | |
zhihuang | 55adc0e | 2017-03-10 18:33:45 -0800 | [diff] [blame] | 45 | private: |
| 46 | rtc::Optional<std::string> mid_; |
zstein | 7aeabd0 | 2017-03-17 19:10:37 -0700 | [diff] [blame^] | 47 | |
| 48 | std::vector<cricket::CryptoParams> sdes_params_; |
zhihuang | 55adc0e | 2017-03-10 18:33:45 -0800 | [diff] [blame] | 49 | }; |
| 50 | |
| 51 | } // namespace webrtc |
| 52 | |
| 53 | #endif // WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ |