diff options
Diffstat (limited to 'modules/webm')
-rw-r--r-- | modules/webm/SCsub | 4 | ||||
-rw-r--r-- | modules/webm/doc_classes/ResourceImporterWebm.xml | 2 | ||||
-rw-r--r-- | modules/webm/doc_classes/VideoStreamWebm.xml | 2 | ||||
-rw-r--r-- | modules/webm/libvpx/SCsub | 50 | ||||
-rw-r--r-- | modules/webm/libvpx/yasm_osx_fat.py | 38 |
5 files changed, 26 insertions, 70 deletions
diff --git a/modules/webm/SCsub b/modules/webm/SCsub index 2f1a28a54c..33561da098 100644 --- a/modules/webm/SCsub +++ b/modules/webm/SCsub @@ -18,6 +18,10 @@ thirdparty_libsimplewebm_sources = [thirdparty_libsimplewebm_dir + file for file env_webm.add_source_files(env.modules_sources, thirdparty_libsimplewebm_sources) env_webm.Append(CPPPATH=[thirdparty_libsimplewebm_dir, thirdparty_libsimplewebm_dir + "libwebm/"]) +# upstream uses c++11 +if (not env_webm.msvc): + env_webm.Append(CCFLAGS="-std=c++11") + # also requires libogg, libvorbis and libopus if env['builtin_libogg']: env_webm.Append(CPPPATH=["#thirdparty/libogg"]) diff --git a/modules/webm/doc_classes/ResourceImporterWebm.xml b/modules/webm/doc_classes/ResourceImporterWebm.xml index 20e0e48187..0cfab1baf0 100644 --- a/modules/webm/doc_classes/ResourceImporterWebm.xml +++ b/modules/webm/doc_classes/ResourceImporterWebm.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="ResourceImporterWebm" inherits="ResourceImporter" category="Core" version="3.0-stable"> +<class name="ResourceImporterWebm" inherits="ResourceImporter" category="Core" version="3.1"> <brief_description> </brief_description> <description> diff --git a/modules/webm/doc_classes/VideoStreamWebm.xml b/modules/webm/doc_classes/VideoStreamWebm.xml index 94aea5c8d2..c02a7a8016 100644 --- a/modules/webm/doc_classes/VideoStreamWebm.xml +++ b/modules/webm/doc_classes/VideoStreamWebm.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8" ?> -<class name="VideoStreamWebm" inherits="VideoStream" category="Core" version="3.0-stable"> +<class name="VideoStreamWebm" inherits="VideoStream" category="Core" version="3.1"> <brief_description> </brief_description> <description> diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index 73ba17d184..b09c232b3c 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -254,7 +254,6 @@ env_libvpx = env.Clone() env_libvpx.Append(CPPPATH=[libvpx_dir]) cpu_bits = env["bits"] -osx_fat = (env["platform"] == 'osx' and cpu_bits == 'fat') webm_cpu_x86 = False webm_cpu_arm = False if env["platform"] == 'uwp': @@ -269,11 +268,8 @@ else: is_android_x86 = (env["platform"] == 'android' and env["android_arch"] == 'x86') if is_android_x86: cpu_bits = '32' - if osx_fat: - webm_cpu_x86 = True - else: - webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86) - webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or (not is_android_x86 and env["platform"] == 'android') + webm_cpu_x86 = not is_x11_or_server_arm and (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86) + webm_cpu_arm = is_x11_or_server_arm or (not is_ios_x86 and env["platform"] == 'iphone') or (not is_android_x86 and env["platform"] == 'android') if webm_cpu_x86: import subprocess @@ -303,28 +299,22 @@ if webm_cpu_x86: webm_simd_optimizations = False if webm_cpu_x86: - if osx_fat: - #'osx' platform only: run python script which will compile using 'yasm' command and then merge 32-bit and 64-bit using 'lipo' command - env_libvpx["AS"] = 'python modules/webm/libvpx/yasm_osx_fat.py' - env_libvpx["ASFLAGS"] = '-I' + libvpx_dir[1:] - env_libvpx["ASCOM"] = '$AS $ASFLAGS $TARGET $SOURCES' + if env["platform"] == 'windows' or env["platform"] == 'uwp': + env_libvpx["ASFORMAT"] = 'win' + elif env["platform"] == 'osx' or env["platform"] == "iphone": + env_libvpx["ASFORMAT"] = 'macho' else: - if env["platform"] == 'windows' or env["platform"] == 'uwp': - env_libvpx["ASFORMAT"] = 'win' - elif env["platform"] == 'osx' or env["platform"] == "iphone": - env_libvpx["ASFORMAT"] = 'macho' - else: - env_libvpx["ASFORMAT"] = 'elf' - env_libvpx["ASFORMAT"] += cpu_bits - - env_libvpx["AS"] = 'yasm' - env_libvpx["ASFLAGS"] = '-I' + libvpx_dir[1:] + ' -f $ASFORMAT -D $ASCPU' - env_libvpx["ASCOM"] = '$AS $ASFLAGS -o $TARGET $SOURCES' + env_libvpx["ASFORMAT"] = 'elf' + env_libvpx["ASFORMAT"] += cpu_bits - if cpu_bits == '32': - env_libvpx["ASCPU"] = 'X86_32' - elif cpu_bits == '64': - env_libvpx["ASCPU"] = 'X86_64' + env_libvpx["AS"] = 'yasm' + env_libvpx["ASFLAGS"] = '-I' + libvpx_dir[1:] + ' -f $ASFORMAT -D $ASCPU' + env_libvpx["ASCOM"] = '$AS $ASFLAGS -o $TARGET $SOURCES' + + if cpu_bits == '32': + env_libvpx["ASCPU"] = 'X86_32' + elif cpu_bits == '64': + env_libvpx["ASCPU"] = 'X86_64' env_libvpx.Append(CCFLAGS=['-DWEBM_X86ASM']) @@ -333,7 +323,7 @@ if webm_cpu_x86: if webm_cpu_arm: if env["platform"] == 'iphone': env_libvpx["ASFLAGS"] = '-arch armv7' - elif env["platform"] == 'android' or env["platform"] == 'x11' or env["platform"] == 'server': + elif env["platform"] == 'android' and env["android_arch"] == 'armv7' or env["platform"] == 'x11' or env["platform"] == 'server': env_libvpx["ASFLAGS"] = '-mfpu=neon' elif env["platform"] == 'uwp': env_libvpx["AS"] = 'armasm' @@ -350,7 +340,7 @@ if webm_simd_optimizations == False: env_libvpx.add_source_files(env.modules_sources, libvpx_sources) if webm_cpu_x86: - is_clang_or_gcc = ('gcc' in env["CC"]) or ('clang' in env["CC"]) + is_clang_or_gcc = ('gcc' in env["CC"]) or ('clang' in env["CC"]) or ("OSXCROSS_ROOT" in os.environ) env_libvpx_mmx = env_libvpx.Clone() if cpu_bits == '32' and is_clang_or_gcc: @@ -375,7 +365,7 @@ if webm_cpu_x86: env_libvpx.add_source_files(env.modules_sources, libvpx_sources_intrin_x86) env_libvpx.add_source_files(env.modules_sources, libvpx_sources_x86asm) - if cpu_bits == '64' or osx_fat: + if cpu_bits == '64': env_libvpx.add_source_files(env.modules_sources, libvpx_sources_x86_64asm) elif webm_cpu_arm: env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm) @@ -389,5 +379,5 @@ elif webm_cpu_arm: env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_armasm_ms) elif env["platform"] == 'iphone': env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_gas_apple) - else: + elif not env["android_arch"] == 'arm64v8': env_libvpx.add_source_files(env.modules_sources, libvpx_sources_arm_neon_gas) diff --git a/modules/webm/libvpx/yasm_osx_fat.py b/modules/webm/libvpx/yasm_osx_fat.py deleted file mode 100644 index 0065e2766c..0000000000 --- a/modules/webm/libvpx/yasm_osx_fat.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python - -import sys -import os - -includes = sys.argv[1] -output_file = sys.argv[2] -input_file = sys.argv[3] - -can_remove = {} - -lipo_command = '' - -exit_code = 1 - -for arch in ['32', '64']: - if arch == '32' and input_file.endswith('x86_64.asm'): - can_remove[arch] = False - else: - command = 'yasm ' + includes + ' -f macho' + arch + ' -D X86_' + arch + ' -o ' + output_file + '.' + arch + ' ' + input_file - print(command) - if os.system(command) == 0: - lipo_command += output_file + '.' + arch + ' ' - can_remove[arch] = True - else: - can_remove[arch] = False - -if lipo_command != '': - lipo_command = 'lipo -create ' + lipo_command + '-output ' + output_file - print(lipo_command) - if os.system(lipo_command) == 0: - exit_code = 0 - -for arch in ['32', '64']: - if can_remove[arch]: - os.remove(output_file + '.' + arch) - -sys.exit(exit_code) |