Commit 12e38004 authored by Nathan Froyd's avatar Nathan Froyd
Browse files

Bug 1634994 - fix --disable-av1; r=tnikkel, a=RyanVM

Some files are incorrectly built/included, as well as some code, when
`--disable-av1` is passed.  Let's fix that.

Differential Revision: https://phabricator.services.mozilla.com/D73744
parent c428c8c0
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -20,7 +20,9 @@
#include "nsICODecoder.h"
#include "nsIconDecoder.h"
#include "nsWebPDecoder.h"
#ifdef MOZ_AV1
#include "nsAVIFDecoder.h"
#endif

namespace mozilla {

@@ -79,10 +81,13 @@ DecoderType DecoderFactory::GetDecoderType(const char* aMimeType) {
    type = DecoderType::WEBP;

    // AVIF
  } else if (!strcmp(aMimeType, IMAGE_AVIF) &&
  }
#ifdef MOZ_AV1
  else if (!strcmp(aMimeType, IMAGE_AVIF) &&
             StaticPrefs::image_avif_enabled()) {
    type = DecoderType::AVIF;
  }
#endif

  return type;
}
@@ -121,9 +126,11 @@ already_AddRefed<Decoder> DecoderFactory::GetDecoder(DecoderType aType,
    case DecoderType::WEBP:
      decoder = new nsWebPDecoder(aImage);
      break;
#ifdef MOZ_AV1
    case DecoderType::AVIF:
      decoder = new nsAVIFDecoder(aImage);
      break;
#endif
    default:
      MOZ_ASSERT_UNREACHABLE("Unknown decoder type");
  }
+5 −1
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ elif toolkit == 'android':
UNIFIED_SOURCES += [
    'EXIF.cpp',
    'iccjpeg.c',
    'nsAVIFDecoder.cpp',
    'nsBMPDecoder.cpp',
    'nsGIFDecoder2.cpp',
    'nsICODecoder.cpp',
@@ -32,6 +31,11 @@ UNIFIED_SOURCES += [
    'nsWebPDecoder.cpp',
]

if CONFIG['MOZ_AV1']:
    UNIFIED_SOURCES += [
        'nsAVIFDecoder.cpp',
    ]

include('/ipc/chromium/chromium-config.mozbuild')

LOCAL_INCLUDES += [