Fix hw decoder rendering delay after frame resize

Need to clear frameInfos in case of reinit, as outdated items produce
incorrect decode time. This leds to render timestamps 'in future'
(VCMTiming::RenderTime) and rendering delays (low fps).

Bug: None
Change-Id: Iee569ff74fe3e0ff3610877472756cbbd59aba7a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374680
Auto-Submit: Anna Lemehova <anna.lemehova@gmail.com>
Reviewed-by: Zoé Lepaul <xalep@webrtc.org>
Commit-Queue: Zoé Lepaul <xalep@webrtc.org>
Reviewed-by: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43772}
This commit is contained in:
Anna Lemehova 2025-01-17 19:28:53 +02:00 committed by WebRTC LUCI CQ
parent fa73a2ed79
commit d48113627a
2 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ Andrey Efremov <yoklmnprst@ya.ru>
Andrew Johnson <ajohnson@draster.com> Andrew Johnson <ajohnson@draster.com>
Andy Tamilo <andytamilo@gmail.com> Andy Tamilo <andytamilo@gmail.com>
Anil Kumar <an1kumar@gmail.com> Anil Kumar <an1kumar@gmail.com>
Anna Lemehova <Anna.Lemehova@gmail.com>
Anton Barkov <anton.barkov@macpaw.com> Anton Barkov <anton.barkov@macpaw.com>
Ben Strong <bstrong@gmail.com> Ben Strong <bstrong@gmail.com>
Berthold Herrmann <bertholdherrmann08@googlemail.com> Berthold Herrmann <bertholdherrmann08@googlemail.com>

View File

@ -303,7 +303,6 @@ class AndroidVideoDecoder implements VideoDecoder, VideoSink {
renderedTextureMetadata = null; renderedTextureMetadata = null;
} }
callback = null; callback = null;
frameInfos.clear();
return status; return status;
} }
@ -331,6 +330,7 @@ class AndroidVideoDecoder implements VideoDecoder, VideoSink {
} finally { } finally {
codec = null; codec = null;
outputThread = null; outputThread = null;
frameInfos.clear();
} }
return VideoCodecStatus.OK; return VideoCodecStatus.OK;
} }