Adding C++ versions of currently spec'd "RtpParameters" structs.
These structs will be used for ORTC objects (and their WebRTC equivalents). This CL also introduces some minor changes to the existing implemented structs: - max_bitrate_bps uses rtc::Optional instead of "-1 means unset" - "mime_type" turned into "name"/"kind" (which can be used to form the MIME type string, if needed). - clock_rate and channels changed to rtc::Optional, since they will need to be for RtpSender.send(). - Renamed "channels" to "num_channels" (the ORTC name, which I prefer). BUG=webrtc:7013, webrtc:7112 Review-Url: https://codereview.webrtc.org/2651883010 Cr-Commit-Position: refs/heads/master@{#16437}
This commit is contained in:
@ -15,23 +15,43 @@ import java.util.LinkedList;
|
||||
/**
|
||||
* The parameters for an {@code RtpSender}, as defined in
|
||||
* http://w3c.github.io/webrtc-pc/#rtcrtpsender-interface.
|
||||
*
|
||||
* Note: These structures use nullable Integer/etc. types because in the
|
||||
* future, they may be used to construct ORTC RtpSender/RtpReceivers, in
|
||||
* which case "null" will be used to represent "choose the implementation
|
||||
* default value".
|
||||
*/
|
||||
public class RtpParameters {
|
||||
public static class Encoding {
|
||||
// Set to true to cause this encoding to be sent, and false for it not to
|
||||
// be sent.
|
||||
public boolean active = true;
|
||||
// A null value means "no maximum bitrate".
|
||||
// If non-null, this represents the Transport Independent Application
|
||||
// Specific maximum bandwidth defined in RFC3890. If null, there is no
|
||||
// maximum bitrate.
|
||||
public Integer maxBitrateBps;
|
||||
// SSRC to be used by this encoding.
|
||||
// Can't be changed between getParameters/setParameters.
|
||||
public Long ssrc;
|
||||
}
|
||||
|
||||
public static class Codec {
|
||||
int payloadType;
|
||||
String mimeType;
|
||||
int clockRate;
|
||||
int channels = 1;
|
||||
// Payload type used to identify this codec in RTP packets.
|
||||
public int payloadType;
|
||||
// Name used to identify the codec. Equivalent to MIME subtype.
|
||||
public String name;
|
||||
// The media type of this codec. Equivalent to MIME top-level type.
|
||||
MediaStreamTrack.MediaType kind;
|
||||
// Clock rate in Hertz.
|
||||
public Integer clockRate;
|
||||
// The number of audio channels used. Set to null for video codecs.
|
||||
public Integer numChannels;
|
||||
}
|
||||
|
||||
public final LinkedList<Encoding> encodings;
|
||||
// Codec parameters can't currently be changed between getParameters and
|
||||
// setParameters. Though in the future it will be possible to reorder them or
|
||||
// remove them.
|
||||
public final LinkedList<Codec> codecs;
|
||||
|
||||
public RtpParameters() {
|
||||
|
||||
Reference in New Issue
Block a user