Add min_bitrate_bps to RtpEncodingParameters.
This CL adds the field but does not implement any functionality using it. Bug: webrtc:9341 Change-Id: I533fc7f8bc1e40207aa16b834e0d7daa60709614 Reviewed-on: https://webrtc-review.googlesource.com/78741 Commit-Queue: Åsa Persson <asapersson@webrtc.org> Reviewed-by: Magnus Jedvert <magjed@webrtc.org> Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23466}
This commit is contained in:
@ -417,6 +417,9 @@ struct RtpEncodingParameters {
|
||||
// fixed.
|
||||
rtc::Optional<int> max_bitrate_bps;
|
||||
|
||||
// TODO(asapersson): Not implemented.
|
||||
rtc::Optional<int> min_bitrate_bps;
|
||||
|
||||
// TODO(deadbeef): Not implemented.
|
||||
rtc::Optional<int> max_framerate;
|
||||
|
||||
|
||||
@ -34,14 +34,17 @@ public class RtpParameters {
|
||||
// Specific maximum bandwidth defined in RFC3890. If null, there is no
|
||||
// maximum bitrate.
|
||||
@Nullable public Integer maxBitrateBps;
|
||||
// Not implemented.
|
||||
@Nullable public Integer minBitrateBps;
|
||||
// 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) {
|
||||
Encoding(boolean active, Integer maxBitrateBps, Integer minBitrateBps, Long ssrc) {
|
||||
this.active = active;
|
||||
this.maxBitrateBps = maxBitrateBps;
|
||||
this.minBitrateBps = minBitrateBps;
|
||||
this.ssrc = ssrc;
|
||||
}
|
||||
|
||||
@ -56,6 +59,12 @@ public class RtpParameters {
|
||||
return maxBitrateBps;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@CalledByNative("Encoding")
|
||||
Integer getMinBitrateBps() {
|
||||
return minBitrateBps;
|
||||
}
|
||||
|
||||
@CalledByNative("Encoding")
|
||||
Long getSsrc() {
|
||||
return ssrc;
|
||||
|
||||
@ -844,8 +844,10 @@ public class PeerConnectionTest {
|
||||
assertNotNull(rtpParameters);
|
||||
assertEquals(1, rtpParameters.encodings.size());
|
||||
assertNull(rtpParameters.encodings.get(0).maxBitrateBps);
|
||||
assertNull(rtpParameters.encodings.get(0).minBitrateBps);
|
||||
|
||||
rtpParameters.encodings.get(0).maxBitrateBps = 300000;
|
||||
rtpParameters.encodings.get(0).minBitrateBps = 100000;
|
||||
assertTrue(videoSender.setParameters(rtpParameters));
|
||||
|
||||
// Create a DTMF sender.
|
||||
@ -857,6 +859,7 @@ public class PeerConnectionTest {
|
||||
// Verify that we can read back the updated value.
|
||||
rtpParameters = videoSender.getParameters();
|
||||
assertEquals(300000, (int) rtpParameters.encodings.get(0).maxBitrateBps);
|
||||
assertEquals(100000, (int) rtpParameters.encodings.get(0).minBitrateBps);
|
||||
|
||||
// Test send & receive UTF-8 text.
|
||||
answeringExpectations.expectMessage(
|
||||
|
||||
@ -25,6 +25,7 @@ ScopedJavaLocalRef<jobject> NativeToJavaRtpEncodingParameter(
|
||||
const RtpEncodingParameters& encoding) {
|
||||
return Java_Encoding_Constructor(
|
||||
env, encoding.active, NativeToJavaInteger(env, encoding.max_bitrate_bps),
|
||||
NativeToJavaInteger(env, encoding.min_bitrate_bps),
|
||||
encoding.ssrc ? NativeToJavaLong(env, *encoding.ssrc) : nullptr);
|
||||
}
|
||||
|
||||
@ -53,9 +54,12 @@ RtpEncodingParameters JavaToNativeRtpEncodingParameters(
|
||||
const JavaRef<jobject>& j_encoding_parameters) {
|
||||
RtpEncodingParameters encoding;
|
||||
encoding.active = Java_Encoding_getActive(jni, j_encoding_parameters);
|
||||
ScopedJavaLocalRef<jobject> j_bitrate =
|
||||
ScopedJavaLocalRef<jobject> j_max_bitrate =
|
||||
Java_Encoding_getMaxBitrateBps(jni, j_encoding_parameters);
|
||||
encoding.max_bitrate_bps = JavaToNativeOptionalInt(jni, j_bitrate);
|
||||
encoding.max_bitrate_bps = JavaToNativeOptionalInt(jni, j_max_bitrate);
|
||||
ScopedJavaLocalRef<jobject> j_min_bitrate =
|
||||
Java_Encoding_getMinBitrateBps(jni, j_encoding_parameters);
|
||||
encoding.min_bitrate_bps = JavaToNativeOptionalInt(jni, j_min_bitrate);
|
||||
ScopedJavaLocalRef<jobject> j_ssrc =
|
||||
Java_Encoding_getSsrc(jni, j_encoding_parameters);
|
||||
if (!IsNull(jni, j_ssrc))
|
||||
|
||||
Reference in New Issue
Block a user