2017-03-10 18:33:45 -08:00
|
|
|
/*
|
|
|
|
|
* Copyright 2017 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef API_ORTC_MEDIADESCRIPTION_H_
|
|
|
|
|
#define API_ORTC_MEDIADESCRIPTION_H_
|
2017-03-10 18:33:45 -08:00
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <utility>
|
2017-03-17 19:10:37 -07:00
|
|
|
#include <vector>
|
2017-03-10 18:33:45 -08:00
|
|
|
|
2018-06-21 13:32:56 +02:00
|
|
|
#include "absl/types/optional.h"
|
2017-11-15 13:15:17 +01:00
|
|
|
#include "api/cryptoparams.h"
|
2017-03-10 18:33:45 -08:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
// A structured representation of a media description within an SDP session
|
|
|
|
|
// description.
|
|
|
|
|
class MediaDescription {
|
|
|
|
|
public:
|
|
|
|
|
explicit MediaDescription(std::string mid) : mid_(std::move(mid)) {}
|
|
|
|
|
|
|
|
|
|
~MediaDescription() {}
|
|
|
|
|
|
|
|
|
|
// The mid(media stream identification) is used for identifying media streams
|
|
|
|
|
// within a session description.
|
|
|
|
|
// https://tools.ietf.org/html/rfc5888#section-6
|
2018-06-21 13:32:56 +02:00
|
|
|
absl::optional<std::string> mid() const { return mid_; }
|
2017-03-10 18:33:45 -08:00
|
|
|
void set_mid(std::string mid) { mid_.emplace(std::move(mid)); }
|
|
|
|
|
|
2017-03-17 19:10:37 -07:00
|
|
|
// Security keys and parameters for this media stream. Can be used to
|
|
|
|
|
// negotiate parameters for SRTP.
|
|
|
|
|
// https://tools.ietf.org/html/rfc4568#page-5
|
|
|
|
|
std::vector<cricket::CryptoParams>& sdes_params() { return sdes_params_; }
|
|
|
|
|
const std::vector<cricket::CryptoParams>& sdes_params() const {
|
|
|
|
|
return sdes_params_;
|
|
|
|
|
}
|
|
|
|
|
|
2017-03-10 18:33:45 -08:00
|
|
|
private:
|
2018-06-21 13:32:56 +02:00
|
|
|
absl::optional<std::string> mid_;
|
2017-03-17 19:10:37 -07:00
|
|
|
|
|
|
|
|
std::vector<cricket::CryptoParams> sdes_params_;
|
2017-03-10 18:33:45 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // API_ORTC_MEDIADESCRIPTION_H_
|