skvlad | 303b3c2 | 2016-03-24 19:36:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2013 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 | package org.webrtc; |
| 12 | |
Magnus Jedvert | 6062f37 | 2017-11-16 16:53:12 +0100 | [diff] [blame] | 13 | import java.util.List; |
| 14 | import java.util.ArrayList; |
skvlad | 303b3c2 | 2016-03-24 19:36:46 -0700 | [diff] [blame] | 15 | |
| 16 | /** |
| 17 | * The parameters for an {@code RtpSender}, as defined in |
| 18 | * http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface. |
deadbeef | e702b30 | 2017-02-04 12:09:01 -0800 | [diff] [blame] | 19 | * |
| 20 | * Note: These structures use nullable Integer/etc. types because in the |
| 21 | * future, they may be used to construct ORTC RtpSender/RtpReceivers, in |
| 22 | * which case "null" will be used to represent "choose the implementation |
| 23 | * default value". |
skvlad | 303b3c2 | 2016-03-24 19:36:46 -0700 | [diff] [blame] | 24 | */ |
| 25 | public class RtpParameters { |
Taylor Brandstetter | f8711c0 | 2016-03-29 17:21:29 -0700 | [diff] [blame] | 26 | public static class Encoding { |
deadbeef | e702b30 | 2017-02-04 12:09:01 -0800 | [diff] [blame] | 27 | // Set to true to cause this encoding to be sent, and false for it not to |
| 28 | // be sent. |
Taylor Brandstetter | f8711c0 | 2016-03-29 17:21:29 -0700 | [diff] [blame] | 29 | public boolean active = true; |
deadbeef | e702b30 | 2017-02-04 12:09:01 -0800 | [diff] [blame] | 30 | // If non-null, this represents the Transport Independent Application |
| 31 | // Specific maximum bandwidth defined in RFC3890. If null, there is no |
| 32 | // maximum bitrate. |
Taylor Brandstetter | f8711c0 | 2016-03-29 17:21:29 -0700 | [diff] [blame] | 33 | public Integer maxBitrateBps; |
deadbeef | e702b30 | 2017-02-04 12:09:01 -0800 | [diff] [blame] | 34 | // SSRC to be used by this encoding. |
| 35 | // Can't be changed between getParameters/setParameters. |
deadbeef | 8014c75 | 2017-01-06 16:53:00 -0800 | [diff] [blame] | 36 | public Long ssrc; |
Taylor Brandstetter | f8711c0 | 2016-03-29 17:21:29 -0700 | [diff] [blame] | 37 | } |
skvlad | 303b3c2 | 2016-03-24 19:36:46 -0700 | [diff] [blame] | 38 | |
Taylor Brandstetter | 0cd086b | 2016-04-20 16:23:10 -0700 | [diff] [blame] | 39 | public static class Codec { |
deadbeef | e702b30 | 2017-02-04 12:09:01 -0800 | [diff] [blame] | 40 | // Payload type used to identify this codec in RTP packets. |
| 41 | public int payloadType; |
| 42 | // Name used to identify the codec. Equivalent to MIME subtype. |
| 43 | public String name; |
| 44 | // The media type of this codec. Equivalent to MIME top-level type. |
| 45 | MediaStreamTrack.MediaType kind; |
| 46 | // Clock rate in Hertz. |
| 47 | public Integer clockRate; |
| 48 | // The number of audio channels used. Set to null for video codecs. |
| 49 | public Integer numChannels; |
Taylor Brandstetter | 0cd086b | 2016-04-20 16:23:10 -0700 | [diff] [blame] | 50 | } |
| 51 | |
Magnus Jedvert | 6062f37 | 2017-11-16 16:53:12 +0100 | [diff] [blame] | 52 | public final List<Encoding> encodings = new ArrayList<>(); |
deadbeef | e702b30 | 2017-02-04 12:09:01 -0800 | [diff] [blame] | 53 | // Codec parameters can't currently be changed between getParameters and |
| 54 | // setParameters. Though in the future it will be possible to reorder them or |
| 55 | // remove them. |
Magnus Jedvert | 6062f37 | 2017-11-16 16:53:12 +0100 | [diff] [blame] | 56 | public final List<Codec> codecs = new ArrayList<>(); |
skvlad | 303b3c2 | 2016-03-24 19:36:46 -0700 | [diff] [blame] | 57 | } |