blob: f1cca9d66026d683893404ede9e23200082c8020 [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
Magnus Jedvert6062f372017-11-16 16:53:12 +010013import java.util.List;
14import java.util.ArrayList;
skvlad303b3c22016-03-24 19:36:46 -070015
16/**
17 * The parameters for an {@code RtpSender}, as defined in
18 * http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface.
deadbeefe702b302017-02-04 12:09:01 -080019 *
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".
skvlad303b3c22016-03-24 19:36:46 -070024 */
25public class RtpParameters {
Taylor Brandstetterf8711c02016-03-29 17:21:29 -070026 public static class Encoding {
deadbeefe702b302017-02-04 12:09:01 -080027 // Set to true to cause this encoding to be sent, and false for it not to
28 // be sent.
Taylor Brandstetterf8711c02016-03-29 17:21:29 -070029 public boolean active = true;
deadbeefe702b302017-02-04 12:09:01 -080030 // 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 Brandstetterf8711c02016-03-29 17:21:29 -070033 public Integer maxBitrateBps;
deadbeefe702b302017-02-04 12:09:01 -080034 // SSRC to be used by this encoding.
35 // Can't be changed between getParameters/setParameters.
deadbeef8014c752017-01-06 16:53:00 -080036 public Long ssrc;
Taylor Brandstetterf8711c02016-03-29 17:21:29 -070037 }
skvlad303b3c22016-03-24 19:36:46 -070038
Taylor Brandstetter0cd086b2016-04-20 16:23:10 -070039 public static class Codec {
deadbeefe702b302017-02-04 12:09:01 -080040 // 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 Brandstetter0cd086b2016-04-20 16:23:10 -070050 }
51
Magnus Jedvert6062f372017-11-16 16:53:12 +010052 public final List<Encoding> encodings = new ArrayList<>();
deadbeefe702b302017-02-04 12:09:01 -080053 // 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 Jedvert6062f372017-11-16 16:53:12 +010056 public final List<Codec> codecs = new ArrayList<>();
skvlad303b3c22016-03-24 19:36:46 -070057}