// This file contains overrides for config.h, that can be platform-specific.

// CBS is required for VP9 and AV1 decoding.
#if !defined(MOZ_FFVPX_AUDIOONLY)
#undef CONFIG_CBS
#define CONFIG_CBS 1
#undef CONFIG_CBS_VP9
#define CONFIG_CBS_VP9 1
#endif

// libdav1d is the AV1 decoder; only built on video configurations.
#undef CONFIG_LIBDAV1D
#if defined(MOZ_FFVPX_AUDIOONLY)
#define CONFIG_LIBDAV1D 0
#else
#define CONFIG_LIBDAV1D 1
#endif

#undef CONFIG_FFT
#undef CONFIG_RDFT
#define CONFIG_FFT 1
#define CONFIG_RDFT 1

// override '#define EXTERN_ASM _' in config_generic.h to allow building with
// gcc on arm
#if defined(__GNUC__) && defined(__arm__)
#undef EXTERN_ASM
#define EXTERN_ASM
#endif

/**
 * Linux Hardware Video Decoding
 **/
#undef CONFIG_VAAPI
#undef CONFIG_VAAPI_1
#undef CONFIG_VP8_VAAPI_HWACCEL
#undef CONFIG_VP9_VAAPI_HWACCEL
#undef CONFIG_AV1_VAAPI_HWACCEL

#if defined(MOZ_WIDGET_GTK) && !defined(MOZ_FFVPX_AUDIOONLY)
#define CONFIG_VAAPI 1
#define CONFIG_VAAPI_1 1
#define CONFIG_VP8_VAAPI_HWACCEL 1
#define CONFIG_VP9_VAAPI_HWACCEL 1
#define CONFIG_AV1_VAAPI_HWACCEL 1
#else
#define CONFIG_VAAPI 0
#define CONFIG_VAAPI_1 0
#define CONFIG_VP8_VAAPI_HWACCEL 0
#define CONFIG_VP9_VAAPI_HWACCEL 0
#define CONFIG_AV1_VAAPI_HWACCEL 0
#endif

/**
 * Windows Hardware Video Decoding
 **/
#undef CONFIG_D3D11VA
#undef CONFIG_VP9_D3D11VA_HWACCEL
#undef CONFIG_VP9_D3D11VA2_HWACCEL
#undef CONFIG_AV1_D3D11VA_HWACCEL
#undef CONFIG_AV1_D3D11VA2_HWACCEL

#if defined (XP_WIN) && !defined(MOZ_FFVPX_AUDIOONLY)
  #define CONFIG_D3D11VA 1
  #define CONFIG_VP9_D3D11VA_HWACCEL 1
  #define CONFIG_VP9_D3D11VA2_HWACCEL 1
  #define CONFIG_AV1_D3D11VA_HWACCEL 1
  #define CONFIG_AV1_D3D11VA2_HWACCEL 1
#else
  #define CONFIG_D3D11VA 0
  #define CONFIG_VP9_D3D11VA_HWACCEL 0
  #define CONFIG_VP9_D3D11VA2_HWACCEL 0
  #define CONFIG_AV1_D3D11VA_HWACCEL 0
  #define CONFIG_AV1_D3D11VA2_HWACCEL 0
#endif

/**
 * BSD / Solaris
 **/
#if defined(XP_OPENBSD) || defined(XP_NETBSD) || defined(XP_FREEBSD) || defined(XP_SOLARIS)
  #undef HAVE_GETAUXVAL
  #define HAVE_GETAUXVAL 0
#endif

/**
 * Android hardware decoding via MediaCodec NDK
*/

#undef CONFIG_MEDIACODEC
#undef CONFIG_AAC_MEDIACODEC_DECODER
#undef CONFIG_H264_MEDIACODEC_DECODER
#undef CONFIG_HEVC_MEDIACODEC_DECODER
#undef CONFIG_VP8_MEDIACODEC_DECODER
#undef CONFIG_VP9_MEDIACODEC_DECODER
#undef CONFIG_AV1_MEDIACODEC_DECODER
#undef CONFIG_H264_MEDIACODEC_ENCODER
#undef CONFIG_HEVC_MEDIACODEC_ENCODER
#undef CONFIG_VP8_MEDIACODEC_ENCODER
#undef CONFIG_VP9_MEDIACODEC_ENCODER
#undef CONFIG_AV1_MEDIACODEC_ENCODER

#if defined (MOZ_WIDGET_ANDROID) && !defined(MOZ_FFVPX_AUDIOONLY)
  #define CONFIG_MEDIACODEC 1
  #define CONFIG_AAC_MEDIACODEC_DECODER 1
  #define CONFIG_H264_MEDIACODEC_DECODER 1
  #define CONFIG_HEVC_MEDIACODEC_DECODER 1
  #define CONFIG_VP8_MEDIACODEC_DECODER 1
  #define CONFIG_VP9_MEDIACODEC_DECODER 1
  #define CONFIG_AV1_MEDIACODEC_DECODER 1
  #define CONFIG_H264_MEDIACODEC_ENCODER 1
  #define CONFIG_HEVC_MEDIACODEC_ENCODER 1
  #define CONFIG_VP8_MEDIACODEC_ENCODER 1
  #define CONFIG_VP9_MEDIACODEC_ENCODER 1
  #define CONFIG_AV1_MEDIACODEC_ENCODER 1
#else
  #define CONFIG_MEDIACODEC 0
  #define CONFIG_AAC_MEDIACODEC_DECODER 0
  #define CONFIG_H264_MEDIACODEC_DECODER 0
  #define CONFIG_HEVC_MEDIACODEC_DECODER 0
  #define CONFIG_VP8_MEDIACODEC_DECODER 0
  #define CONFIG_VP9_MEDIACODEC_DECODER 0
  #define CONFIG_AV1_MEDIACODEC_DECODER 0
  #define CONFIG_H264_MEDIACODEC_ENCODER 0
  #define CONFIG_HEVC_MEDIACODEC_ENCODER 0
  #define CONFIG_VP8_MEDIACODEC_ENCODER 0
  #define CONFIG_VP9_MEDIACODEC_ENCODER 0
  #define CONFIG_AV1_MEDIACODEC_ENCODER 0
#endif

#define CONFIG_H264_MEDIACODEC_DECODER_EXTRADATA 0
#define CONFIG_HEVC_MEDIACODEC_DECODER_EXTRADATA 0
