<commit_before># Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'target_defaults': {
    'conditions': [
      ['OS!="linux" and OS!="freebsd"', {'sources/': [['exclude', '/linux/']]}],
      ['OS!="mac"', {'sources/': [['exclude', '/mac/']]}],
      ['OS!="win"', {'sources/': [['exclude', '/win/']]}],
    ],
    'variables': {
      # Since we are not often debugging FFmpeg, and performance is
      # unacceptable without optimization, freeze the optimizations to -O2.
      # If someone really wants -O1 , they can change these in their checkout.
      # If you want -O0, see the Gotchas in README.Chromium for why that
      # won't work.
      'debug_optimize': '2',
      'mac_debug_optimization': '2',
    },
  },
  'variables': {
    # Allow overridding the selection of which FFmpeg binaries to copy via an
    # environment variable.  Affects the ffmpeg_binaries target.
    'ffmpeg_branding%': '<(branding)',
    'ffmpeg_variant%': '<(target_arch)',

    'use_system_ffmpeg%': 0,

    # Locations for generated artifacts.
    'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/ffmpeg',
    'asm_library': 'ffmpegasm',
  },
  'conditions': [
    # This condition is for migrating from pre-built binaries to an in-tree
    # source build.  Most of these should be removed once FFmpeg is built on
    # mac and linux.  Windows will take more work.
    #
    # TODO(ajwong): Per the comment above, reduce this conditional's size and
    # determine if in-tree build in Windows is tractable.
    ['(OS!="linux" and OS!="freebsd") or use_system_ffmpeg!=0', {
      'variables': {
        'target_for_binaries': 'ffmpeg_binaries',
        'ffmpeg_include_root': 'include',
      },
    },{  # else OS=="linux"
      'variables': {
        'target_for_binaries': 'ffmpegsumo_nolink',
        'ffmpeg_include_root': 'source/patched-ffmpeg-mt',
      },
      'targets': [
        {
          'target_name': 'ffmpegsumo',
          'type': 'shared_library',
          'dependencies': [
            'make_ffmpeg_asm_lib',
          ],
          'sources': [
            'source/patched-ffmpeg-mt/libavcodec/aac.c',
            'source/patched-ffmpeg-mt/libavcodec/aac_ac3_parser.c',
            'source/patched-ffmpeg-mt/libavcodec/aac_parser.c',
            'source/patched-ffmpeg-mt/libavcodec/aactab.c',
            'source/patched-ffmpeg-mt/libavcodec/allcodecs.c',
            'source/patched-ffmpeg-mt/libavcodec/audioconvert.c',
            'source/patched-ffmpeg-mt/libavcodec/avpacket.c',
            'source/patched-ffmpeg-mt/libavcodec/bitstream.c',
            'source/patched-ffmpeg-mt/libavcodec/bitstream_filter.c',
            'source/patched-ffmpeg-mt/libavcodec/cabac.c',
            'source/patched-ffmpeg-mt/libavcodec/dsputil.c',
            'source/patched-ffmpeg-mt/libavcodec/error_resilience.c',
            'source/patched-ffmpeg-mt/libavcodec/eval.c',
            'source/patched-ffmpeg-mt/libavcodec/faanidct.c',
            'source/patched-ffmpeg-mt/libavcodec/fft.c',
            'source/patched-ffmpeg-mt/libavcodec/golomb.c',
            'source/patched-ffmpeg-mt/libavcodec/h264.c',
            'source/patched-ffmpeg-mt/libavcodec/h264_parser.c',
            'source/patched-ffmpeg-mt/libavcodec/h264idct.c',
            'source/patched-ffmpeg-mt/libavcodec/h264pred.c',
            'source/patched-ffmpeg-mt/libavcodec/imgconvert.c',
            'source/patched-ffmpeg-mt/libavcodec/jrevdct.c',
            'source/patched-ffmpeg-mt/libavcodec/mdct.c',
            'source/patched-ffmpeg-mt/libavcodec/mpeg4audio.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudio.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudio_parser.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudiodata.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudiodec.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudiodecheader.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegvideo.c',
            'source/patched-ffmpeg-mt/libavcodec/opt.c',
            'source/patched-ffmpeg-mt/libavcodec/options.c',
            'source/patched-ffmpeg-mt/libavcodec/parser.c',
            'source/patched-ffmpeg-mt/libavcodec/pthread.c',
            'source/patched-ffmpeg-mt/libavcodec/raw.c',
            'source/patched-ffmpeg-mt/libavcodec/resample.c',
            'source/patched-ffmpeg-mt/libavcodec/resample2.c',
            'source/patched-ffmpeg-mt/libavcodec/simple_idct.c',
            'source/patched-ffmpeg-mt/libavcodec/utils.c',
            'source/patched-ffmpeg-mt/libavcodec/vorbis.c',
            'source/patched-ffmpeg-mt/libavcodec/vorbis_data.c',
            'source/patched-ffmpeg-mt/libavcodec/vorbis_dec.c',
            'source/patched-ffmpeg-mt/libavcodec/vp3.c',
            'source/patched-ffmpeg-mt/libavcodec/vp3dsp.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/cpuid.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/dnxhd_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/dsputil_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/fdct_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/fft_3dn.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/fft_3dn2.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/fft_sse.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/idct_mmx_xvid.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/idct_sse2_xvid.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/motion_est_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/mpegvideo_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/simple_idct_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/vp3dsp_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/vp3dsp_sse2.c',
            'source/patched-ffmpeg-mt/libavcodec/xiph.c',
            'source/patched-ffmpeg-mt/libavformat/allformats.c',
            'source/patched-ffmpeg-mt/libavformat/avio.c',
            'source/patched-ffmpeg-mt/libavformat/aviobuf.c',
            'source/patched-ffmpeg-mt/libavformat/cutils.c',
            'source/patched-ffmpeg-mt/libavformat/id3v2.c',
            'source/patched-ffmpeg-mt/libavformat/isom.c',
            'source/patched-ffmpeg-mt/libavformat/metadata.c',
            'source/patched-ffmpeg-mt/libavformat/metadata_compat.c',
            'source/patched-ffmpeg-mt/libavformat/mov.c',
            'source/patched-ffmpeg-mt/libavformat/mp3.c',
            'source/patched-ffmpeg-mt/libavformat/oggdec.c',
            'source/patched-ffmpeg-mt/libavformat/oggparseogm.c',
            'source/patched-ffmpeg-mt/libavformat/oggparsetheora.c',
            'source/patched-ffmpeg-mt/libavformat/oggparsevorbis.c',
            'source/patched-ffmpeg-mt/libavformat/options.c',
            'source/patched-ffmpeg-mt/libavformat/os_support.c',
            'source/patched-ffmpeg-mt/libavformat/riff.c',
            'source/patched-ffmpeg-mt/libavformat/sdp.c',
            'source/patched-ffmpeg-mt/libavformat/utils.c',
            'source/patched-ffmpeg-mt/libavutil/adler32.c',
            'source/patched-ffmpeg-mt/libavutil/aes.c',
            'source/patched-ffmpeg-mt/libavutil/avstring.c',
            'source/patched-ffmpeg-mt/libavutil/base64.c',
            'source/patched-ffmpeg-mt/libavutil/crc.c',
            'source/patched-ffmpeg-mt/libavutil/des.c',
            'source/patched-ffmpeg-mt/libavutil/fifo.c',
            'source/patched-ffmpeg-mt/libavutil/intfloat_readwrite.c',
            'source/patched-ffmpeg-mt/libavutil/lfg.c',
            'source/patched-ffmpeg-mt/libavutil/lls.c',
            'source/patched-ffmpeg-mt/libavutil/log.c',
            'source/patched-ffmpeg-mt/libavutil/lzo.c',
            'source/patched-ffmpeg-mt/libavutil/mathematics.c',
            'source/patched-ffmpeg-mt/libavutil/md5.c',
            'source/patched-ffmpeg-mt/libavutil/mem.c',
            'source/patched-ffmpeg-mt/libavutil/random_seed.c',
            'source/patched-ffmpeg-mt/libavutil/rational.c',
            'source/patched-ffmpeg-mt/libavutil/rc4.c',
            'source/patched-ffmpeg-mt/libavutil/sha1.c',
            'source/patched-ffmpeg-mt/libavutil/tree.c',
            'source/patched-ffmpeg-mt/libavutil/utils.c',

            # Config file for the OS and architecture.
            'source/config/<(ffmpeg_branding)/<(OS)/<(target_arch)/config.h',
          ],
          'include_dirs': [
            'source/config/<(ffmpeg_branding)/<(OS)/<(target_arch)',
            'source/patched-ffmpeg-mt',
          ],
          'cflags': [
            '-DHAVE_AV_CONFIG_H',
            '-D_ISOC99_SOURCE',
            '-D_POSIX_C_SOURCE=200112',
            '-std=c99',
            '-D_LARGEFILE_SOURCE',
            '-pthread',
            '-fno-math-errno',
            '-fomit-frame-pointer'
          ],
          'cflags!': [
            # Ensure the symbols are exported.
            '-fvisibility=hidden',
          ],
          'ldflags': [
            '-Wl,-Bsymbolic',
            '-L<(shared_generated_dir)',
          ],
          'libraries': [
            '-l<(asm_library)',
            '-lm',

            # TODO(ajwong): Statically link these once we resolve the
            # PIC/non-PIC issues on x64.
            '-lz',
            '-lbz2',
          ],
          'conditions': [
            ['target_arch=="x64"', {<commit_msg>Remove BZIP2 from list of dependencies. BUG=26548 TEST=build on linux.  Should build okay without bz2 lib installed.<commit_after># Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'target_defaults': {
    'conditions': [
      ['OS!="linux" and OS!="freebsd"', {'sources/': [['exclude', '/linux/']]}],
      ['OS!="mac"', {'sources/': [['exclude', '/mac/']]}],
      ['OS!="win"', {'sources/': [['exclude', '/win/']]}],
    ],
    'variables': {
      # Since we are not often debugging FFmpeg, and performance is
      # unacceptable without optimization, freeze the optimizations to -O2.
      # If someone really wants -O1 , they can change these in their checkout.
      # If you want -O0, see the Gotchas in README.Chromium for why that
      # won't work.
      'debug_optimize': '2',
      'mac_debug_optimization': '2',
    },
  },
  'variables': {
    # Allow overridding the selection of which FFmpeg binaries to copy via an
    # environment variable.  Affects the ffmpeg_binaries target.
    'ffmpeg_branding%': '<(branding)',
    'ffmpeg_variant%': '<(target_arch)',

    'use_system_ffmpeg%': 0,

    # Locations for generated artifacts.
    'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/ffmpeg',
    'asm_library': 'ffmpegasm',
  },
  'conditions': [
    # This condition is for migrating from pre-built binaries to an in-tree
    # source build.  Most of these should be removed once FFmpeg is built on
    # mac and linux.  Windows will take more work.
    #
    # TODO(ajwong): Per the comment above, reduce this conditional's size and
    # determine if in-tree build in Windows is tractable.
    ['(OS!="linux" and OS!="freebsd") or use_system_ffmpeg!=0', {
      'variables': {
        'target_for_binaries': 'ffmpeg_binaries',
        'ffmpeg_include_root': 'include',
      },
    },{  # else OS=="linux"
      'variables': {
        'target_for_binaries': 'ffmpegsumo_nolink',
        'ffmpeg_include_root': 'source/patched-ffmpeg-mt',
      },
      'targets': [
        {
          'target_name': 'ffmpegsumo',
          'type': 'shared_library',
          'dependencies': [
            'make_ffmpeg_asm_lib',
          ],
          'sources': [
            'source/patched-ffmpeg-mt/libavcodec/aac.c',
            'source/patched-ffmpeg-mt/libavcodec/aac_ac3_parser.c',
            'source/patched-ffmpeg-mt/libavcodec/aac_parser.c',
            'source/patched-ffmpeg-mt/libavcodec/aactab.c',
            'source/patched-ffmpeg-mt/libavcodec/allcodecs.c',
            'source/patched-ffmpeg-mt/libavcodec/audioconvert.c',
            'source/patched-ffmpeg-mt/libavcodec/avpacket.c',
            'source/patched-ffmpeg-mt/libavcodec/bitstream.c',
            'source/patched-ffmpeg-mt/libavcodec/bitstream_filter.c',
            'source/patched-ffmpeg-mt/libavcodec/cabac.c',
            'source/patched-ffmpeg-mt/libavcodec/dsputil.c',
            'source/patched-ffmpeg-mt/libavcodec/error_resilience.c',
            'source/patched-ffmpeg-mt/libavcodec/eval.c',
            'source/patched-ffmpeg-mt/libavcodec/faanidct.c',
            'source/patched-ffmpeg-mt/libavcodec/fft.c',
            'source/patched-ffmpeg-mt/libavcodec/golomb.c',
            'source/patched-ffmpeg-mt/libavcodec/h264.c',
            'source/patched-ffmpeg-mt/libavcodec/h264_parser.c',
            'source/patched-ffmpeg-mt/libavcodec/h264idct.c',
            'source/patched-ffmpeg-mt/libavcodec/h264pred.c',
            'source/patched-ffmpeg-mt/libavcodec/imgconvert.c',
            'source/patched-ffmpeg-mt/libavcodec/jrevdct.c',
            'source/patched-ffmpeg-mt/libavcodec/mdct.c',
            'source/patched-ffmpeg-mt/libavcodec/mpeg4audio.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudio.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudio_parser.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudiodata.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudiodec.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegaudiodecheader.c',
            'source/patched-ffmpeg-mt/libavcodec/mpegvideo.c',
            'source/patched-ffmpeg-mt/libavcodec/opt.c',
            'source/patched-ffmpeg-mt/libavcodec/options.c',
            'source/patched-ffmpeg-mt/libavcodec/parser.c',
            'source/patched-ffmpeg-mt/libavcodec/pthread.c',
            'source/patched-ffmpeg-mt/libavcodec/raw.c',
            'source/patched-ffmpeg-mt/libavcodec/resample.c',
            'source/patched-ffmpeg-mt/libavcodec/resample2.c',
            'source/patched-ffmpeg-mt/libavcodec/simple_idct.c',
            'source/patched-ffmpeg-mt/libavcodec/utils.c',
            'source/patched-ffmpeg-mt/libavcodec/vorbis.c',
            'source/patched-ffmpeg-mt/libavcodec/vorbis_data.c',
            'source/patched-ffmpeg-mt/libavcodec/vorbis_dec.c',
            'source/patched-ffmpeg-mt/libavcodec/vp3.c',
            'source/patched-ffmpeg-mt/libavcodec/vp3dsp.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/cpuid.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/dnxhd_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/dsputil_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/fdct_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/fft_3dn.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/fft_3dn2.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/fft_sse.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/idct_mmx_xvid.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/idct_sse2_xvid.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/motion_est_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/mpegvideo_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/simple_idct_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/vp3dsp_mmx.c',
            'source/patched-ffmpeg-mt/libavcodec/x86/vp3dsp_sse2.c',
            'source/patched-ffmpeg-mt/libavcodec/xiph.c',
            'source/patched-ffmpeg-mt/libavformat/allformats.c',
            'source/patched-ffmpeg-mt/libavformat/avio.c',
            'source/patched-ffmpeg-mt/libavformat/aviobuf.c',
            'source/patched-ffmpeg-mt/libavformat/cutils.c',
            'source/patched-ffmpeg-mt/libavformat/id3v2.c',
            'source/patched-ffmpeg-mt/libavformat/isom.c',
            'source/patched-ffmpeg-mt/libavformat/metadata.c',
            'source/patched-ffmpeg-mt/libavformat/metadata_compat.c',
            'source/patched-ffmpeg-mt/libavformat/mov.c',
            'source/patched-ffmpeg-mt/libavformat/mp3.c',
            'source/patched-ffmpeg-mt/libavformat/oggdec.c',
            'source/patched-ffmpeg-mt/libavformat/oggparseogm.c',
            'source/patched-ffmpeg-mt/libavformat/oggparsetheora.c',
            'source/patched-ffmpeg-mt/libavformat/oggparsevorbis.c',
            'source/patched-ffmpeg-mt/libavformat/options.c',
            'source/patched-ffmpeg-mt/libavformat/os_support.c',
            'source/patched-ffmpeg-mt/libavformat/riff.c',
            'source/patched-ffmpeg-mt/libavformat/sdp.c',
            'source/patched-ffmpeg-mt/libavformat/utils.c',
            'source/patched-ffmpeg-mt/libavutil/adler32.c',
            'source/patched-ffmpeg-mt/libavutil/aes.c',
            'source/patched-ffmpeg-mt/libavutil/avstring.c',
            'source/patched-ffmpeg-mt/libavutil/base64.c',
            'source/patched-ffmpeg-mt/libavutil/crc.c',
            'source/patched-ffmpeg-mt/libavutil/des.c',
            'source/patched-ffmpeg-mt/libavutil/fifo.c',
            'source/patched-ffmpeg-mt/libavutil/intfloat_readwrite.c',
            'source/patched-ffmpeg-mt/libavutil/lfg.c',
            'source/patched-ffmpeg-mt/libavutil/lls.c',
            'source/patched-ffmpeg-mt/libavutil/log.c',
            'source/patched-ffmpeg-mt/libavutil/lzo.c',
            'source/patched-ffmpeg-mt/libavutil/mathematics.c',
            'source/patched-ffmpeg-mt/libavutil/md5.c',
            'source/patched-ffmpeg-mt/libavutil/mem.c',
            'source/patched-ffmpeg-mt/libavutil/random_seed.c',
            'source/patched-ffmpeg-mt/libavutil/rational.c',
            'source/patched-ffmpeg-mt/libavutil/rc4.c',
            'source/patched-ffmpeg-mt/libavutil/sha1.c',
            'source/patched-ffmpeg-mt/libavutil/tree.c',
            'source/patched-ffmpeg-mt/libavutil/utils.c',

            # Config file for the OS and architecture.
            'source/config/<(ffmpeg_branding)/<(OS)/<(target_arch)/config.h',
          ],
          'include_dirs': [
            'source/config/<(ffmpeg_branding)/<(OS)/<(target_arch)',
            'source/patched-ffmpeg-mt',
          ],
          'cflags': [
            '-DHAVE_AV_CONFIG_H',
            '-D_ISOC99_SOURCE',
            '-D_POSIX_C_SOURCE=200112',
            '-std=c99',
            '-D_LARGEFILE_SOURCE',
            '-pthread',
            '-fno-math-errno',
            '-fomit-frame-pointer'
          ],
          'cflags!': [
            # Ensure the symbols are exported.
            '-fvisibility=hidden',
          ],
          'ldflags': [
            '-Wl,-Bsymbolic',
            '-L<(shared_generated_dir)',
          ],
          'libraries': [
            '-l<(asm_library)',
            '-lm',

            # TODO(ajwong): Statically link these once we resolve the
            # PIC/non-PIC issues on x64.
            '-lz',
          ],
          'conditions': [
            ['target_arch=="x64"', {
{'fraction_non_alphanumeric': 0.14599496749842733, 'fraction_numerical': 0.009540784231495073, 'mean_word_length': 2.2164896307536672, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1183840', 'n_tokens_mistral': 7124, 'n_tokens_neox': 6987, 'n_words': 717}