Force keyframe for Qualcomm HW VP8 Encoder on Android L as well, reduce forced keyframe interval on Android M.
Color distortion also happens on Android L. Tested on the Mi 4. BUG=webrtc:7681 Review-Url: https://codereview.webrtc.org/2894643003 Cr-Commit-Position: refs/heads/master@{#18423}
This commit is contained in:
@ -54,7 +54,8 @@ public class MediaCodecVideoEncoder {
|
||||
// Amount of correction steps to reach correction maximum scale.
|
||||
private static final int BITRATE_CORRECTION_STEPS = 20;
|
||||
// Forced key frame interval - used to reduce color distortions on Qualcomm platform.
|
||||
private static final long QCOM_VP8_KEY_FRAME_INTERVAL_ANDROID_M_MS = 25000;
|
||||
private static final long QCOM_VP8_KEY_FRAME_INTERVAL_ANDROID_L_MS = 15000;
|
||||
private static final long QCOM_VP8_KEY_FRAME_INTERVAL_ANDROID_M_MS = 20000;
|
||||
private static final long QCOM_VP8_KEY_FRAME_INTERVAL_ANDROID_N_MS = 15000;
|
||||
|
||||
// Active running encoder instance. Set in initEncode() (called from native code)
|
||||
@ -425,7 +426,10 @@ public class MediaCodecVideoEncoder {
|
||||
lastKeyFrameMs = -1;
|
||||
if (type == VideoCodecType.VIDEO_CODEC_VP8
|
||||
&& properties.codecName.startsWith(qcomVp8HwProperties.codecPrefix)) {
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M) {
|
||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP
|
||||
|| Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
forcedKeyFrameMs = QCOM_VP8_KEY_FRAME_INTERVAL_ANDROID_L_MS;
|
||||
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M) {
|
||||
forcedKeyFrameMs = QCOM_VP8_KEY_FRAME_INTERVAL_ANDROID_M_MS;
|
||||
} else if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
|
||||
forcedKeyFrameMs = QCOM_VP8_KEY_FRAME_INTERVAL_ANDROID_N_MS;
|
||||
|
||||
Reference in New Issue
Block a user