blob: 729f841ab65c2bb51eeacd02910fbd61b16ef2a4 [file] [log] [blame]
skvladdc1c62c2016-03-16 19:07:43 -07001/*
2 * Copyright 2015 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_RTPPARAMETERS_H_
12#define WEBRTC_API_RTPPARAMETERS_H_
13
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070014#include <string>
skvladdc1c62c2016-03-16 19:07:43 -070015#include <vector>
16
17namespace webrtc {
18
19// These structures are defined as part of the RtpSender interface.
20// See http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface for details.
21struct RtpEncodingParameters {
deadbeefdbe2b872016-03-22 15:42:00 -070022 bool active = true;
skvladdc1c62c2016-03-16 19:07:43 -070023 int max_bitrate_bps = -1;
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070024
25 bool operator==(const RtpEncodingParameters& o) const {
26 return active == o.active && max_bitrate_bps == o.max_bitrate_bps;
27 }
28};
29
30struct RtpCodecParameters {
31 int payload_type;
32 std::string mime_type;
33 int clock_rate;
34 int channels = 1;
35 // TODO(deadbeef): Add sdpFmtpLine field.
36
37 bool operator==(const RtpCodecParameters& o) const {
38 return payload_type == o.payload_type && mime_type == o.mime_type &&
39 clock_rate == o.clock_rate && channels == o.channels;
40 }
skvladdc1c62c2016-03-16 19:07:43 -070041};
42
43struct RtpParameters {
44 std::vector<RtpEncodingParameters> encodings;
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070045 std::vector<RtpCodecParameters> codecs;
46
47 bool operator==(const RtpParameters& o) const {
48 return encodings == o.encodings && codecs == o.codecs;
49 }
skvladdc1c62c2016-03-16 19:07:43 -070050};
51
52} // namespace webrtc
53
54#endif // WEBRTC_API_RTPPARAMETERS_H_