Change SPS/PPS id update strategy to SPS_LISTING.

INCREASING_ID, which is the default mode, triggers HW reset in chromium
decoder wrapper. Set eSpsPpsIdStrategy to SPS_LISTING to prevent that.

Note that WebRTC always resets the encoder on resolution change. This
makes all strategies except INCREASING_ID essentially equivalent to
CONSTANT_ID.

Bug: chromium:1111273
Change-Id: I37405c97b3390f812d1dcaa111694b3b1d638035
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190440
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32505}
This commit is contained in:
Sergey Silkin
2020-10-27 09:08:02 +01:00
committed by Commit Bot
parent d546186b89
commit 18e6edd57a

View File

@ -545,6 +545,12 @@ SEncParamExt H264EncoderImpl::CreateEncoderParams(size_t i) const {
// |uiIntraPeriod| - multiple of GOP size
// |keyFrameInterval| - number of frames
encoder_params.uiIntraPeriod = configurations_[i].key_frame_interval;
// Reuse SPS id if possible. This helps to avoid reset of chromium HW decoder
// on each key-frame.
// Note that WebRTC resets encoder on resolution change which makes all
// EParameterSetStrategy modes except INCREASING_ID (default) essentially
// equivalent to CONSTANT_ID.
encoder_params.eSpsPpsIdStrategy = SPS_LISTING;
encoder_params.uiMaxNalSize = 0;
// Threading model: use auto.
// 0: auto (dynamic imp. internal encoder)