From 92b259ccf15f392eb83c8b07e2f0d41c294a91ae Mon Sep 17 00:00:00 2001 From: Leon Krause Date: Mon, 27 Aug 2018 04:08:04 +0200 Subject: [PATCH 1/2] Fix WebM module for HTML5 platform --- modules/webm/libvpx/SCsub | 12 +++++++++++- thirdparty/libvpx/vpx_config.h | 7 ++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index c681e2b34fb..2daf8c282f7 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -38,7 +38,6 @@ libvpx_sources = [ "vp8/decoder/decodemv.c", "vp8/decoder/detokenize.c", "vp8/decoder/onyxd_if.c", - "vp8/decoder/threading.c", "vp9/vp9_dx_iface.c", @@ -102,6 +101,10 @@ libvpx_sources = [ "vpx_util/vpx_thread.c" ] +libvpx_sources_mt = [ + "vp8/decoder/threading.c", +] + libvpx_sources_intrin_x86 = [ "vp8/common/x86/filter_x86.c", "vp8/common/x86/loopfilter_x86.c", @@ -231,6 +234,7 @@ libvpx_sources_arm_neon_gas_apple = [ ] libvpx_sources = [libvpx_dir + file for file in libvpx_sources] +libvpx_sources_mt = [libvpx_dir + file for file in libvpx_sources_mt] libvpx_sources_intrin_x86 = [libvpx_dir + file for file in libvpx_sources_intrin_x86] libvpx_sources_intrin_x86_mmx = [libvpx_dir + file for file in libvpx_sources_intrin_x86_mmx] libvpx_sources_intrin_x86_sse2 = [libvpx_dir + file for file in libvpx_sources_intrin_x86_sse2] @@ -253,6 +257,8 @@ env_webm.Append(CPPPATH=[libvpx_dir]) env_libvpx = env.Clone() env_libvpx.Append(CPPPATH=[libvpx_dir]) +webm_multithread = env["platform"] != 'javascript' + cpu_bits = env["bits"] webm_cpu_x86 = False webm_cpu_arm = False @@ -338,6 +344,10 @@ if webm_simd_optimizations == False: print("WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!") env_libvpx.add_source_files(env.modules_sources, libvpx_sources) + +if webm_multithread: + env_libvpx.add_source_files(env.modules_sources, libvpx_sources_mt) + if webm_cpu_x86: is_clang_or_gcc = ('gcc' in env["CC"]) or ('clang' in env["CC"]) or ("OSXCROSS_ROOT" in os.environ) diff --git a/thirdparty/libvpx/vpx_config.h b/thirdparty/libvpx/vpx_config.h index fb9e13c4ada..6caec50c81a 100644 --- a/thirdparty/libvpx/vpx_config.h +++ b/thirdparty/libvpx/vpx_config.h @@ -67,6 +67,12 @@ #define CONFIG_BIG_ENDIAN 0 //TODO: Autodetect +#ifdef __EMSCRIPTEN__ +#define CONFIG_MULTITHREAD 0 +#else +#define CONFIG_MULTITHREAD 1 +#endif + #ifdef _WIN32 #define HAVE_PTHREAD_H 0 #define HAVE_UNISTD_H 0 @@ -95,7 +101,6 @@ #define CONFIG_RUNTIME_CPU_DETECT 1 #define CONFIG_POSTPROC 0 #define CONFIG_VP9_POSTPROC 0 -#define CONFIG_MULTITHREAD 1 #define CONFIG_INTERNAL_STATS 0 #define CONFIG_VP8_ENCODER 0 #define CONFIG_VP8_DECODER 1 From b4b816c1226df7205c878b58e0a704102a149003 Mon Sep 17 00:00:00 2001 From: Leon Krause Date: Tue, 28 Aug 2018 01:56:47 +0200 Subject: [PATCH 2/2] Enable Theora module for HTML5 platform --- platform/javascript/detect.py | 1 - 1 file changed, 1 deletion(-) diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py index fc909f66192..17b31f8d739 100644 --- a/platform/javascript/detect.py +++ b/platform/javascript/detect.py @@ -25,7 +25,6 @@ def get_opts(): def get_flags(): return [ ('tools', False), - ('module_theora_enabled', False), # Disabling the mbedtls module reduces file size. # The module has little use due to the limited networking functionality # in this platform. For the available networking methods, the browser