Title: [275880] trunk
Revision
275880
Author
commit-qu...@webkit.org
Date
2021-04-13 04:38:25 -0700 (Tue, 13 Apr 2021)

Log Message

[GTK][WPE] Avif decoder build broken
https://bugs.webkit.org/show_bug.cgi?id=224232

Patch by Philippe Normand <pnorm...@igalia.com> on 2021-04-13
Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsGTK.cmake: Require 0.9.0 due to avifIO usage in the decoder.

Source/WebCore:

libavif 0.9.0 introduces an API break. avifDecoderParse() no
longer takes the image data as input. Instead, an avifIO object
needs to be associated with an avifDecoder and the avifDecoder
calls the read() method of the avifIO object to read image data
incrementally.

* platform/image-decoders/avif/AVIFImageReader.cpp:
(WebCore::AVIFImageReader::parseHeader):
(WebCore::AVIFImageReader::decodeFrame):

Modified Paths

Diff

Modified: trunk/ChangeLog (275879 => 275880)


--- trunk/ChangeLog	2021-04-13 11:11:40 UTC (rev 275879)
+++ trunk/ChangeLog	2021-04-13 11:38:25 UTC (rev 275880)
@@ -1,3 +1,12 @@
+2021-04-13  Philippe Normand  <pnorm...@igalia.com>
+
+        [GTK][WPE] Avif decoder build broken
+        https://bugs.webkit.org/show_bug.cgi?id=224232
+
+        Reviewed by Carlos Garcia Campos.
+
+        * Source/cmake/OptionsGTK.cmake: Require 0.9.0 due to avifIO usage in the decoder.
+
 2021-04-09  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK][WPE] Bump libsoup3 version to 2.99.3

Modified: trunk/Source/WebCore/ChangeLog (275879 => 275880)


--- trunk/Source/WebCore/ChangeLog	2021-04-13 11:11:40 UTC (rev 275879)
+++ trunk/Source/WebCore/ChangeLog	2021-04-13 11:38:25 UTC (rev 275880)
@@ -1,5 +1,22 @@
 2021-04-13  Philippe Normand  <pnorm...@igalia.com>
 
+        [GTK][WPE] Avif decoder build broken
+        https://bugs.webkit.org/show_bug.cgi?id=224232
+
+        Reviewed by Carlos Garcia Campos.
+
+        libavif 0.9.0 introduces an API break. avifDecoderParse() no
+        longer takes the image data as input. Instead, an avifIO object
+        needs to be associated with an avifDecoder and the avifDecoder
+        calls the read() method of the avifIO object to read image data
+        incrementally.
+
+        * platform/image-decoders/avif/AVIFImageReader.cpp:
+        (WebCore::AVIFImageReader::parseHeader):
+        (WebCore::AVIFImageReader::decodeFrame):
+
+2021-04-13  Philippe Normand  <pnorm...@igalia.com>
+
         [GStreamer] CaptureDevice monitoring is not implemented
         https://bugs.webkit.org/show_bug.cgi?id=222889
 

Modified: trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp (275879 => 275880)


--- trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp	2021-04-13 11:11:40 UTC (rev 275879)
+++ trunk/Source/WebCore/platform/image-decoders/avif/AVIFImageReader.cpp	2021-04-13 11:38:25 UTC (rev 275880)
@@ -40,16 +40,12 @@
 
 void AVIFImageReader::parseHeader(const SharedBuffer::DataSegment& data, bool allDataReceived)
 {
-    avifROData avifData;
-    avifData.data = "" uint8_t*>(data.data());
-    avifData.size = data.size();
-
-    if (!avifPeekCompatibleFileType(&avifData)) {
+    if (avifDecoderSetIOMemory(m_avifDecoder.get(), reinterpret_cast<const uint8_t*>(data.data()), data.size()) != AVIF_RESULT_OK) {
         m_decoder->setFailed();
         return;
     }
 
-    if (avifDecoderParse(m_avifDecoder.get(), &avifData) != AVIF_RESULT_OK
+    if (avifDecoderParse(m_avifDecoder.get()) != AVIF_RESULT_OK
         || avifDecoderNextImage(m_avifDecoder.get()) != AVIF_RESULT_OK) {
         m_decoder->setFailed();
         return;
@@ -68,11 +64,12 @@
         return;
 
     if (!m_dataParsed) {
-        avifROData avifData;
-        avifData.data = "" uint8_t*>(data.data());
-        avifData.size = data.size();
+        if (avifDecoderSetIOMemory(m_avifDecoder.get(), reinterpret_cast<const uint8_t*>(data.data()), data.size()) != AVIF_RESULT_OK) {
+            m_decoder->setFailed();
+            return;
+        }
 
-        if (avifDecoderParse(m_avifDecoder.get(), &avifData) != AVIF_RESULT_OK) {
+        if (avifDecoderParse(m_avifDecoder.get()) != AVIF_RESULT_OK) {
             m_decoder->setFailed();
             return;
         }

Modified: trunk/Source/cmake/OptionsGTK.cmake (275879 => 275880)


--- trunk/Source/cmake/OptionsGTK.cmake	2021-04-13 11:11:40 UTC (rev 275879)
+++ trunk/Source/cmake/OptionsGTK.cmake	2021-04-13 11:38:25 UTC (rev 275880)
@@ -435,9 +435,9 @@
 endif ()
 
 if (USE_AVIF)
-    find_package(AVIF 0.7.3)
+    find_package(AVIF 0.9.0)
     if (NOT AVIF_FOUND)
-        message(FATAL_ERROR "libavif 0.7.3 is required for USE_AVIF.")
+        message(FATAL_ERROR "libavif 0.9.0 is required for USE_AVIF.")
     endif ()
 endif ()
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to