blob: fde2b35502dec58a92adbcf6cde2a429b55a6dbe [file] [log] [blame]
skvlad303b3c22016-03-24 19:36:46 -07001/*
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
11package org.webrtc;
12
skvlad303b3c22016-03-24 19:36:46 -070013import java.util.LinkedList;
14
15/**
16 * The parameters for an {@code RtpSender}, as defined in
17 * http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface.
deadbeefe702b302017-02-04 12:09:01 -080018 *
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".
skvlad303b3c22016-03-24 19:36:46 -070023 */
24public class RtpParameters {
Taylor Brandstetterf8711c02016-03-29 17:21:29 -070025 public static class Encoding {
deadbeefe702b302017-02-04 12:09:01 -080026 // Set to true to cause this encoding to be sent, and false for it not to
27 // be sent.
Taylor Brandstetterf8711c02016-03-29 17:21:29 -070028 public boolean active = true;
deadbeefe702b302017-02-04 12:09:01 -080029 // 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 Brandstetterf8711c02016-03-29 17:21:29 -070032 public Integer maxBitrateBps;
deadbeefe702b302017-02-04 12:09:01 -080033 // SSRC to be used by this encoding.
34 // Can't be changed between getParameters/setParameters.
deadbeef8014c752017-01-06 16:53:00 -080035 public Long ssrc;
Taylor Brandstetterf8711c02016-03-29 17:21:29 -070036 }
skvlad303b3c22016-03-24 19:36:46 -070037
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070038 public static class Codec {
deadbeefe702b302017-02-04 12:09:01 -080039 // 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 Brandstetter0cd086b2016-04-20 16:23:10 -070049 }
50
skvlad303b3c22016-03-24 19:36:46 -070051 public final LinkedList<Encoding> encodings;
deadbeefe702b302017-02-04 12:09:01 -080052 // 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 Brandstetter0cd086b2016-04-20 16:23:10 -070055 public final LinkedList<Codec> codecs;
skvlad303b3c22016-03-24 19:36:46 -070056
57 public RtpParameters() {
58 encodings = new LinkedList<Encoding>();
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070059 codecs = new LinkedList<Codec>();
skvlad303b3c22016-03-24 19:36:46 -070060 }
61}