blob: 39b67bd1b4d98679d7deb6d71f53212175ebcefc [file] [log] [blame]
zhihuang55adc0e2017-03-10 18:33:45 -08001/*
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>
zstein7aeabd02017-03-17 19:10:37 -070016#include <vector>
zhihuang55adc0e2017-03-10 18:33:45 -080017
18#include "webrtc/base/optional.h"
zstein7aeabd02017-03-17 19:10:37 -070019#include "webrtc/media/base/cryptoparams.h"
zhihuang55adc0e2017-03-10 18:33:45 -080020
21namespace webrtc {
22
23// A structured representation of a media description within an SDP session
24// description.
25class 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
zstein7aeabd02017-03-17 19:10:37 -070037 // 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
zhihuang55adc0e2017-03-10 18:33:45 -080045 private:
46 rtc::Optional<std::string> mid_;
zstein7aeabd02017-03-17 19:10:37 -070047
48 std::vector<cricket::CryptoParams> sdes_params_;
zhihuang55adc0e2017-03-10 18:33:45 -080049};
50
51} // namespace webrtc
52
53#endif // WEBRTC_API_ORTC_MEDIADESCRIPTION_H_