skvlad | dc1c62c | 2016-03-16 19:07:43 -0700 | [diff] [blame] | 1 | /* |
| 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 Brandstetter | 0cd086b | 2016-04-20 16:23:10 -0700 | [diff] [blame] | 14 | #include <string> |
skvlad | dc1c62c | 2016-03-16 19:07:43 -0700 | [diff] [blame] | 15 | #include <vector> |
| 16 | |
| 17 | namespace 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. |
| 21 | struct RtpEncodingParameters { |
deadbeef | dbe2b87 | 2016-03-22 15:42:00 -0700 | [diff] [blame] | 22 | bool active = true; |
skvlad | dc1c62c | 2016-03-16 19:07:43 -0700 | [diff] [blame] | 23 | int max_bitrate_bps = -1; |
Taylor Brandstetter | 0cd086b | 2016-04-20 16:23:10 -0700 | [diff] [blame] | 24 | |
| 25 | bool operator==(const RtpEncodingParameters& o) const { |
| 26 | return active == o.active && max_bitrate_bps == o.max_bitrate_bps; |
| 27 | } |
Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 28 | bool operator!=(const RtpEncodingParameters& o) const { |
| 29 | return !(*this == o); |
| 30 | } |
Taylor Brandstetter | 0cd086b | 2016-04-20 16:23:10 -0700 | [diff] [blame] | 31 | }; |
| 32 | |
| 33 | struct 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 Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 44 | bool operator!=(const RtpCodecParameters& o) const { return !(*this == o); } |
skvlad | dc1c62c | 2016-03-16 19:07:43 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
| 47 | struct RtpParameters { |
| 48 | std::vector<RtpEncodingParameters> encodings; |
Taylor Brandstetter | 0cd086b | 2016-04-20 16:23:10 -0700 | [diff] [blame] | 49 | std::vector<RtpCodecParameters> codecs; |
| 50 | |
| 51 | bool operator==(const RtpParameters& o) const { |
| 52 | return encodings == o.encodings && codecs == o.codecs; |
| 53 | } |
Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 54 | bool operator!=(const RtpParameters& o) const { return !(*this == o); } |
skvlad | dc1c62c | 2016-03-16 19:07:43 -0700 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | } // namespace webrtc |
| 58 | |
| 59 | #endif // WEBRTC_API_RTPPARAMETERS_H_ |