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