Commit 770b98c8 authored by Hirokazu Honda's avatar Hirokazu Honda Committed by Commit Bot

RtcVideoDecoderAdapter: Query frame size in every spatial frame layer all the time

RtcVideoDecoderAdapter gets frame sizes of each spatial frame layer so that
a hardware decoder decodes VP9 SVC correctly. It queries the frame size from a
small-index spatial layer, and don't query if the spatial layer doesn't have the
size. However, an index spatial layer has the frame size even though smaller
spatial layers than the index don't have.

RtcVideoDecoderAdapter must continu querying until the maximum spatial layers.

Bug: b:141978593, 935411
Test: VP9 stream in screen share scenario is decoded correctly on atlas
Change-Id: I24ec652368b435983e9a529af95b16548a45472c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1849613Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704183}
parent 40780b96
......@@ -265,10 +265,11 @@ int32_t RTCVideoDecoderAdapter::Decode(const webrtc::EncodedImage& input_image,
}
std::vector<uint32_t> spatial_layer_frame_size;
for (int i = 0;; i++) {
size_t max_sl_index = input_image.SpatialIndex().value_or(0);
for (size_t i = 0; i <= max_sl_index; i++) {
auto frame_size = input_image.SpatialLayerFrameSize(i);
if (!frame_size)
break;
continue;
spatial_layer_frame_size.push_back(*frame_size);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment