[iOS] Reset VT session when H264 encoder malfunction error happen

Bug: webrtc:11268
Change-Id: I764eb37a386075838e981c6d5b820e25d77f1a80
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165395
Commit-Queue: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30209}
This commit is contained in:
Yura Yaroshevich
2020-01-10 12:25:24 +03:00
committed by Commit Bot
parent 6ddbe2c5b0
commit 4b07059139

View File

@ -501,6 +501,13 @@ NSUInteger GetMaxSampleRate(const webrtc::H264::ProfileLevelId &profile_level_id
RTC_LOG(LS_ERROR) << "Invalid compression session, resetting.";
[self resetCompressionSessionWithPixelFormat:[self pixelFormatOfFrame:frame]];
return WEBRTC_VIDEO_CODEC_NO_OUTPUT;
} else if (status == kVTVideoEncoderMalfunctionErr) {
// Sometimes the encoder malfunctions and needs to be restarted.
RTC_LOG(LS_ERROR)
<< "Encountered video encoder malfunction error. Resetting compression session.";
[self resetCompressionSessionWithPixelFormat:[self pixelFormatOfFrame:frame]];
return WEBRTC_VIDEO_CODEC_NO_OUTPUT;
} else if (status != noErr) {
RTC_LOG(LS_ERROR) << "Failed to encode frame with code: " << status;