Don't crash in SingleNalu packetization for h264 if no space in packet

Also, pass correct max payload data size to encoders: now accounting for
rtp headers.

Bug: chromium:819259
Change-Id: I586924e9246218fab6072e05eca894925cfe556e
Reviewed-on: https://webrtc-review.googlesource.com/61425
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22460}
This commit is contained in:
Ilya Nikolaevskiy
2018-03-15 15:46:17 +01:00
committed by Commit Bot
parent 4425b055f9
commit 1d037ae704
8 changed files with 89 additions and 24 deletions

View File

@ -465,6 +465,8 @@ SEncParamExt H264EncoderImpl::CreateEncoderParams() const {
SM_SIZELIMITED_SLICE;
encoder_params.sSpatialLayers[0].sSliceArgument.uiSliceSizeConstraint =
static_cast<unsigned int>(max_payload_size_);
RTC_LOG(INFO) << "Encoder is configured with NALU constraint: "
<< max_payload_size_ << " bytes";
break;
case H264PacketizationMode::NonInterleaved:
// When uiSliceMode = SM_FIXEDSLCNUM_SLICE, uiSliceNum = 0 means auto