blob: 5c79ab4e9df571f1f4ef7c315c6efc4024bae84c [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 }
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -070028 bool operator!=(const RtpEncodingParameters& o) const {
29 return !(*this == o);
30 }
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070031};
32
33struct RtpCodecParameters {
34 int payload_type;
35 std::string mime_type;
36 int clock_rate;
37 int channels = 1;
38 // TODO(deadbeef): Add sdpFmtpLine field.
39
40 bool operator==(const RtpCodecParameters& o) const {
41 return payload_type == o.payload_type && mime_type == o.mime_type &&
42 clock_rate == o.clock_rate && channels == o.channels;
43 }
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -070044 bool operator!=(const RtpCodecParameters& o) const { return !(*this == o); }
skvladdc1c62c2016-03-16 19:07:43 -070045};
46
47struct RtpParameters {
48 std::vector<RtpEncodingParameters> encodings;
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070049 std::vector<RtpCodecParameters> codecs;
50
51 bool operator==(const RtpParameters& o) const {
52 return encodings == o.encodings && codecs == o.codecs;
53 }
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -070054 bool operator!=(const RtpParameters& o) const { return !(*this == o); }
skvladdc1c62c2016-03-16 19:07:43 -070055};
56
57} // namespace webrtc
58
59#endif // WEBRTC_API_RTPPARAMETERS_H_