Files
platform-external-webrtc/sdk/android/api/org/webrtc/RtpParameters.java
Max Morin 909338b027 Revert "Implement RtpParameters.transaction_id for PC RtpSenderInterface"
This reverts commit 5faf36ef3c582350fba5ef97a3549e440d81a283.

Reason for revert: fast/peerconnection/RTCRtpSender-setParameters.html
 failing in webrtc roll, probably this CL? https://chromium-review.googlesource.com/c/chromium/src/+/1045889.

Original change's description:
> Implement RtpParameters.transaction_id for PC RtpSenderInterface
> 
> The transaction_id field should be refreshed for every getParameters()
> call and checked at each setParameters() call.
> This also checks that getParameters() was ever called to return a proper
> error code.
> 
> Bug: webrtc:7580
> Change-Id: I6c6fe289542e486fc422cdc61577982b0529d4c1
> Reviewed-on: https://webrtc-review.googlesource.com/70820
> Commit-Queue: Florent Castelli <orphis@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
> Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
> Reviewed-by: Steve Anton <steveanton@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23120}

TBR=steveanton@webrtc.org,deadbeef@webrtc.org,sakal@webrtc.org,kthelgason@webrtc.org,orphis@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:7580
Change-Id: I86da108227f8fc8d235bb2e9559377c800595b8c
Reviewed-on: https://webrtc-review.googlesource.com/74740
Reviewed-by: Max Morin <maxmorin@webrtc.org>
Commit-Queue: Max Morin <maxmorin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23134}
2018-05-07 08:02:34 +00:00

139 lines
3.8 KiB
Java

/*
* Copyright 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
package org.webrtc;
import javax.annotation.Nullable;
import java.util.List;
import java.util.ArrayList;
import org.webrtc.MediaStreamTrack;
/**
* 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;
// If non-null, this represents the Transport Independent Application
// Specific maximum bandwidth defined in RFC3890. If null, there is no
// maximum bitrate.
@Nullable public Integer maxBitrateBps;
// SSRC to be used by this encoding.
// Can't be changed between getParameters/setParameters.
public Long ssrc;
@CalledByNative("Encoding")
Encoding(boolean active, Integer maxBitrateBps, Long ssrc) {
this.active = active;
this.maxBitrateBps = maxBitrateBps;
this.ssrc = ssrc;
}
@CalledByNative("Encoding")
boolean getActive() {
return active;
}
@Nullable
@CalledByNative("Encoding")
Integer getMaxBitrateBps() {
return maxBitrateBps;
}
@CalledByNative("Encoding")
Long getSsrc() {
return ssrc;
}
}
public static class Codec {
// 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;
@CalledByNative("Codec")
Codec(int payloadType, String name, MediaStreamTrack.MediaType kind, Integer clockRate,
Integer numChannels) {
this.payloadType = payloadType;
this.name = name;
this.kind = kind;
this.clockRate = clockRate;
this.numChannels = numChannels;
}
@CalledByNative("Codec")
int getPayloadType() {
return payloadType;
}
@CalledByNative("Codec")
String getName() {
return name;
}
@CalledByNative("Codec")
MediaStreamTrack.MediaType getKind() {
return kind;
}
@CalledByNative("Codec")
Integer getClockRate() {
return clockRate;
}
@CalledByNative("Codec")
Integer getNumChannels() {
return numChannels;
}
}
public final List<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 List<Codec> codecs;
public RtpParameters() {
this.encodings = new ArrayList<>();
this.codecs = new ArrayList<>();
}
@CalledByNative
RtpParameters(List<Encoding> encodings, List<Codec> codecs) {
this.encodings = encodings;
this.codecs = codecs;
}
@CalledByNative
List<Encoding> getEncodings() {
return encodings;
}
@CalledByNative
List<Codec> getCodecs() {
return codecs;
}
}