[LibvpxVp8Encoder] Don't DCHECK crash if I420 is not equal to I420A.

In CL https://webrtc-review.googlesource.com/c/src/+/216323 we fixed
the issue where I420 and I420A not being equal would result in dropping
frames in release builds.

But we forgot to update the corresponding DCHECK, meaning the I420 not
being the same as I420A issue still causes crashes on debug builds.
(I must have been running a release build not to catch this before?)

This CL replaces the DCHECK_EQ with an RTC_NOTREACHED inside the
IsCompatibleVideoFrameBufferType check.

Because this only affects debug builds, this CL does not need to be
backmerged anywhere.

Bug: chromium:1203206
Change-Id: I101823e8bca293e94d0f7ce507fe78cedff3ea1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/219281
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34048}
This commit is contained in:
Henrik Boström
2021-05-18 11:56:52 +02:00
committed by WebRTC LUCI CQ
parent 91a892f8ed
commit 38f1d4bf8a

View File

@ -1388,8 +1388,6 @@ LibvpxVp8Encoder::PrepareBuffers(rtc::scoped_refptr<VideoFrameBuffer> buffer) {
}
scaled_buffer = mapped_scaled_buffer;
}
RTC_DCHECK_EQ(scaled_buffer->type(), mapped_buffer->type())
<< "Scaled frames must have the same type as the mapped frame.";
if (!IsCompatibleVideoFrameBufferType(scaled_buffer->type(),
mapped_buffer->type())) {
RTC_LOG(LS_ERROR) << "When scaling "
@ -1399,6 +1397,10 @@ LibvpxVp8Encoder::PrepareBuffers(rtc::scoped_refptr<VideoFrameBuffer> buffer) {
<< " instead of "
<< VideoFrameBufferTypeToString(mapped_buffer->type())
<< ". Can't encode frame.";
RTC_NOTREACHED() << "Scaled buffer type "
<< VideoFrameBufferTypeToString(scaled_buffer->type())
<< " is not compatible with mapped buffer type "
<< VideoFrameBufferTypeToString(mapped_buffer->type());
return {};
}
SetRawImagePlanes(&raw_images_[i], scaled_buffer);