Allow first frame after fallback in VideoEncoderSoftwareFallbackWrapper

Current checks do not allow first frame after fallback to be sent for encode
because of the native checks. However, the rest of the frames are sent and
encoded correctly.
Fallback encoder, although SupportsNativeHandle() is false, can call ToI420()
which converts from native handles, and accordingly can return error or
success. This higher level check seems unnecessary.

Bug: webrtc:8021
Change-Id: I69780cc25eb1e06317ff213e9b80288064e9f1e3
Reviewed-on: https://webrtc-review.googlesource.com/40441
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Commit-Queue: Emircan Uysaler <emircan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21685}
This commit is contained in:
Emircan Uysaler 2018-01-17 13:45:20 -08:00 committed by Commit Bot
parent 215fda713e
commit 5ed4465aa9

View File

@ -182,13 +182,6 @@ int32_t VideoEncoderSoftwareFallbackWrapper::Encode(
// If requested, try a software fallback.
bool fallback_requested = (ret == WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE);
if (fallback_requested && InitFallbackEncoder()) {
if (frame.video_frame_buffer()->type() == VideoFrameBuffer::Type::kNative &&
!fallback_encoder_->SupportsNativeHandle()) {
RTC_LOG(LS_WARNING) << "Fallback encoder doesn't support native frames, "
<< "dropping one frame.";
return WEBRTC_VIDEO_CODEC_ERROR;
}
// Start using the fallback with this frame.
return fallback_encoder_->Encode(frame, codec_specific_info, frame_types);
}