@scrypted/libav 1.0.181 → 1.0.183
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/_openh264install/include/wels/codec_api.h +0 -592
- package/_openh264install/include/wels/codec_app_def.h +0 -820
- package/_openh264install/include/wels/codec_def.h +0 -216
- package/_openh264install/include/wels/codec_ver.h +0 -15
- package/_openh264install/lib/libopenh264.a +0 -0
- package/_openh264install/lib/pkgconfig/openh264.pc +0 -10
- package/openh264/.reviewboardrc +0 -3
- package/openh264/.travis.yml +0 -42
- package/openh264/CODING_STYLE +0 -8
- package/openh264/CONTRIBUTORS +0 -55
- package/openh264/LICENSE +0 -23
- package/openh264/Makefile +0 -408
- package/openh264/README.md +0 -197
- package/openh264/RELEASES +0 -467
- package/openh264/SECURITY.md +0 -16
- package/openh264/autotest/codec_comparision/run_MultiCodecComparision.sh +0 -431
- package/openh264/autotest/performanceTest/android/run_AutoTest_android.sh +0 -180
- package/openh264/autotest/performanceTest/ios/fruitstrap +0 -0
- package/openh264/autotest/performanceTest/ios/iFileTransfer +0 -0
- package/openh264/autotest/performanceTest/ios/run_AutoTest_ios.sh +0 -193
- package/openh264/autotest/performanceTest/ios/uiascript.js +0 -19
- package/openh264/autotest/performanceTest/parsePerfData.sh +0 -107
- package/openh264/autotest/performanceTest/run_perfTest.sh +0 -122
- package/openh264/autotest/unitTest/android/run_AutoTest_android.sh +0 -112
- package/openh264/autotest/unitTest/ios/run_AutoTest_ios.sh +0 -167
- package/openh264/autotest/unitTest/run_ParseUTxml.sh +0 -70
- package/openh264/autotest/unitTest/run_unitTest.sh +0 -98
- package/openh264/build.gradle +0 -30
- package/openh264/code-coverage.sh +0 -6
- package/openh264/codec/api/meson.build +0 -1
- package/openh264/codec/api/wels/codec_api.h +0 -592
- package/openh264/codec/api/wels/codec_app_def.h +0 -820
- package/openh264/codec/api/wels/codec_def.h +0 -216
- package/openh264/codec/api/wels/codec_ver.h +0 -15
- package/openh264/codec/api/wels/meson.build +0 -9
- package/openh264/codec/common/arm/arm_arch_common_macro.S +0 -83
- package/openh264/codec/common/arm/copy_mb_neon.S +0 -161
- package/openh264/codec/common/arm/deblocking_neon.S +0 -857
- package/openh264/codec/common/arm/expand_picture_neon.S +0 -154
- package/openh264/codec/common/arm/intra_pred_common_neon.S +0 -82
- package/openh264/codec/common/arm/mc_neon.S +0 -2283
- package/openh264/codec/common/arm64/arm_aarch64_common.h +0 -85
- package/openh264/codec/common/arm64/arm_arch64_common_macro.S +0 -79
- package/openh264/codec/common/arm64/copy_mb_aarch64_neon.S +0 -202
- package/openh264/codec/common/arm64/deblocking_aarch64_neon.S +0 -852
- package/openh264/codec/common/arm64/expand_picture_aarch64_neon.S +0 -150
- package/openh264/codec/common/arm64/intra_pred_common_aarch64_neon.S +0 -58
- package/openh264/codec/common/arm64/mc_aarch64_neon.S +0 -2614
- package/openh264/codec/common/generate_version.sh +0 -28
- package/openh264/codec/common/inc/WelsList.h +0 -287
- package/openh264/codec/common/inc/WelsLock.h +0 -97
- package/openh264/codec/common/inc/WelsTask.h +0 -75
- package/openh264/codec/common/inc/WelsTaskThread.h +0 -83
- package/openh264/codec/common/inc/WelsThread.h +0 -106
- package/openh264/codec/common/inc/WelsThreadLib.h +0 -151
- package/openh264/codec/common/inc/WelsThreadPool.h +0 -124
- package/openh264/codec/common/inc/asmdefs_mmi.h +0 -345
- package/openh264/codec/common/inc/copy_mb.h +0 -103
- package/openh264/codec/common/inc/cpu.h +0 -81
- package/openh264/codec/common/inc/cpu_core.h +0 -103
- package/openh264/codec/common/inc/crt_util_safe_x.h +0 -104
- package/openh264/codec/common/inc/deblocking_common.h +0 -124
- package/openh264/codec/common/inc/expand_pic.h +0 -107
- package/openh264/codec/common/inc/golomb_common.h +0 -166
- package/openh264/codec/common/inc/intra_pred_common.h +0 -86
- package/openh264/codec/common/inc/loongson_intrinsics.h +0 -1919
- package/openh264/codec/common/inc/ls_defines.h +0 -130
- package/openh264/codec/common/inc/macros.h +0 -329
- package/openh264/codec/common/inc/mc.h +0 -407
- package/openh264/codec/common/inc/measure_time.h +0 -88
- package/openh264/codec/common/inc/memory_align.h +0 -116
- package/openh264/codec/common/inc/msa_macros.h +0 -2393
- package/openh264/codec/common/inc/sad_common.h +0 -139
- package/openh264/codec/common/inc/typedefs.h +0 -86
- package/openh264/codec/common/inc/utils.h +0 -95
- package/openh264/codec/common/inc/version.h +0 -10
- package/openh264/codec/common/inc/version_gen.h.template +0 -6
- package/openh264/codec/common/inc/welsCodecTrace.h +0 -64
- package/openh264/codec/common/inc/wels_common_defs.h +0 -373
- package/openh264/codec/common/inc/wels_const_common.h +0 -63
- package/openh264/codec/common/loongarch/copy_mb_lsx.c +0 -194
- package/openh264/codec/common/loongarch/deblock_lsx.c +0 -1489
- package/openh264/codec/common/loongarch/intra_pred_com_lasx.c +0 -112
- package/openh264/codec/common/loongarch/intra_pred_com_lsx.c +0 -91
- package/openh264/codec/common/loongarch/mc_chroma_lsx.c +0 -192
- package/openh264/codec/common/loongarch/mc_horver_lsx.c +0 -654
- package/openh264/codec/common/loongarch/satd_sad_lasx.c +0 -568
- package/openh264/codec/common/meson.build +0 -84
- package/openh264/codec/common/mips/copy_mb_mmi.c +0 -477
- package/openh264/codec/common/mips/copy_mb_msa.c +0 -80
- package/openh264/codec/common/mips/deblock_mmi.c +0 -2826
- package/openh264/codec/common/mips/deblock_msa.c +0 -1024
- package/openh264/codec/common/mips/expand_picture_mmi.c +0 -673
- package/openh264/codec/common/mips/intra_pred_com_mmi.c +0 -548
- package/openh264/codec/common/mips/satd_sad_mmi.c +0 -2154
- package/openh264/codec/common/targets.mk +0 -136
- package/openh264/codec/common/x86/asm_inc.asm +0 -743
- package/openh264/codec/common/x86/cpuid.asm +0 -263
- package/openh264/codec/common/x86/dct.asm +0 -1036
- package/openh264/codec/common/x86/deblock.asm +0 -848
- package/openh264/codec/common/x86/expand_picture.asm +0 -728
- package/openh264/codec/common/x86/intra_pred_com.asm +0 -117
- package/openh264/codec/common/x86/mb_copy.asm +0 -615
- package/openh264/codec/common/x86/mc_chroma.asm +0 -313
- package/openh264/codec/common/x86/mc_luma.asm +0 -4490
- package/openh264/codec/common/x86/satd_sad.asm +0 -2734
- package/openh264/codec/common/x86/vaa.asm +0 -411
- package/openh264/codec/console/common/inc/read_config.h +0 -68
- package/openh264/codec/console/common/meson.build +0 -12
- package/openh264/codec/console/common/targets.mk +0 -20
- package/openh264/codec/console/dec/inc/d3d9_utils.h +0 -148
- package/openh264/codec/console/dec/meson.build +0 -15
- package/openh264/codec/console/dec/targets.mk +0 -20
- package/openh264/codec/console/enc/meson.build +0 -9
- package/openh264/codec/console/enc/targets.mk +0 -19
- package/openh264/codec/console/meson.build +0 -3
- package/openh264/codec/decoder/core/arm/block_add_neon.S +0 -129
- package/openh264/codec/decoder/core/arm/intra_pred_neon.S +0 -635
- package/openh264/codec/decoder/core/arm64/block_add_aarch64_neon.S +0 -131
- package/openh264/codec/decoder/core/arm64/intra_pred_aarch64_neon.S +0 -524
- package/openh264/codec/decoder/core/inc/au_parser.h +0 -199
- package/openh264/codec/decoder/core/inc/bit_stream.h +0 -62
- package/openh264/codec/decoder/core/inc/cabac_decoder.h +0 -111
- package/openh264/codec/decoder/core/inc/deblocking.h +0 -118
- package/openh264/codec/decoder/core/inc/dec_frame.h +0 -156
- package/openh264/codec/decoder/core/inc/dec_golomb.h +0 -344
- package/openh264/codec/decoder/core/inc/decode_mb_aux.h +0 -83
- package/openh264/codec/decoder/core/inc/decode_slice.h +0 -104
- package/openh264/codec/decoder/core/inc/decoder.h +0 -186
- package/openh264/codec/decoder/core/inc/decoder_context.h +0 -590
- package/openh264/codec/decoder/core/inc/decoder_core.h +0 -206
- package/openh264/codec/decoder/core/inc/error_code.h +0 -222
- package/openh264/codec/decoder/core/inc/error_concealment.h +0 -68
- package/openh264/codec/decoder/core/inc/fmo.h +0 -114
- package/openh264/codec/decoder/core/inc/get_intra_predictor.h +0 -191
- package/openh264/codec/decoder/core/inc/manage_dec_ref.h +0 -62
- package/openh264/codec/decoder/core/inc/mb_cache.h +0 -80
- package/openh264/codec/decoder/core/inc/memmgr_nal_unit.h +0 -66
- package/openh264/codec/decoder/core/inc/mv_pred.h +0 -195
- package/openh264/codec/decoder/core/inc/nal_prefix.h +0 -56
- package/openh264/codec/decoder/core/inc/nalu.h +0 -79
- package/openh264/codec/decoder/core/inc/parameter_sets.h +0 -217
- package/openh264/codec/decoder/core/inc/parse_mb_syn_cabac.h +0 -89
- package/openh264/codec/decoder/core/inc/parse_mb_syn_cavlc.h +0 -137
- package/openh264/codec/decoder/core/inc/pic_queue.h +0 -62
- package/openh264/codec/decoder/core/inc/picture.h +0 -112
- package/openh264/codec/decoder/core/inc/rec_mb.h +0 -104
- package/openh264/codec/decoder/core/inc/slice.h +0 -208
- package/openh264/codec/decoder/core/inc/vlc_decoder.h +0 -177
- package/openh264/codec/decoder/core/inc/wels_common_basis.h +0 -317
- package/openh264/codec/decoder/core/inc/wels_const.h +0 -65
- package/openh264/codec/decoder/core/inc/wels_decoder_thread.h +0 -170
- package/openh264/codec/decoder/core/loongarch/mb_aux_lsx.c +0 -296
- package/openh264/codec/decoder/core/mips/dct_mmi.c +0 -786
- package/openh264/codec/decoder/core/x86/dct.asm +0 -72
- package/openh264/codec/decoder/core/x86/intra_pred.asm +0 -1456
- package/openh264/codec/decoder/meson.build +0 -69
- package/openh264/codec/decoder/plus/inc/welsDecoderExt.h +0 -170
- package/openh264/codec/decoder/targets.mk +0 -115
- package/openh264/codec/encoder/core/arm/intra_pred_neon.S +0 -589
- package/openh264/codec/encoder/core/arm/intra_pred_sad_3_opt_neon.S +0 -735
- package/openh264/codec/encoder/core/arm/memory_neon.S +0 -62
- package/openh264/codec/encoder/core/arm/pixel_neon.S +0 -882
- package/openh264/codec/encoder/core/arm/reconstruct_neon.S +0 -903
- package/openh264/codec/encoder/core/arm/svc_motion_estimation.S +0 -366
- package/openh264/codec/encoder/core/arm64/intra_pred_aarch64_neon.S +0 -505
- package/openh264/codec/encoder/core/arm64/intra_pred_sad_3_opt_aarch64_neon.S +0 -611
- package/openh264/codec/encoder/core/arm64/memory_aarch64_neon.S +0 -63
- package/openh264/codec/encoder/core/arm64/pixel_aarch64_neon.S +0 -621
- package/openh264/codec/encoder/core/arm64/reconstruct_aarch64_neon.S +0 -717
- package/openh264/codec/encoder/core/arm64/svc_motion_estimation_aarch64_neon.S +0 -350
- package/openh264/codec/encoder/core/inc/as264_common.h +0 -138
- package/openh264/codec/encoder/core/inc/au_set.h +0 -152
- package/openh264/codec/encoder/core/inc/deblocking.h +0 -92
- package/openh264/codec/encoder/core/inc/decode_mb_aux.h +0 -112
- package/openh264/codec/encoder/core/inc/dq_map.h +0 -58
- package/openh264/codec/encoder/core/inc/encode_mb_aux.h +0 -199
- package/openh264/codec/encoder/core/inc/encoder.h +0 -148
- package/openh264/codec/encoder/core/inc/encoder_context.h +0 -240
- package/openh264/codec/encoder/core/inc/extern.h +0 -124
- package/openh264/codec/encoder/core/inc/get_intra_predictor.h +0 -186
- package/openh264/codec/encoder/core/inc/mb_cache.h +0 -141
- package/openh264/codec/encoder/core/inc/md.h +0 -181
- package/openh264/codec/encoder/core/inc/mt_defs.h +0 -91
- package/openh264/codec/encoder/core/inc/mv_pred.h +0 -191
- package/openh264/codec/encoder/core/inc/nal_encap.h +0 -143
- package/openh264/codec/encoder/core/inc/param_svc.h +0 -576
- package/openh264/codec/encoder/core/inc/parameter_sets.h +0 -181
- package/openh264/codec/encoder/core/inc/paraset_strategy.h +0 -310
- package/openh264/codec/encoder/core/inc/picture.h +0 -137
- package/openh264/codec/encoder/core/inc/picture_handle.h +0 -66
- package/openh264/codec/encoder/core/inc/rc.h +0 -284
- package/openh264/codec/encoder/core/inc/ref_list_mgr_svc.h +0 -148
- package/openh264/codec/encoder/core/inc/sample.h +0 -154
- package/openh264/codec/encoder/core/inc/set_mb_syn_cabac.h +0 -127
- package/openh264/codec/encoder/core/inc/set_mb_syn_cavlc.h +0 -92
- package/openh264/codec/encoder/core/inc/slice.h +0 -212
- package/openh264/codec/encoder/core/inc/slice_multi_threading.h +0 -97
- package/openh264/codec/encoder/core/inc/stat.h +0 -102
- package/openh264/codec/encoder/core/inc/svc_base_layer_md.h +0 -102
- package/openh264/codec/encoder/core/inc/svc_enc_frame.h +0 -136
- package/openh264/codec/encoder/core/inc/svc_enc_golomb.h +0 -123
- package/openh264/codec/encoder/core/inc/svc_enc_macroblock.h +0 -82
- package/openh264/codec/encoder/core/inc/svc_enc_slice_segment.h +0 -212
- package/openh264/codec/encoder/core/inc/svc_encode_mb.h +0 -63
- package/openh264/codec/encoder/core/inc/svc_encode_slice.h +0 -184
- package/openh264/codec/encoder/core/inc/svc_mode_decision.h +0 -94
- package/openh264/codec/encoder/core/inc/svc_motion_estimate.h +0 -369
- package/openh264/codec/encoder/core/inc/svc_set_mb_syn.h +0 -70
- package/openh264/codec/encoder/core/inc/svc_set_mb_syn_cavlc.h +0 -67
- package/openh264/codec/encoder/core/inc/vlc_encoder.h +0 -92
- package/openh264/codec/encoder/core/inc/wels_common_basis.h +0 -160
- package/openh264/codec/encoder/core/inc/wels_const.h +0 -174
- package/openh264/codec/encoder/core/inc/wels_func_ptr_def.h +0 -300
- package/openh264/codec/encoder/core/inc/wels_preprocess.h +0 -251
- package/openh264/codec/encoder/core/inc/wels_task_base.h +0 -79
- package/openh264/codec/encoder/core/inc/wels_task_encoder.h +0 -142
- package/openh264/codec/encoder/core/inc/wels_task_management.h +0 -135
- package/openh264/codec/encoder/core/inc/wels_transpose_matrix.h +0 -58
- package/openh264/codec/encoder/core/loongarch/dct_lasx.c +0 -452
- package/openh264/codec/encoder/core/loongarch/get_intra_predictor_lsx.c +0 -166
- package/openh264/codec/encoder/core/loongarch/quant_lsx.c +0 -153
- package/openh264/codec/encoder/core/loongarch/sample_lasx.c +0 -87
- package/openh264/codec/encoder/core/loongarch/svc_motion_estimate_lsx.c +0 -104
- package/openh264/codec/encoder/core/mips/dct_mmi.c +0 -529
- package/openh264/codec/encoder/core/mips/quant_mmi.c +0 -553
- package/openh264/codec/encoder/core/mips/score_mmi.c +0 -324
- package/openh264/codec/encoder/core/x86/coeff.asm +0 -695
- package/openh264/codec/encoder/core/x86/dct.asm +0 -108
- package/openh264/codec/encoder/core/x86/intra_pred.asm +0 -1129
- package/openh264/codec/encoder/core/x86/matrix_transpose.asm +0 -395
- package/openh264/codec/encoder/core/x86/memzero.asm +0 -132
- package/openh264/codec/encoder/core/x86/quant.asm +0 -507
- package/openh264/codec/encoder/core/x86/sample_sc.asm +0 -1829
- package/openh264/codec/encoder/core/x86/score.asm +0 -363
- package/openh264/codec/encoder/meson.build +0 -98
- package/openh264/codec/encoder/plus/inc/welsEncoderExt.h +0 -129
- package/openh264/codec/encoder/targets.mk +0 -146
- package/openh264/codec/meson.build +0 -9
- package/openh264/codec/processing/interface/IWelsVP.h +0 -310
- package/openh264/codec/processing/meson.build +0 -71
- package/openh264/codec/processing/targets.mk +0 -117
- package/openh264/docs/doxygen/Doxyfile +0 -1865
- package/openh264/docs/doxygen/Home.rest +0 -25
- package/openh264/docs/doxygen/ISVCDecoder.rest +0 -19
- package/openh264/docs/doxygen/ISVCEncoder.rest +0 -16
- package/openh264/docs/doxygen/UsageExampleForDecoder.rest +0 -10
- package/openh264/docs/doxygen/UsageExampleForEncoder.rest +0 -15
- package/openh264/docs/doxygen2rst.py +0 -619
- package/openh264/gmpopenh264.info +0 -4
- package/openh264/gradlew +0 -172
- package/openh264/meson.build +0 -218
- package/openh264/meson_options.txt +0 -1
- package/openh264/module/RefCounted.h +0 -141
- package/openh264/module/gmp-openh264.cpp +0 -1196
- package/openh264/module/targets.mk +0 -14
- package/openh264/module/task_utils.h +0 -38
- package/openh264/module/task_utils.py +0 -207
- package/openh264/module/task_utils_generated.h +0 -2087
- package/openh264/openh264.def +0 -7
- package/openh264/openh264.pc.in +0 -10
- package/openh264/openh264.rc +0 -61
- package/openh264/openh264.rc.template +0 -61
- package/openh264/res/Adobe_PDF_sample_a_1024x768_50Frms.264 +0 -0
- package/openh264/res/BA1_FT_C.264 +0 -0
- package/openh264/res/BA1_Sony_D.jsv +0 -0
- package/openh264/res/BAMQ1_JVC_C.264 +0 -0
- package/openh264/res/BAMQ2_JVC_C.264 +0 -0
- package/openh264/res/BANM_MW_D.264 +0 -0
- package/openh264/res/BASQP1_Sony_C.jsv +0 -0
- package/openh264/res/BA_MW_D.264 +0 -0
- package/openh264/res/BA_MW_D_IDR_LOST.264 +0 -0
- package/openh264/res/BA_MW_D_P_LOST.264 +0 -0
- package/openh264/res/CI1_FT_B.264 +0 -0
- package/openh264/res/CI_MW_D.264 +0 -0
- package/openh264/res/CVFC1_Sony_C.jsv +0 -0
- package/openh264/res/CVPCMNL1_SVA_C.264 +0 -0
- package/openh264/res/CiscoVT2people_160x96_6fps.yuv +0 -1
- package/openh264/res/CiscoVT2people_320x192_12fps.yuv +0 -1
- package/openh264/res/Cisco_Absolute_Power_1280x720_30fps.yuv +0 -3607
- package/openh264/res/Cisco_Adobe_PDF_sample_a_1024x768_CAVLC_Bframe_9.264 +0 -0
- package/openh264/res/Cisco_Men_whisper_640x320_CABAC_Bframe_9.264 +0 -0
- package/openh264/res/Cisco_Men_whisper_640x320_CAVLC_Bframe_9.264 +0 -0
- package/openh264/res/Error_I_P.264 +0 -0
- package/openh264/res/LS_SVA_D.264 +0 -0
- package/openh264/res/MIDR_MW_D.264 +0 -0
- package/openh264/res/MPS_MW_A.264 +0 -0
- package/openh264/res/MR1_BT_A.h264 +0 -0
- package/openh264/res/MR1_MW_A.264 +0 -0
- package/openh264/res/MR2_MW_A.264 +0 -0
- package/openh264/res/MR2_TANDBERG_E.264 +0 -0
- package/openh264/res/NL1_Sony_D.jsv +0 -0
- package/openh264/res/NLMQ1_JVC_C.264 +0 -0
- package/openh264/res/NLMQ2_JVC_C.264 +0 -0
- package/openh264/res/NRF_MW_E.264 +0 -0
- package/openh264/res/QCIF_2P_I_allIPCM.264 +0 -0
- package/openh264/res/SVA_BA1_B.264 +0 -0
- package/openh264/res/SVA_BA2_D.264 +0 -0
- package/openh264/res/SVA_Base_B.264 +0 -0
- package/openh264/res/SVA_CL1_E.264 +0 -0
- package/openh264/res/SVA_FM1_E.264 +0 -0
- package/openh264/res/SVA_NL1_B.264 +0 -0
- package/openh264/res/SVA_NL2_E.264 +0 -0
- package/openh264/res/SarVui.264 +0 -0
- package/openh264/res/Static.264 +0 -0
- package/openh264/res/Static_152_100.yuv +0 -1
- package/openh264/res/VID_1280x544_cabac_temporal_direct.264 +0 -0
- package/openh264/res/VID_1280x544_cavlc_temporal_direct.264 +0 -0
- package/openh264/res/VID_1280x720_cabac_temporal_direct.264 +0 -0
- package/openh264/res/VID_1280x720_cavlc_temporal_direct.264 +0 -0
- package/openh264/res/VID_1920x1080_cabac_temporal_direct.264 +0 -0
- package/openh264/res/VID_1920x1080_cavlc_temporal_direct.264 +0 -0
- package/openh264/res/Zhling_1280x720.264 +0 -0
- package/openh264/res/jm_1080p_allslice.264 +0 -0
- package/openh264/res/sps_subsetsps_bothVUI.264 +0 -0
- package/openh264/res/test_cif_I_CABAC_PCM.264 +0 -0
- package/openh264/res/test_cif_I_CABAC_slice.264 +0 -0
- package/openh264/res/test_cif_P_CABAC_slice.264 +0 -0
- package/openh264/res/test_qcif_cabac.264 +0 -0
- package/openh264/res/test_scalinglist_jm.264 +0 -0
- package/openh264/res/test_vd_1d.264 +0 -0
- package/openh264/res/test_vd_rc.264 +0 -0
- package/openh264/run_Test.sh +0 -91
- package/openh264/settings.gradle +0 -4
- package/openh264/subprojects/gtest.wrap +0 -10
- package/openh264/testbin/AutoBuild_Windows_VS2008.bat +0 -59
- package/openh264/testbin/CmdLineExample.sh +0 -7
- package/openh264/testbin/CmdLineReadMe +0 -22
- package/openh264/testbin/layer2.cfg +0 -37
- package/openh264/testbin/layer2_arbitrary_res.cfg +0 -37
- package/openh264/testbin/layer2_vd.cfg +0 -38
- package/openh264/testbin/layer2_vd_rc.cfg +0 -38
- package/openh264/testbin/welsenc.cfg +0 -71
- package/openh264/testbin/welsenc_arbitrary_res.cfg +0 -70
- package/openh264/testbin/welsenc_ios.cfg +0 -71
- package/openh264/testbin/welsenc_vd_1d.cfg +0 -70
- package/openh264/testbin/welsenc_vd_rc.cfg +0 -69
- package/openh264/ut.def +0 -2
package/openh264/gradlew
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env sh
|
|
2
|
-
|
|
3
|
-
##############################################################################
|
|
4
|
-
##
|
|
5
|
-
## Gradle start up script for UN*X
|
|
6
|
-
##
|
|
7
|
-
##############################################################################
|
|
8
|
-
|
|
9
|
-
# Attempt to set APP_HOME
|
|
10
|
-
# Resolve links: $0 may be a link
|
|
11
|
-
PRG="$0"
|
|
12
|
-
# Need this for relative symlinks.
|
|
13
|
-
while [ -h "$PRG" ] ; do
|
|
14
|
-
ls=`ls -ld "$PRG"`
|
|
15
|
-
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
16
|
-
if expr "$link" : '/.*' > /dev/null; then
|
|
17
|
-
PRG="$link"
|
|
18
|
-
else
|
|
19
|
-
PRG=`dirname "$PRG"`"/$link"
|
|
20
|
-
fi
|
|
21
|
-
done
|
|
22
|
-
SAVED="`pwd`"
|
|
23
|
-
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
24
|
-
APP_HOME="`pwd -P`"
|
|
25
|
-
cd "$SAVED" >/dev/null
|
|
26
|
-
|
|
27
|
-
APP_NAME="Gradle"
|
|
28
|
-
APP_BASE_NAME=`basename "$0"`
|
|
29
|
-
|
|
30
|
-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
31
|
-
DEFAULT_JVM_OPTS=""
|
|
32
|
-
|
|
33
|
-
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
|
34
|
-
MAX_FD="maximum"
|
|
35
|
-
|
|
36
|
-
warn () {
|
|
37
|
-
echo "$*"
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
die () {
|
|
41
|
-
echo
|
|
42
|
-
echo "$*"
|
|
43
|
-
echo
|
|
44
|
-
exit 1
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
# OS specific support (must be 'true' or 'false').
|
|
48
|
-
cygwin=false
|
|
49
|
-
msys=false
|
|
50
|
-
darwin=false
|
|
51
|
-
nonstop=false
|
|
52
|
-
case "`uname`" in
|
|
53
|
-
CYGWIN* )
|
|
54
|
-
cygwin=true
|
|
55
|
-
;;
|
|
56
|
-
Darwin* )
|
|
57
|
-
darwin=true
|
|
58
|
-
;;
|
|
59
|
-
MINGW* )
|
|
60
|
-
msys=true
|
|
61
|
-
;;
|
|
62
|
-
NONSTOP* )
|
|
63
|
-
nonstop=true
|
|
64
|
-
;;
|
|
65
|
-
esac
|
|
66
|
-
|
|
67
|
-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
68
|
-
|
|
69
|
-
# Determine the Java command to use to start the JVM.
|
|
70
|
-
if [ -n "$JAVA_HOME" ] ; then
|
|
71
|
-
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
|
72
|
-
# IBM's JDK on AIX uses strange locations for the executables
|
|
73
|
-
JAVACMD="$JAVA_HOME/jre/sh/java"
|
|
74
|
-
else
|
|
75
|
-
JAVACMD="$JAVA_HOME/bin/java"
|
|
76
|
-
fi
|
|
77
|
-
if [ ! -x "$JAVACMD" ] ; then
|
|
78
|
-
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
|
79
|
-
|
|
80
|
-
Please set the JAVA_HOME variable in your environment to match the
|
|
81
|
-
location of your Java installation."
|
|
82
|
-
fi
|
|
83
|
-
else
|
|
84
|
-
JAVACMD="java"
|
|
85
|
-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
86
|
-
|
|
87
|
-
Please set the JAVA_HOME variable in your environment to match the
|
|
88
|
-
location of your Java installation."
|
|
89
|
-
fi
|
|
90
|
-
|
|
91
|
-
# Increase the maximum file descriptors if we can.
|
|
92
|
-
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
|
93
|
-
MAX_FD_LIMIT=`ulimit -H -n`
|
|
94
|
-
if [ $? -eq 0 ] ; then
|
|
95
|
-
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
|
96
|
-
MAX_FD="$MAX_FD_LIMIT"
|
|
97
|
-
fi
|
|
98
|
-
ulimit -n $MAX_FD
|
|
99
|
-
if [ $? -ne 0 ] ; then
|
|
100
|
-
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
|
101
|
-
fi
|
|
102
|
-
else
|
|
103
|
-
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
|
104
|
-
fi
|
|
105
|
-
fi
|
|
106
|
-
|
|
107
|
-
# For Darwin, add options to specify how the application appears in the dock
|
|
108
|
-
if $darwin; then
|
|
109
|
-
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
110
|
-
fi
|
|
111
|
-
|
|
112
|
-
# For Cygwin, switch paths to Windows format before running java
|
|
113
|
-
if $cygwin ; then
|
|
114
|
-
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
115
|
-
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
116
|
-
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
117
|
-
|
|
118
|
-
# We build the pattern for arguments to be converted via cygpath
|
|
119
|
-
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
120
|
-
SEP=""
|
|
121
|
-
for dir in $ROOTDIRSRAW ; do
|
|
122
|
-
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
123
|
-
SEP="|"
|
|
124
|
-
done
|
|
125
|
-
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
126
|
-
# Add a user-defined pattern to the cygpath arguments
|
|
127
|
-
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
128
|
-
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
129
|
-
fi
|
|
130
|
-
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
131
|
-
i=0
|
|
132
|
-
for arg in "$@" ; do
|
|
133
|
-
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
134
|
-
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
135
|
-
|
|
136
|
-
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
137
|
-
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
138
|
-
else
|
|
139
|
-
eval `echo args$i`="\"$arg\""
|
|
140
|
-
fi
|
|
141
|
-
i=$((i+1))
|
|
142
|
-
done
|
|
143
|
-
case $i in
|
|
144
|
-
(0) set -- ;;
|
|
145
|
-
(1) set -- "$args0" ;;
|
|
146
|
-
(2) set -- "$args0" "$args1" ;;
|
|
147
|
-
(3) set -- "$args0" "$args1" "$args2" ;;
|
|
148
|
-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
149
|
-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
150
|
-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
151
|
-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
152
|
-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
153
|
-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
154
|
-
esac
|
|
155
|
-
fi
|
|
156
|
-
|
|
157
|
-
# Escape application args
|
|
158
|
-
save () {
|
|
159
|
-
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
|
160
|
-
echo " "
|
|
161
|
-
}
|
|
162
|
-
APP_ARGS=$(save "$@")
|
|
163
|
-
|
|
164
|
-
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
|
165
|
-
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
|
166
|
-
|
|
167
|
-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
|
168
|
-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
|
169
|
-
cd "$(dirname "$0")"
|
|
170
|
-
fi
|
|
171
|
-
|
|
172
|
-
exec "$JAVACMD" "$@"
|
package/openh264/meson.build
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
project('openh264', ['c', 'cpp'],
|
|
2
|
-
version : '2.6.0',
|
|
3
|
-
meson_version : '>= 0.52',
|
|
4
|
-
default_options : [ 'warning_level=1',
|
|
5
|
-
'buildtype=debugoptimized' ])
|
|
6
|
-
|
|
7
|
-
major_version = '8'
|
|
8
|
-
|
|
9
|
-
cpp = meson.get_compiler('cpp')
|
|
10
|
-
|
|
11
|
-
inc = include_directories([
|
|
12
|
-
join_paths('codec', 'api', 'wels'),
|
|
13
|
-
join_paths('codec', 'common', 'inc'),
|
|
14
|
-
])
|
|
15
|
-
|
|
16
|
-
processing_inc = include_directories([
|
|
17
|
-
join_paths('codec', 'processing', 'interface'),
|
|
18
|
-
join_paths('codec', 'processing', 'src', 'common'),
|
|
19
|
-
join_paths('codec', 'processing', 'src', 'adaptivequantization'),
|
|
20
|
-
join_paths('codec', 'processing', 'src', 'downsample'),
|
|
21
|
-
join_paths('codec', 'processing', 'src', 'scrolldetection'),
|
|
22
|
-
join_paths('codec', 'processing', 'src', 'vaacalc'),
|
|
23
|
-
])
|
|
24
|
-
|
|
25
|
-
console_common_inc = include_directories([
|
|
26
|
-
join_paths('codec', 'console', 'common', 'inc')
|
|
27
|
-
])
|
|
28
|
-
|
|
29
|
-
decoder_inc = include_directories([
|
|
30
|
-
join_paths('codec', 'decoder', 'core', 'inc'),
|
|
31
|
-
join_paths('codec', 'decoder', 'plus', 'inc'),
|
|
32
|
-
])
|
|
33
|
-
|
|
34
|
-
encoder_inc = include_directories([
|
|
35
|
-
join_paths('codec', 'encoder', 'core', 'inc'),
|
|
36
|
-
join_paths('codec', 'encoder', 'plus', 'inc'),
|
|
37
|
-
])
|
|
38
|
-
|
|
39
|
-
system = host_machine.system()
|
|
40
|
-
cpu_family = host_machine.cpu_family()
|
|
41
|
-
|
|
42
|
-
supported_arguments = cpp.get_supported_arguments([
|
|
43
|
-
'-Wno-non-virtual-dtor',
|
|
44
|
-
'-Wunused-but-set-variable',
|
|
45
|
-
'-Wno-strict-aliasing'])
|
|
46
|
-
|
|
47
|
-
add_project_arguments(supported_arguments, language: 'cpp')
|
|
48
|
-
|
|
49
|
-
deps = [dependency('threads')]
|
|
50
|
-
c_args = []
|
|
51
|
-
cpp_args = []
|
|
52
|
-
asm_args = []
|
|
53
|
-
asm_inc = []
|
|
54
|
-
casm_inc = []
|
|
55
|
-
cpp_lib = '-lstdc++'
|
|
56
|
-
|
|
57
|
-
libm_dep = cpp.find_library('m', required : false)
|
|
58
|
-
deps += [libm_dep]
|
|
59
|
-
|
|
60
|
-
if ['linux', 'android', 'ios', 'darwin'].contains(system)
|
|
61
|
-
asm_format32 = 'elf'
|
|
62
|
-
asm_format64 = 'elf64'
|
|
63
|
-
if ['ios', 'darwin'].contains(system)
|
|
64
|
-
asm_format32 = 'macho32'
|
|
65
|
-
asm_format64 = 'macho64'
|
|
66
|
-
endif
|
|
67
|
-
if cpu_family == 'x86'
|
|
68
|
-
asm_format = asm_format32
|
|
69
|
-
asm_args += ['-DX86_32', '-DX86_32_PICASM', '-DHAVE_AVX2']
|
|
70
|
-
add_project_arguments('-DHAVE_AVX2', language: 'cpp')
|
|
71
|
-
add_project_arguments('-DHAVE_AVX2', '-DX86_ASM', '-DX86_32_ASM', language: 'c')
|
|
72
|
-
asm_inc = join_paths(meson.current_source_dir(), 'codec', 'common', 'x86', '')
|
|
73
|
-
elif cpu_family == 'x86_64'
|
|
74
|
-
asm_format = asm_format64
|
|
75
|
-
asm_args += ['-DUNIX64', '-DHAVE_AVX2']
|
|
76
|
-
add_project_arguments('-DHAVE_AVX2', language: 'cpp')
|
|
77
|
-
add_project_arguments('-DHAVE_AVX2', '-DX86_ASM', language: 'c')
|
|
78
|
-
asm_inc = join_paths(meson.current_source_dir(), 'codec', 'common', 'x86', '')
|
|
79
|
-
elif cpu_family == 'arm'
|
|
80
|
-
asm_format = asm_format32
|
|
81
|
-
add_project_arguments('-DHAVE_NEON', language: 'c')
|
|
82
|
-
add_project_arguments('-DHAVE_NEON', language: 'c')
|
|
83
|
-
casm_inc = include_directories(join_paths('codec', 'common', 'arm'))
|
|
84
|
-
elif cpu_family == 'aarch64'
|
|
85
|
-
asm_format = asm_format64
|
|
86
|
-
add_project_arguments('-DHAVE_NEON_AARCH64', language: 'c')
|
|
87
|
-
add_project_arguments('-DHAVE_NEON_AARCH64', language: 'cpp')
|
|
88
|
-
casm_inc = include_directories(join_paths('codec', 'common', 'arm64'))
|
|
89
|
-
elif cpu_family == 'loongarch32'
|
|
90
|
-
asm_format = asm_format32
|
|
91
|
-
add_project_arguments('-mlsx', '-DHAVE_LSX', '-mlasx', '-DHAVE_LASX', language: 'c')
|
|
92
|
-
add_project_arguments('-DHAVE_LSX', '-DHAVE_LASX', language: 'cpp')
|
|
93
|
-
casm_inc = include_directories(join_paths('codec', 'common', 'loongarch'))
|
|
94
|
-
elif cpu_family == 'loongarch64'
|
|
95
|
-
asm_format = asm_format64
|
|
96
|
-
add_project_arguments('-mlsx', '-DHAVE_LSX', '-mlasx', '-DHAVE_LASX', language: 'c')
|
|
97
|
-
add_project_arguments('-DHAVE_LSX', '-DHAVE_LASX', language: 'cpp')
|
|
98
|
-
casm_inc = include_directories(join_paths('codec', 'common', 'loongarch'))
|
|
99
|
-
elif cpu_family == 'riscv64'
|
|
100
|
-
# We don't have riscv64-specific optimization for now.
|
|
101
|
-
asm_format = asm_format64
|
|
102
|
-
elif cpu_family == 'ppc'
|
|
103
|
-
# We don't have powerpc-specific optimization for now.
|
|
104
|
-
asm_format = asm_format32
|
|
105
|
-
elif cpu_family == 'ppc64'
|
|
106
|
-
# We don't have powerpc64-specific optimization for now.
|
|
107
|
-
asm_format = asm_format64
|
|
108
|
-
else
|
|
109
|
-
error('FIXME: unhandled CPU family @0@ for @1@'.format(cpu_family, system))
|
|
110
|
-
endif
|
|
111
|
-
|
|
112
|
-
if ['ios', 'darwin', 'android'].contains(system)
|
|
113
|
-
cpp_lib = '-lc++'
|
|
114
|
-
endif
|
|
115
|
-
elif system == 'windows'
|
|
116
|
-
if cpu_family == 'x86'
|
|
117
|
-
asm_format = 'win32'
|
|
118
|
-
asm_args += ['-DPREFIX', '-DX86_32']
|
|
119
|
-
asm_inc = join_paths(meson.current_source_dir(), 'codec', 'common', 'x86', '')
|
|
120
|
-
elif cpu_family == 'x86_64'
|
|
121
|
-
asm_format = 'win64'
|
|
122
|
-
asm_args += ['-DWIN64']
|
|
123
|
-
asm_inc = join_paths(meson.current_source_dir(), 'codec', 'common', 'x86', '')
|
|
124
|
-
elif cpu_family == 'arm'
|
|
125
|
-
if cpp.get_argument_syntax() == 'msvc'
|
|
126
|
-
asm_format = 'armasm'
|
|
127
|
-
asm_args += ['-nologo', '-DHAVE_NEON', '-ignore', '4509']
|
|
128
|
-
asm_cmds = ['armasm']
|
|
129
|
-
else
|
|
130
|
-
asm_format = 'clang'
|
|
131
|
-
asm_args += ['-DHAVE_NEON', '-mimplicit-it=always']
|
|
132
|
-
asm_cmds = cpp.cmd_array()
|
|
133
|
-
endif
|
|
134
|
-
asm_inc = join_paths(meson.current_source_dir(), 'codec', 'common', 'arm', '')
|
|
135
|
-
elif cpu_family == 'aarch64'
|
|
136
|
-
asm_format = 'armasm'
|
|
137
|
-
asm_args += ['-nologo', '-DHAVE_NEON_AARCH64']
|
|
138
|
-
asm_inc = join_paths(meson.current_source_dir(), 'codec', 'common', 'arm64', '')
|
|
139
|
-
else
|
|
140
|
-
error('FIXME: unhandled CPU family @0@ for Windows'.format(cpu_family))
|
|
141
|
-
endif
|
|
142
|
-
else
|
|
143
|
-
error('FIXME: Unhandled system @0@'.format(system))
|
|
144
|
-
endif
|
|
145
|
-
|
|
146
|
-
use_asm_gen = false
|
|
147
|
-
if cpu_family in ['x86', 'x86_64']
|
|
148
|
-
nasm = find_program('nasm')
|
|
149
|
-
|
|
150
|
-
use_asm_gen = true
|
|
151
|
-
asm_gen = generator(nasm,
|
|
152
|
-
output : '@BASENAME@.o',
|
|
153
|
-
arguments : [
|
|
154
|
-
'-f', asm_format,
|
|
155
|
-
'-i', asm_inc,
|
|
156
|
-
'@INPUT@',
|
|
157
|
-
'-o', '@OUTPUT@'] + asm_args)
|
|
158
|
-
elif system == 'windows'
|
|
159
|
-
if cpu_family == 'arm'
|
|
160
|
-
# For ARM, gas-preprocessor is needed for converting the asm to be
|
|
161
|
-
# buildable as thumb even with Clang.
|
|
162
|
-
use_asm_gen = true
|
|
163
|
-
gasprep = find_program('gas-preprocessor.pl')
|
|
164
|
-
asm_gen = generator(gasprep,
|
|
165
|
-
output : '@BASENAME@.obj',
|
|
166
|
-
arguments : [
|
|
167
|
-
'-as-type', asm_format,
|
|
168
|
-
'-force-thumb',
|
|
169
|
-
'--'
|
|
170
|
-
] + asm_cmds + [
|
|
171
|
-
'-I' + asm_inc] + asm_args + [
|
|
172
|
-
'@INPUT@',
|
|
173
|
-
'-c', '-o', '@OUTPUT@'])
|
|
174
|
-
elif cpu_family == 'aarch64'
|
|
175
|
-
# For ARM64, Clang can build the assembly as-is without needing to use
|
|
176
|
-
# either gas-preprocessor or armasm64.
|
|
177
|
-
if cpp.get_argument_syntax() == 'msvc' and (cpp.get_id() != 'clang-cl' or meson.version().version_compare('<0.58.0'))
|
|
178
|
-
use_asm_gen = true
|
|
179
|
-
gasprep = find_program('gas-preprocessor.pl')
|
|
180
|
-
asm_gen = generator(gasprep,
|
|
181
|
-
output : '@BASENAME@.obj',
|
|
182
|
-
arguments : [
|
|
183
|
-
'-as-type', asm_format,
|
|
184
|
-
'-arch', 'aarch64',
|
|
185
|
-
'--',
|
|
186
|
-
'armasm64',
|
|
187
|
-
'-I' + asm_inc] + asm_args + [
|
|
188
|
-
'@INPUT@',
|
|
189
|
-
'-c', '-o', '@OUTPUT@'])
|
|
190
|
-
endif
|
|
191
|
-
else
|
|
192
|
-
# Windows only supports x86, x86_64, arm, arm64
|
|
193
|
-
error('unreachable code')
|
|
194
|
-
endif
|
|
195
|
-
endif
|
|
196
|
-
|
|
197
|
-
subdir ('codec')
|
|
198
|
-
subdir ('test')
|
|
199
|
-
|
|
200
|
-
libopenh264 = library('openh264',
|
|
201
|
-
link_whole: [libcommon, libprocessing, libencoder, libdecoder],
|
|
202
|
-
install: true,
|
|
203
|
-
soversion: major_version,
|
|
204
|
-
version: meson.project_version(),
|
|
205
|
-
vs_module_defs: 'openh264.def',
|
|
206
|
-
dependencies: deps)
|
|
207
|
-
|
|
208
|
-
openh264_dep = declare_dependency(
|
|
209
|
-
link_with: libopenh264,
|
|
210
|
-
include_directories: include_directories('codec/api'),
|
|
211
|
-
dependencies: deps)
|
|
212
|
-
|
|
213
|
-
pkg = import('pkgconfig')
|
|
214
|
-
pkg.generate(libopenh264,
|
|
215
|
-
description: 'OpenH264 is a codec library which supports H.264 encoding ' +
|
|
216
|
-
'and decoding. It is suitable for use in real time ' +
|
|
217
|
-
'applications such as WebRTC.',
|
|
218
|
-
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
option('tests', type : 'feature', value : 'auto', yield : true)
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2015, Mozilla Foundation and contributors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
#ifndef __RefCount_h__
|
|
18
|
-
#define __RefCount_h__
|
|
19
|
-
|
|
20
|
-
#include <stdint.h>
|
|
21
|
-
#include <assert.h>
|
|
22
|
-
|
|
23
|
-
extern GMPPlatformAPI* g_platform_api;
|
|
24
|
-
|
|
25
|
-
inline GMPMutex* GMPCreateMutex() {
|
|
26
|
-
GMPMutex* mutex;
|
|
27
|
-
if (!g_platform_api) {
|
|
28
|
-
return nullptr;
|
|
29
|
-
}
|
|
30
|
-
GMPErr err = g_platform_api->createmutex(&mutex);
|
|
31
|
-
assert(mutex);
|
|
32
|
-
return GMP_FAILED(err) ? nullptr : mutex;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
class AutoLock {
|
|
36
|
-
public:
|
|
37
|
-
explicit AutoLock(GMPMutex* aMutex)
|
|
38
|
-
: mMutex(aMutex)
|
|
39
|
-
{
|
|
40
|
-
assert(aMutex);
|
|
41
|
-
if (mMutex) {
|
|
42
|
-
mMutex->Acquire();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
~AutoLock() {
|
|
46
|
-
if (mMutex) {
|
|
47
|
-
mMutex->Release();
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
private:
|
|
51
|
-
GMPMutex* mMutex;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
class AtomicRefCount {
|
|
55
|
-
public:
|
|
56
|
-
explicit AtomicRefCount(uint32_t aValue)
|
|
57
|
-
: mCount(aValue)
|
|
58
|
-
, mMutex(GMPCreateMutex())
|
|
59
|
-
{
|
|
60
|
-
assert(mMutex);
|
|
61
|
-
}
|
|
62
|
-
~AtomicRefCount()
|
|
63
|
-
{
|
|
64
|
-
if (mMutex) {
|
|
65
|
-
mMutex->Destroy();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
uint32_t operator--() {
|
|
69
|
-
AutoLock lock(mMutex);
|
|
70
|
-
return --mCount;
|
|
71
|
-
}
|
|
72
|
-
uint32_t operator++() {
|
|
73
|
-
AutoLock lock(mMutex);
|
|
74
|
-
return ++mCount;
|
|
75
|
-
}
|
|
76
|
-
operator uint32_t() {
|
|
77
|
-
AutoLock lock(mMutex);
|
|
78
|
-
return mCount;
|
|
79
|
-
}
|
|
80
|
-
private:
|
|
81
|
-
uint32_t mCount;
|
|
82
|
-
GMPMutex* mMutex;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// Note: Thread safe.
|
|
86
|
-
class RefCounted {
|
|
87
|
-
public:
|
|
88
|
-
void AddRef() {
|
|
89
|
-
++mRefCount;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
uint32_t Release() {
|
|
93
|
-
uint32_t newCount = --mRefCount;
|
|
94
|
-
if (!newCount) {
|
|
95
|
-
delete this;
|
|
96
|
-
}
|
|
97
|
-
return newCount;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
protected:
|
|
101
|
-
RefCounted()
|
|
102
|
-
: mRefCount(0)
|
|
103
|
-
{
|
|
104
|
-
}
|
|
105
|
-
virtual ~RefCounted()
|
|
106
|
-
{
|
|
107
|
-
assert(!mRefCount);
|
|
108
|
-
}
|
|
109
|
-
AtomicRefCount mRefCount;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
template<class T>
|
|
113
|
-
class RefPtr {
|
|
114
|
-
public:
|
|
115
|
-
explicit RefPtr(T* aPtr) : mPtr(nullptr) {
|
|
116
|
-
Assign(aPtr);
|
|
117
|
-
}
|
|
118
|
-
~RefPtr() {
|
|
119
|
-
Assign(nullptr);
|
|
120
|
-
}
|
|
121
|
-
T* operator->() const { return mPtr; }
|
|
122
|
-
|
|
123
|
-
RefPtr& operator=(T* aVal) {
|
|
124
|
-
Assign(aVal);
|
|
125
|
-
return *this;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
private:
|
|
129
|
-
void Assign(T* aPtr) {
|
|
130
|
-
if (mPtr) {
|
|
131
|
-
mPtr->Release();
|
|
132
|
-
}
|
|
133
|
-
mPtr = aPtr;
|
|
134
|
-
if (mPtr) {
|
|
135
|
-
aPtr->AddRef();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
T* mPtr;
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
#endif // __RefCount_h__
|