Commit 8a926997 authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Commit Bot

Call buffer.SetDuration in InitializeNewFrame

This requires the new libavif function avifDecoderNthImageTiming, which
provides each frame's duration before the frames are decoded.

Bug: 960620
Change-Id: Id00c760e094b8663b1a8781201fdd4a6c88beddd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2149915
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759347}
parent 4928bd1f
...@@ -322,7 +322,7 @@ vars = { ...@@ -322,7 +322,7 @@ vars = {
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling libavif # the commit queue can handle CLs rolling libavif
# and whatever else without interference from each other. # and whatever else without interference from each other.
'libavif_revision': '78e3c9d2fbfa935638145d017dda6950cc559ad3', 'libavif_revision': '167e406f1e2b86f6699224b5c492dc9e862ab539',
# TODO(crbug.com/941824): The values below need to be kept in sync # TODO(crbug.com/941824): The values below need to be kept in sync
# between //DEPS and //buildtools/DEPS, so if you're updating one, # between //DEPS and //buildtools/DEPS, so if you're updating one,
......
...@@ -257,11 +257,10 @@ void AVIFImageDecoder::InitializeNewFrame(size_t index) { ...@@ -257,11 +257,10 @@ void AVIFImageDecoder::InitializeNewFrame(size_t index) {
buffer.SetOriginalFrameRect(IntRect(IntPoint(), Size())); buffer.SetOriginalFrameRect(IntRect(IntPoint(), Size()));
// TODO(wtc): libavif provides only the current frame's duration. But when avifImageTiming timing;
// this method is called, we have not decoded any frames. Change libavif to auto ret = avifDecoderNthImageTiming(decoder_.get(), index, &timing);
// provide all frames' durations after avifDecoderParse(). Then call DCHECK_EQ(ret, AVIF_RESULT_OK);
// buffer.SetDuration() here and remove the buffer.SetDuration() call in buffer.SetDuration(base::TimeDelta::FromSecondsD(timing.duration));
// Decode().
// TODO(wtc): Find out if disposal method and alpha blend source are specified // TODO(wtc): Find out if disposal method and alpha blend source are specified
// in the file format. // in the file format.
...@@ -334,8 +333,6 @@ void AVIFImageDecoder::Decode(size_t index) { ...@@ -334,8 +333,6 @@ void AVIFImageDecoder::Decode(size_t index) {
return; return;
} }
buffer.SetDuration(
base::TimeDelta::FromSecondsD(decoder_->imageTiming.duration));
buffer.SetPixelsChanged(true); buffer.SetPixelsChanged(true);
buffer.SetStatus(ImageFrame::kFrameComplete); buffer.SetStatus(ImageFrame::kFrameComplete);
} }
......
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