
Before this change encoder switch was triggered only if encode() returns WEBRTC_VIDEO_CODEC_ENCODER_FAILURE. Android HW encoder wrapper never return this error code. It returns WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE [1, 2] or WEBRTC_VIDEO_CODEC_ERROR [3]. Change value of WEBRTC_VIDEO_CODEC_TARGET_BITRATE_OVERSHOOT from -14 to 5 to avoid it to be interpreted as a critical error. [1] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=324 [2] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=335 [3] https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/video_encoder_wrapper.cc;drc=c05a1be5b49f5c03b6955b05bcbf47609e1b0381;l=331 Bug: b/243402636 Change-Id: Iaf0129f3f9d71c07bb06804fe1f92a1f84f6da26 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/274402 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#38060}
43 lines
1009 B
Java
43 lines
1009 B
Java
/*
|
|
* Copyright 2017 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;
|
|
|
|
/**
|
|
* Status codes reported by video encoding/decoding components. This should be kept in sync with
|
|
* video_error_codes.h.
|
|
*/
|
|
public enum VideoCodecStatus {
|
|
TARGET_BITRATE_OVERSHOOT(5),
|
|
REQUEST_SLI(2),
|
|
NO_OUTPUT(1),
|
|
OK(0),
|
|
ERROR(-1),
|
|
LEVEL_EXCEEDED(-2),
|
|
MEMORY(-3),
|
|
ERR_PARAMETER(-4),
|
|
ERR_SIZE(-5),
|
|
TIMEOUT(-6),
|
|
UNINITIALIZED(-7),
|
|
ERR_REQUEST_SLI(-12),
|
|
FALLBACK_SOFTWARE(-13);
|
|
|
|
private final int number;
|
|
|
|
private VideoCodecStatus(int number) {
|
|
this.number = number;
|
|
}
|
|
|
|
@CalledByNative
|
|
public int getNumber() {
|
|
return number;
|
|
}
|
|
}
|