deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef ORTC_TESTRTPPARAMETERS_H_ |
| 12 | #define ORTC_TESTRTPPARAMETERS_H_ |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 13 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 14 | #include "api/ortc/rtptransportinterface.h" |
| 15 | #include "api/rtpparameters.h" |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 16 | |
| 17 | namespace webrtc { |
| 18 | |
| 19 | // Helper methods to create RtpParameters to use for sending/receiving. |
| 20 | // |
| 21 | // "MakeMinimal" methods contain the minimal necessary information for an |
| 22 | // RtpSender or RtpReceiver to function. The "MakeFull" methods are the |
| 23 | // opposite, and include all features that would normally be offered by a |
| 24 | // PeerConnection, and in some cases additional ones. |
| 25 | // |
| 26 | // These methods are intended to be used for end-to-end testing (such as in |
| 27 | // ortcfactory_integrationtest.cc), or unit testing that doesn't care about the |
| 28 | // specific contents of the parameters. Tests should NOT assume that these |
| 29 | // methods will not change; tests that are testing that a specific value in the |
| 30 | // parameters is applied properly should construct the parameters in the test |
| 31 | // itself. |
| 32 | |
sprang | db2a9fc | 2017-08-09 06:42:32 -0700 | [diff] [blame] | 33 | inline RtpTransportParameters MakeRtcpMuxParameters() { |
| 34 | RtpTransportParameters parameters; |
| 35 | parameters.rtcp.mux = true; |
| 36 | return parameters; |
deadbeef | e814a0d | 2017-02-25 18:15:09 -0800 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | RtpParameters MakeMinimalOpusParameters(); |
| 40 | RtpParameters MakeMinimalIsacParameters(); |
| 41 | RtpParameters MakeMinimalOpusParametersWithSsrc(uint32_t ssrc); |
| 42 | RtpParameters MakeMinimalIsacParametersWithSsrc(uint32_t ssrc); |
| 43 | |
| 44 | RtpParameters MakeMinimalVp8Parameters(); |
| 45 | RtpParameters MakeMinimalVp9Parameters(); |
| 46 | RtpParameters MakeMinimalVp8ParametersWithSsrc(uint32_t ssrc); |
| 47 | RtpParameters MakeMinimalVp9ParametersWithSsrc(uint32_t ssrc); |
| 48 | |
| 49 | // Will create an encoding with no SSRC (meaning "match first SSRC seen" for a |
| 50 | // receiver, or "pick one automatically" for a sender). |
| 51 | RtpParameters MakeMinimalOpusParametersWithNoSsrc(); |
| 52 | RtpParameters MakeMinimalIsacParametersWithNoSsrc(); |
| 53 | RtpParameters MakeMinimalVp8ParametersWithNoSsrc(); |
| 54 | RtpParameters MakeMinimalVp9ParametersWithNoSsrc(); |
| 55 | |
| 56 | // Make audio parameters with all the available properties configured and |
| 57 | // features used, and with multiple codecs offered. Obtained by taking a |
| 58 | // snapshot of a default PeerConnection offer (and adding other things, like |
| 59 | // bitrate limit). |
| 60 | RtpParameters MakeFullOpusParameters(); |
| 61 | RtpParameters MakeFullIsacParameters(); |
| 62 | |
| 63 | // Make video parameters with all the available properties configured and |
| 64 | // features used, and with multiple codecs offered. Obtained by taking a |
| 65 | // snapshot of a default PeerConnection offer (and adding other things, like |
| 66 | // bitrate limit). |
| 67 | RtpParameters MakeFullVp8Parameters(); |
| 68 | RtpParameters MakeFullVp9Parameters(); |
| 69 | |
| 70 | } // namespace webrtc |
| 71 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 72 | #endif // ORTC_TESTRTPPARAMETERS_H_ |