Add VideoEncoder::Settings::numberOfSimulcastStreams.

This helps Java encoders take action if simulcast is enabled or not.

Bug: webrtc:9646
Change-Id: Iad967e237bdc790ff2af111bdec1319f3e661ff7
Reviewed-on: https://webrtc-review.googlesource.com/95651
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Rasmus Brandt <brandtr@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24430}
This commit is contained in:
Rasmus Brandt
2018-08-23 13:52:45 +02:00
committed by Commit Bot
parent 9bb55fc09b
commit 85f20cbe4a
2 changed files with 12 additions and 2 deletions

View File

@ -26,18 +26,26 @@ public interface VideoEncoder {
public final int height;
public final int startBitrate; // Kilobits per second.
public final int maxFramerate;
public final int numberOfSimulcastStreams;
public final boolean automaticResizeOn;
@CalledByNative("Settings")
public Settings(int numberOfCores, int width, int height, int startBitrate, int maxFramerate,
boolean automaticResizeOn) {
int numberOfSimulcastStreams, boolean automaticResizeOn) {
this.numberOfCores = numberOfCores;
this.width = width;
this.height = height;
this.startBitrate = startBitrate;
this.maxFramerate = maxFramerate;
this.numberOfSimulcastStreams = numberOfSimulcastStreams;
this.automaticResizeOn = automaticResizeOn;
}
// TODO(http://bugs.webrtc.org/9646): Remove when downstream clients have been updated.
public Settings(int numberOfCores, int width, int height, int startBitrate, int maxFramerate,
boolean automaticResizeOn) {
this(numberOfCores, width, height, startBitrate, maxFramerate, 1, automaticResizeOn);
}
}
/** Additional info for encoding. */

View File

@ -70,7 +70,9 @@ int32_t VideoEncoderWrapper::InitEncodeInternal(JNIEnv* jni) {
ScopedJavaLocalRef<jobject> settings = Java_Settings_Constructor(
jni, number_of_cores_, codec_settings_.width, codec_settings_.height,
static_cast<int>(codec_settings_.startBitrate),
static_cast<int>(codec_settings_.maxFramerate), automatic_resize_on);
static_cast<int>(codec_settings_.maxFramerate),
static_cast<int>(codec_settings_.numberOfSimulcastStreams),
automatic_resize_on);
ScopedJavaLocalRef<jobject> callback =
Java_VideoEncoderWrapper_createEncoderCallback(jni,