OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 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 #ifndef WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ | 11 #ifndef WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ |
12 #define WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ | 12 #define WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 #include <utility> | 15 #include <utility> |
| 16 #include <vector> |
16 | 17 |
17 #include "webrtc/base/optional.h" | 18 #include "webrtc/base/optional.h" |
| 19 #include "webrtc/media/base/cryptoparams.h" |
18 | 20 |
19 namespace webrtc { | 21 namespace webrtc { |
20 | 22 |
21 // A structured representation of a media description within an SDP session | 23 // A structured representation of a media description within an SDP session |
22 // description. | 24 // description. |
23 class MediaDescription { | 25 class MediaDescription { |
24 public: | 26 public: |
25 explicit MediaDescription(std::string mid) : mid_(std::move(mid)) {} | 27 explicit MediaDescription(std::string mid) : mid_(std::move(mid)) {} |
26 | 28 |
27 ~MediaDescription() {} | 29 ~MediaDescription() {} |
28 | 30 |
29 // The mid(media stream identification) is used for identifying media streams | 31 // The mid(media stream identification) is used for identifying media streams |
30 // within a session description. | 32 // within a session description. |
31 // https://tools.ietf.org/html/rfc5888#section-6 | 33 // https://tools.ietf.org/html/rfc5888#section-6 |
32 rtc::Optional<std::string> mid() const { return mid_; } | 34 rtc::Optional<std::string> mid() const { return mid_; } |
33 void set_mid(std::string mid) { mid_.emplace(std::move(mid)); } | 35 void set_mid(std::string mid) { mid_.emplace(std::move(mid)); } |
34 | 36 |
| 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 |
35 private: | 45 private: |
36 rtc::Optional<std::string> mid_; | 46 rtc::Optional<std::string> mid_; |
| 47 |
| 48 std::vector<cricket::CryptoParams> sdes_params_; |
37 }; | 49 }; |
38 | 50 |
39 } // namespace webrtc | 51 } // namespace webrtc |
40 | 52 |
41 #endif // WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ | 53 #endif // WEBRTC_API_ORTC_MEDIADESCRIPTION_H_ |
OLD | NEW |