react-native-alpha-video 0.0.0-stage → 1.0.0
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/LICENSE +21 -0
- package/README.md +903 -2
- package/THIRD_PARTY_NOTICES.md +30 -0
- package/android/av1/build.gradle +67 -0
- package/android/av1/consumer-rules.pro +4 -0
- package/android/av1/src/main/cpp/Av1Codec_jni.cpp +8 -0
- package/android/av1/src/main/cpp/CMakeLists.txt +34 -0
- package/android/av1/src/main/java/dev/mediacache/alphavideo/av1/Av1Codec.java +21 -0
- package/android/build.gradle +85 -0
- package/android/consumer-rules.pro +2 -0
- package/android/gradle.properties +1 -0
- package/android/publish.gradle +82 -0
- package/android/settings.gradle +5 -0
- package/android/src/main/AndroidManifest.xml +1 -0
- package/android/src/main/cpp/CMakeLists.txt +59 -0
- package/android/src/main/java/dev/mediacache/alphavideo/AlphaVideoCodecs.java +73 -0
- package/android/src/main/java/dev/mediacache/alphavideo/AlphaVideoView.java +1966 -0
- package/android/src/main/java/dev/mediacache/alphavideo/BufferedDualStreamPlayer.java +978 -0
- package/android/src/main/java/dev/mediacache/alphavideo/Fetcher.java +37 -0
- package/android/src/main/java/dev/mediacache/alphavideo/HttpFetcher.java +156 -0
- package/android/src/main/java/dev/mediacache/alphavideo/MediaCodecColor.java +47 -0
- package/android/src/main/java/dev/mediacache/alphavideo/MediaCodecDecoders.java +135 -0
- package/android/src/main/java/dev/mediacache/alphavideo/RangeSourceLink.java +54 -0
- package/android/src/main/java/dev/mediacache/alphavideo/SourceReader.java +174 -0
- package/android/src/main/java/dev/mediacache/alphavideo/SurfaceTextureVideoDecoder.java +802 -0
- package/android/src/main/java/dev/mediacache/alphavideo/WebMAlphaPlayerNative.java +95 -0
- package/android/src/main/java/dev/mediacache/alphavideo/WebMFrame.java +54 -0
- package/android/src/main/java/dev/mediacache/alphavideo/WebMSource.java +160 -0
- package/android/src/rangesource/java/dev/mediacache/alphavideo/AppDataSource.java +50 -0
- package/android/vpx/build.gradle +67 -0
- package/android/vpx/consumer-rules.pro +4 -0
- package/android/vpx/src/main/cpp/CMakeLists.txt +34 -0
- package/android/vpx/src/main/cpp/VpxCodec_jni.cpp +8 -0
- package/android/vpx/src/main/java/dev/mediacache/alphavideo/vpx/VpxCodec.java +21 -0
- package/codecs/av1/Dav1dDecoderPlugin.cpp +157 -0
- package/codecs/av1/Dav1dDecoderPlugin.h +17 -0
- package/codecs/vpx/VpxDecoderPlugin.cpp +103 -0
- package/codecs/vpx/VpxDecoderPlugin.h +17 -0
- package/cpp/AlphaDemuxer.cpp +984 -0
- package/cpp/AlphaDemuxer.h +123 -0
- package/cpp/AlphaVideoDecoderPlugin.h +84 -0
- package/cpp/Av1SequenceHeader.cpp +175 -0
- package/cpp/Av1SequenceHeader.h +25 -0
- package/cpp/ByteSource.cpp +116 -0
- package/cpp/ByteSource.h +59 -0
- package/cpp/RangeSourceClient.h +40 -0
- package/cpp/VideoDecoder.cpp +157 -0
- package/cpp/VideoDecoder.h +83 -0
- package/cpp/WebMAlphaPlayer.cpp +1666 -0
- package/cpp/WebMAlphaPlayer.h +389 -0
- package/cpp/WebMAlphaPlayer_jni.cpp +1380 -0
- package/cpp/YuvToRgb.cpp +39 -0
- package/cpp/YuvToRgb.h +40 -0
- package/ios/Sources/AlphaVideo/AlphaVideoCodecs.mm +63 -0
- package/ios/Sources/AlphaVideo/AlphaVideoInternal.h +70 -0
- package/ios/Sources/AlphaVideo/AlphaVideoPlayer.mm +994 -0
- package/ios/Sources/AlphaVideo/AlphaVideoSource.mm +476 -0
- package/ios/Sources/AlphaVideo/AlphaVideoView.mm +374 -0
- package/ios/Sources/AlphaVideo/include/AlphaVideo.h +303 -0
- package/ios/Sources/AlphaVideoAV1/AlphaVideoAV1Codec.mm +16 -0
- package/ios/Sources/AlphaVideoAV1/include/AlphaVideoAV1.h +18 -0
- package/ios/Sources/AlphaVideoVPX/AlphaVideoVPXCodec.mm +16 -0
- package/ios/Sources/AlphaVideoVPX/include/AlphaVideoVPX.h +17 -0
- package/lib/commonjs/AlphaVideoView.js +187 -0
- package/lib/commonjs/AlphaVideoView.js.map +1 -0
- package/lib/commonjs/AlphaVideoViewNativeComponent.js +47 -0
- package/lib/commonjs/AlphaVideoViewNativeComponent.js.map +1 -0
- package/lib/commonjs/AlphaVideoViewNativeComponent.web.js +11 -0
- package/lib/commonjs/AlphaVideoViewNativeComponent.web.js.map +1 -0
- package/lib/commonjs/NativeAlphaVideoModule.js +10 -0
- package/lib/commonjs/NativeAlphaVideoModule.js.map +1 -0
- package/lib/commonjs/NativeAlphaVideoModule.web.js +9 -0
- package/lib/commonjs/NativeAlphaVideoModule.web.js.map +1 -0
- package/lib/commonjs/WebPlayer.js +12 -0
- package/lib/commonjs/WebPlayer.js.map +1 -0
- package/lib/commonjs/WebPlayer.web.js +92 -0
- package/lib/commonjs/WebPlayer.web.js.map +1 -0
- package/lib/commonjs/index.js +124 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/AlphaVideoView.js +187 -0
- package/lib/module/AlphaVideoView.js.map +1 -0
- package/lib/module/AlphaVideoViewNativeComponent.js +47 -0
- package/lib/module/AlphaVideoViewNativeComponent.js.map +1 -0
- package/lib/module/AlphaVideoViewNativeComponent.web.js +11 -0
- package/lib/module/AlphaVideoViewNativeComponent.web.js.map +1 -0
- package/lib/module/NativeAlphaVideoModule.js +10 -0
- package/lib/module/NativeAlphaVideoModule.js.map +1 -0
- package/lib/module/NativeAlphaVideoModule.web.js +9 -0
- package/lib/module/NativeAlphaVideoModule.web.js.map +1 -0
- package/lib/module/WebPlayer.js +12 -0
- package/lib/module/WebPlayer.js.map +1 -0
- package/lib/module/WebPlayer.web.js +92 -0
- package/lib/module/WebPlayer.web.js.map +1 -0
- package/lib/module/index.js +124 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/react-native/src/AlphaVideoView.d.ts +189 -0
- package/lib/typescript/react-native/src/AlphaVideoView.d.ts.map +1 -0
- package/lib/typescript/react-native/src/AlphaVideoViewNativeComponent.d.ts +109 -0
- package/lib/typescript/react-native/src/AlphaVideoViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/react-native/src/AlphaVideoViewNativeComponent.web.d.ts +5 -0
- package/lib/typescript/react-native/src/AlphaVideoViewNativeComponent.web.d.ts.map +1 -0
- package/lib/typescript/react-native/src/NativeAlphaVideoModule.d.ts +21 -0
- package/lib/typescript/react-native/src/NativeAlphaVideoModule.d.ts.map +1 -0
- package/lib/typescript/react-native/src/NativeAlphaVideoModule.web.d.ts +3 -0
- package/lib/typescript/react-native/src/NativeAlphaVideoModule.web.d.ts.map +1 -0
- package/lib/typescript/react-native/src/WebPlayer.d.ts +3 -0
- package/lib/typescript/react-native/src/WebPlayer.d.ts.map +1 -0
- package/lib/typescript/react-native/src/WebPlayer.web.d.ts +9 -0
- package/lib/typescript/react-native/src/WebPlayer.web.d.ts.map +1 -0
- package/lib/typescript/react-native/src/index.d.ts +77 -0
- package/lib/typescript/react-native/src/index.d.ts.map +1 -0
- package/licenses/dav1d-COPYING.txt +23 -0
- package/licenses/libvpx-LICENSE.txt +31 -0
- package/licenses/libvpx-PATENTS.txt +23 -0
- package/licenses/libwebm-LICENSE.txt +30 -0
- package/licenses/libwebm-PATENTS.txt +23 -0
- package/package.json +150 -4
- package/prebuilt/android/arm64-v8a/lib/libdav1d.a +0 -0
- package/prebuilt/android/arm64-v8a/lib/libvpx.a +0 -0
- package/prebuilt/android/armeabi-v7a/lib/libdav1d.a +0 -0
- package/prebuilt/android/armeabi-v7a/lib/libvpx.a +0 -0
- package/prebuilt/android/x86_64/lib/libdav1d.a +0 -0
- package/prebuilt/android/x86_64/lib/libvpx.a +0 -0
- package/prebuilt/include/dav1d/common.h +94 -0
- package/prebuilt/include/dav1d/data.h +117 -0
- package/prebuilt/include/dav1d/dav1d.h +329 -0
- package/prebuilt/include/dav1d/headers.h +440 -0
- package/prebuilt/include/dav1d/picture.h +157 -0
- package/prebuilt/include/dav1d/version.h +50 -0
- package/prebuilt/include/vpx/vp8.h +136 -0
- package/prebuilt/include/vpx/vp8dx.h +228 -0
- package/prebuilt/include/vpx/vpx_codec.h +475 -0
- package/prebuilt/include/vpx/vpx_decoder.h +365 -0
- package/prebuilt/include/vpx/vpx_frame_buffer.h +83 -0
- package/prebuilt/include/vpx/vpx_image.h +209 -0
- package/prebuilt/include/vpx/vpx_integer.h +40 -0
- package/prebuilt/ios/lib/libdav1d.a +0 -0
- package/prebuilt/ios/lib/libvpx.a +0 -0
- package/prebuilt/ios-simulator/include/dav1d/common.h +94 -0
- package/prebuilt/ios-simulator/include/dav1d/data.h +117 -0
- package/prebuilt/ios-simulator/include/dav1d/dav1d.h +329 -0
- package/prebuilt/ios-simulator/include/dav1d/headers.h +440 -0
- package/prebuilt/ios-simulator/include/dav1d/picture.h +157 -0
- package/prebuilt/ios-simulator/include/dav1d/version.h +50 -0
- package/prebuilt/ios-simulator/include/vpx/vp8.h +136 -0
- package/prebuilt/ios-simulator/include/vpx/vp8dx.h +228 -0
- package/prebuilt/ios-simulator/include/vpx/vpx_codec.h +475 -0
- package/prebuilt/ios-simulator/include/vpx/vpx_decoder.h +365 -0
- package/prebuilt/ios-simulator/include/vpx/vpx_frame_buffer.h +83 -0
- package/prebuilt/ios-simulator/include/vpx/vpx_image.h +209 -0
- package/prebuilt/ios-simulator/include/vpx/vpx_integer.h +40 -0
- package/prebuilt/ios-simulator/lib/libdav1d.a +0 -0
- package/prebuilt/ios-simulator/lib/libvpx.a +0 -0
- package/react-native/android/CMakeLists.txt +14 -0
- package/react-native/android/build.gradle +110 -0
- package/react-native/android/src/main/AndroidManifest.xml +1 -0
- package/react-native/android/src/main/java/dev/mediacache/alphavideo/reactnative/AlphaVideoModule.java +102 -0
- package/react-native/android/src/main/java/dev/mediacache/alphavideo/reactnative/AlphaVideoPackage.java +50 -0
- package/react-native/android/src/main/java/dev/mediacache/alphavideo/reactnative/AlphaVideoViewManager.java +317 -0
- package/react-native/android/src/newarch/java/dev/mediacache/alphavideo/reactnative/AlphaVideoModuleSpec.java +10 -0
- package/react-native/android/src/newarch/java/dev/mediacache/alphavideo/reactnative/AlphaVideoViewManagerSpec.java +23 -0
- package/react-native/android/src/norangesource/java/dev/mediacache/alphavideo/AppDataSource.java +15 -0
- package/react-native/android/src/oldarch/java/dev/mediacache/alphavideo/reactnative/AlphaVideoModuleSpec.java +30 -0
- package/react-native/android/src/oldarch/java/dev/mediacache/alphavideo/reactnative/AlphaVideoViewManagerSpec.java +61 -0
- package/react-native/ios/RNAlphaVideoViewComponentView.mm +173 -0
- package/react-native/ios/RNAlphaVideoViewManager.mm +147 -0
- package/react-native/src/AlphaVideoView.tsx +329 -0
- package/react-native/src/AlphaVideoViewNativeComponent.ts +132 -0
- package/react-native/src/AlphaVideoViewNativeComponent.web.ts +5 -0
- package/react-native/src/NativeAlphaVideoModule.ts +22 -0
- package/react-native/src/NativeAlphaVideoModule.web.ts +2 -0
- package/react-native/src/WebPlayer.tsx +7 -0
- package/react-native/src/WebPlayer.web.tsx +60 -0
- package/react-native/src/index.tsx +144 -0
- package/react-native-alpha-video.podspec +99 -0
- package/react-native.config.js +12 -0
- package/scripts/build_codecs_android.sh +246 -0
- package/scripts/build_codecs_ios.sh +31 -0
- package/scripts/build_codecs_ios_device.sh +210 -0
- package/scripts/build_codecs_ios_simulator.sh +256 -0
- package/scripts/build_wasm.sh +230 -0
- package/scripts/build_xcframework.sh +49 -0
- package/scripts/fetch-prebuilt.sh +48 -0
- package/scripts/package_release.sh +107 -0
- package/scripts/publish-android.sh +85 -0
- package/scripts/vendor_range_source.sh +47 -0
- package/third_party/libwebm/AUTHORS.TXT +5 -0
- package/third_party/libwebm/LICENSE.TXT +30 -0
- package/third_party/libwebm/PATENTS.TXT +23 -0
- package/third_party/libwebm/README.md +7 -0
- package/third_party/libwebm/webm_parser/include/webm/buffer_reader.h +138 -0
- package/third_party/libwebm/webm_parser/include/webm/callback.h +363 -0
- package/third_party/libwebm/webm_parser/include/webm/dom_types.h +1781 -0
- package/third_party/libwebm/webm_parser/include/webm/element.h +208 -0
- package/third_party/libwebm/webm_parser/include/webm/file_reader.h +103 -0
- package/third_party/libwebm/webm_parser/include/webm/id.h +1085 -0
- package/third_party/libwebm/webm_parser/include/webm/istream_reader.h +99 -0
- package/third_party/libwebm/webm_parser/include/webm/reader.h +94 -0
- package/third_party/libwebm/webm_parser/include/webm/status.h +166 -0
- package/third_party/libwebm/webm_parser/include/webm/webm_parser.h +133 -0
- package/third_party/libwebm/webm_parser/src/ancestory.cc +334 -0
- package/third_party/libwebm/webm_parser/src/ancestory.h +83 -0
- package/third_party/libwebm/webm_parser/src/audio_parser.h +84 -0
- package/third_party/libwebm/webm_parser/src/bit_utils.cc +26 -0
- package/third_party/libwebm/webm_parser/src/bit_utils.h +24 -0
- package/third_party/libwebm/webm_parser/src/block_additions_parser.h +30 -0
- package/third_party/libwebm/webm_parser/src/block_group_parser.h +71 -0
- package/third_party/libwebm/webm_parser/src/block_header_parser.cc +76 -0
- package/third_party/libwebm/webm_parser/src/block_header_parser.h +65 -0
- package/third_party/libwebm/webm_parser/src/block_more_parser.h +32 -0
- package/third_party/libwebm/webm_parser/src/block_parser.cc +285 -0
- package/third_party/libwebm/webm_parser/src/block_parser.h +126 -0
- package/third_party/libwebm/webm_parser/src/bool_parser.h +95 -0
- package/third_party/libwebm/webm_parser/src/buffer_reader.cc +110 -0
- package/third_party/libwebm/webm_parser/src/byte_parser.h +144 -0
- package/third_party/libwebm/webm_parser/src/callback.cc +155 -0
- package/third_party/libwebm/webm_parser/src/chapter_atom_parser.h +42 -0
- package/third_party/libwebm/webm_parser/src/chapter_display_parser.h +34 -0
- package/third_party/libwebm/webm_parser/src/chapters_parser.h +28 -0
- package/third_party/libwebm/webm_parser/src/cluster_parser.h +48 -0
- package/third_party/libwebm/webm_parser/src/colour_parser.h +55 -0
- package/third_party/libwebm/webm_parser/src/content_enc_aes_settings_parser.h +32 -0
- package/third_party/libwebm/webm_parser/src/content_encoding_parser.h +38 -0
- package/third_party/libwebm/webm_parser/src/content_encodings_parser.h +30 -0
- package/third_party/libwebm/webm_parser/src/content_encryption_parser.h +37 -0
- package/third_party/libwebm/webm_parser/src/cue_point_parser.h +38 -0
- package/third_party/libwebm/webm_parser/src/cue_track_positions_parser.h +39 -0
- package/third_party/libwebm/webm_parser/src/cues_parser.h +27 -0
- package/third_party/libwebm/webm_parser/src/date_parser.cc +72 -0
- package/third_party/libwebm/webm_parser/src/date_parser.h +64 -0
- package/third_party/libwebm/webm_parser/src/ebml_parser.h +48 -0
- package/third_party/libwebm/webm_parser/src/edition_entry_parser.h +35 -0
- package/third_party/libwebm/webm_parser/src/element_parser.h +102 -0
- package/third_party/libwebm/webm_parser/src/file_reader.cc +142 -0
- package/third_party/libwebm/webm_parser/src/float_parser.cc +77 -0
- package/third_party/libwebm/webm_parser/src/float_parser.h +65 -0
- package/third_party/libwebm/webm_parser/src/id_element_parser.cc +49 -0
- package/third_party/libwebm/webm_parser/src/id_element_parser.h +56 -0
- package/third_party/libwebm/webm_parser/src/id_parser.cc +75 -0
- package/third_party/libwebm/webm_parser/src/id_parser.h +45 -0
- package/third_party/libwebm/webm_parser/src/info_parser.h +44 -0
- package/third_party/libwebm/webm_parser/src/int_parser.h +121 -0
- package/third_party/libwebm/webm_parser/src/istream_reader.cc +133 -0
- package/third_party/libwebm/webm_parser/src/master_parser.cc +298 -0
- package/third_party/libwebm/webm_parser/src/master_parser.h +230 -0
- package/third_party/libwebm/webm_parser/src/master_value_parser.h +533 -0
- package/third_party/libwebm/webm_parser/src/mastering_metadata_parser.h +57 -0
- package/third_party/libwebm/webm_parser/src/parser.h +34 -0
- package/third_party/libwebm/webm_parser/src/parser_utils.cc +34 -0
- package/third_party/libwebm/webm_parser/src/parser_utils.h +64 -0
- package/third_party/libwebm/webm_parser/src/projection_parser.h +40 -0
- package/third_party/libwebm/webm_parser/src/recursive_parser.h +93 -0
- package/third_party/libwebm/webm_parser/src/seek_head_parser.h +27 -0
- package/third_party/libwebm/webm_parser/src/seek_parser.h +37 -0
- package/third_party/libwebm/webm_parser/src/segment_parser.cc +86 -0
- package/third_party/libwebm/webm_parser/src/segment_parser.h +53 -0
- package/third_party/libwebm/webm_parser/src/simple_tag_parser.h +37 -0
- package/third_party/libwebm/webm_parser/src/size_parser.cc +56 -0
- package/third_party/libwebm/webm_parser/src/size_parser.h +43 -0
- package/third_party/libwebm/webm_parser/src/skip_callback.h +63 -0
- package/third_party/libwebm/webm_parser/src/skip_parser.cc +59 -0
- package/third_party/libwebm/webm_parser/src/skip_parser.h +35 -0
- package/third_party/libwebm/webm_parser/src/slices_parser.h +30 -0
- package/third_party/libwebm/webm_parser/src/tag_parser.h +37 -0
- package/third_party/libwebm/webm_parser/src/tags_parser.h +27 -0
- package/third_party/libwebm/webm_parser/src/targets_parser.h +35 -0
- package/third_party/libwebm/webm_parser/src/time_slice_parser.h +30 -0
- package/third_party/libwebm/webm_parser/src/track_entry_parser.h +65 -0
- package/third_party/libwebm/webm_parser/src/tracks_parser.h +27 -0
- package/third_party/libwebm/webm_parser/src/unknown_parser.cc +49 -0
- package/third_party/libwebm/webm_parser/src/unknown_parser.h +38 -0
- package/third_party/libwebm/webm_parser/src/var_int_parser.cc +71 -0
- package/third_party/libwebm/webm_parser/src/var_int_parser.h +56 -0
- package/third_party/libwebm/webm_parser/src/video_parser.h +122 -0
- package/third_party/libwebm/webm_parser/src/virtual_block_parser.cc +72 -0
- package/third_party/libwebm/webm_parser/src/virtual_block_parser.h +69 -0
- package/third_party/libwebm/webm_parser/src/void_parser.cc +49 -0
- package/third_party/libwebm/webm_parser/src/void_parser.h +41 -0
- package/third_party/libwebm/webm_parser/src/webm_parser.cc +282 -0
- package/third_party/range-source/LICENSE +21 -0
- package/third_party/range-source/README.md +8 -0
- package/third_party/range-source/include/range_source.h +395 -0
- package/third_party/range-source/include/range_source_download.h +309 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
The code in this repository is MIT-licensed (see `LICENSE`). The native player (Android and iOS) also contains the following, which are not. Each artifact contains only its own row:
|
|
4
|
+
|
|
5
|
+
| Component | Version | Licence | In |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| [libwebm](https://chromium.googlesource.com/webm/libwebm)'s WebM parser | commit `6184f448`, unmodified | BSD-3-Clause, plus the WebM patent grant | the core (`dev.mediacache:alpha-video`; on iOS every product and subspec): source in `third_party/libwebm`, compiled with the C++ core |
|
|
8
|
+
| [libvpx](https://chromium.googlesource.com/webm/libvpx) | 1.14.0, unmodified | BSD-3-Clause, plus the WebM patent grant | the vpx codec module (`alpha-video-vpx`, `AlphaVideoVPX`, `alpha-video/VPX`): `libvpx.a` in `prebuilt/` |
|
|
9
|
+
| [dav1d](https://code.videolan.org/videolan/dav1d) | 1.5.1, unmodified | BSD-2-Clause | the av1 codec module (`alpha-video-av1`, `AlphaVideoAV1`, `alpha-video/AV1`): `libdav1d.a` in `prebuilt/` |
|
|
10
|
+
|
|
11
|
+
The core carries the headers of [range-source](https://github.com/MediaCacheDev/range-source) (`third_party/range-source/include`): its C interface, and the basic input that downloads a URL when the add-on isn't installed. MIT-licensed, by the same author. The add-on itself is a separate package with its own `LICENSE`.
|
|
12
|
+
|
|
13
|
+
On Android the core and each codec module have their own native library; on iOS they're linked into the app. React Native builds in the codecs the app's `package.json` selects, both by default. Licence texts: `licenses/libwebm-LICENSE.txt`, `licenses/libwebm-PATENTS.txt`, `licenses/libvpx-LICENSE.txt`, `licenses/libvpx-PATENTS.txt`, `licenses/dav1d-COPYING.txt`. An app shipping the player must reproduce the notices of what it ships, for example on an open-source licences screen.
|
|
14
|
+
|
|
15
|
+
The web player, `alpha-video-web` (in `web/`, and a dependency of the React Native package for react-native-web), decodes VP8 and VP9 with FFmpeg, which is LGPL-2.1-or-later. Its own [THIRD_PARTY_NOTICES.md](web/THIRD_PARTY_NOTICES.md) covers it.
|
|
16
|
+
|
|
17
|
+
## What the build contains
|
|
18
|
+
|
|
19
|
+
The libraries are built by `scripts/build_codecs_android.sh` (arm64-v8a, armeabi-v7a, x86_64), `scripts/build_codecs_ios_device.sh` (arm64) and `scripts/build_codecs_ios_simulator.sh` (arm64 + x86_64). libvpx is built as a VP8 and VP9 decoder only (`--enable-vp8-decoder --enable-vp9-decoder --disable-vp8-encoder --disable-vp9-encoder`); its full configure line is embedded in the library. dav1d, the AV1 decoder, is built for 8-bit and 10/12-bit video, without its tools and tests (`-Dbitdepths=8,16 -Denable_tools=false -Denable_tests=false`).
|
|
20
|
+
|
|
21
|
+
## Source code
|
|
22
|
+
|
|
23
|
+
None of the libraries is modified. The source is the upstream release:
|
|
24
|
+
|
|
25
|
+
| File | SHA-256 |
|
|
26
|
+
|---|---|
|
|
27
|
+
| [`libvpx-1.14.0.tar.gz`](https://github.com/webmproject/libvpx/archive/refs/tags/v1.14.0.tar.gz) | `5f21d2db27071c8a46f1725928a10227ae45c5cd1cad3727e4aafbe476e321fa` |
|
|
28
|
+
| [`dav1d-1.5.1.tar.gz`](https://github.com/videolan/dav1d/archive/refs/tags/1.5.1.tar.gz) | `fa635e2bdb25147b1384007c83e15de44c589582bb3b9a53fc1579cb9d74b695` |
|
|
29
|
+
|
|
30
|
+
libwebm's parser is in `third_party/libwebm`; its README gives the upstream commit.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// dev.mediacache:alpha-video-av1: dav1d, AV1 in software for alpha-video's C++ core. alpha-video
|
|
2
|
+
// finds it on the classpath (AlphaVideoCodecs), so adding the dependency is all an app does.
|
|
3
|
+
|
|
4
|
+
apply plugin: 'com.android.library'
|
|
5
|
+
|
|
6
|
+
def safeExtGet(name, fallback) {
|
|
7
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
group = 'dev.mediacache'
|
|
11
|
+
version = rootProject.version
|
|
12
|
+
|
|
13
|
+
android {
|
|
14
|
+
namespace 'dev.mediacache.alphavideo.av1'
|
|
15
|
+
compileSdk safeExtGet('compileSdkVersion', 36)
|
|
16
|
+
ndkVersion safeExtGet('ndkVersion', '27.1.12297006')
|
|
17
|
+
|
|
18
|
+
defaultConfig {
|
|
19
|
+
minSdk safeExtGet('minSdkVersion', 24)
|
|
20
|
+
consumerProguardFiles 'consumer-rules.pro'
|
|
21
|
+
|
|
22
|
+
externalNativeBuild {
|
|
23
|
+
cmake {
|
|
24
|
+
cppFlags '-std=c++17 -O3'
|
|
25
|
+
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
|
|
26
|
+
// Its own C++ runtime: the core talks to it through C, and a second
|
|
27
|
+
// libc++_shared.so beside the core's would clash in the app
|
|
28
|
+
arguments '-DANDROID_STL=c++_static'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
externalNativeBuild {
|
|
34
|
+
cmake {
|
|
35
|
+
path 'src/main/cpp/CMakeLists.txt'
|
|
36
|
+
version '3.22.1'
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
compileOptions {
|
|
41
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
42
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
publishing {
|
|
46
|
+
singleVariant('release') {
|
|
47
|
+
withSourcesJar()
|
|
48
|
+
withJavadocJar()
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
repositories {
|
|
54
|
+
google()
|
|
55
|
+
mavenCentral()
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
dependencies {
|
|
59
|
+
api rootProject
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
ext.publishArtifactId = 'alpha-video-av1'
|
|
63
|
+
ext.publishDescription = 'dav1d for alpha-video: 8- to 12-bit AV1 transparent video in software, for Android 7 to 9, files and devices MediaCodec can\'t take, preload, and many players at once.'
|
|
64
|
+
ext.publishLicenses = [
|
|
65
|
+
[name: 'BSD-2-Clause (bundled dav1d)', url: 'https://code.videolan.org/videolan/dav1d/-/blob/1.5.1/COPYING'],
|
|
66
|
+
]
|
|
67
|
+
apply from: rootProject.file('publish.gradle')
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# libalphavideo_av1.so: dav1d and its decoder plugin. It doesn't link the core: Av1Codec hands the
|
|
2
|
+
# core the plugin list's address (AlphaVideoCodecs.java).
|
|
3
|
+
cmake_minimum_required(VERSION 3.22.1)
|
|
4
|
+
project(alphavideo_av1)
|
|
5
|
+
|
|
6
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
7
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
8
|
+
|
|
9
|
+
get_filename_component(MODULE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../../.." ABSOLUTE)
|
|
10
|
+
# dav1d, prebuilt per ABI (scripts/build_codecs_android.sh)
|
|
11
|
+
set(CODECS_ROOT "${MODULE_ROOT}/prebuilt/android/${ANDROID_ABI}")
|
|
12
|
+
|
|
13
|
+
add_library(alphavideo_av1 SHARED
|
|
14
|
+
${MODULE_ROOT}/codecs/av1/Dav1dDecoderPlugin.cpp
|
|
15
|
+
Av1Codec_jni.cpp
|
|
16
|
+
)
|
|
17
|
+
target_include_directories(alphavideo_av1 PRIVATE
|
|
18
|
+
${MODULE_ROOT}/cpp
|
|
19
|
+
${MODULE_ROOT}/codecs/av1
|
|
20
|
+
${MODULE_ROOT}/prebuilt/include
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
# Google Play requires 16 KB-aligned segments for Android 15+; NDK r27 and older link 4 KB by default.
|
|
24
|
+
target_link_options(alphavideo_av1 PRIVATE "-Wl,-z,max-page-size=16384")
|
|
25
|
+
# dav1d stays private to this library, so an app that ships its own copy (ffmpeg-kit's
|
|
26
|
+
# libavcodec.so links it) can't interpose on it, or it on the app's.
|
|
27
|
+
target_link_options(alphavideo_av1 PRIVATE "-Wl,--exclude-libs,ALL")
|
|
28
|
+
|
|
29
|
+
target_link_libraries(alphavideo_av1 ${CODECS_ROOT}/lib/libdav1d.a m)
|
|
30
|
+
|
|
31
|
+
set_target_properties(alphavideo_av1 PROPERTIES
|
|
32
|
+
CXX_VISIBILITY_PRESET hidden
|
|
33
|
+
C_VISIBILITY_PRESET hidden
|
|
34
|
+
)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
package dev.mediacache.alphavideo.av1;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The av1 codec module: dav1d (8- to 12-bit AV1) for alpha-video's C++ core. alpha-video finds
|
|
5
|
+
* this class on the classpath and registers it (dev.mediacache.alphavideo.AlphaVideoCodecs); apps
|
|
6
|
+
* don't call it.
|
|
7
|
+
*/
|
|
8
|
+
public final class Av1Codec {
|
|
9
|
+
static {
|
|
10
|
+
System.loadLibrary("alphavideo_av1");
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
private Av1Codec() {}
|
|
14
|
+
|
|
15
|
+
/** The address of the module's native AlphaVideoDecoderPluginList. */
|
|
16
|
+
public static long pluginList() {
|
|
17
|
+
return nativePluginList();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
private static native long nativePluginList();
|
|
21
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// dev.mediacache:alpha-video, the Android library on its own (no React Native).
|
|
2
|
+
// The React Native package builds these same sources from react-native/android/build.gradle.
|
|
3
|
+
|
|
4
|
+
buildscript {
|
|
5
|
+
// Only when this directory is built on its own; inside an app, the app's plugin is used.
|
|
6
|
+
if (project == rootProject) {
|
|
7
|
+
repositories {
|
|
8
|
+
google()
|
|
9
|
+
mavenCentral()
|
|
10
|
+
}
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath 'com.android.tools.build:gradle:8.12.0'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
apply plugin: 'com.android.library'
|
|
18
|
+
|
|
19
|
+
def safeExtGet(name, fallback) {
|
|
20
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : fallback
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
group = 'dev.mediacache'
|
|
24
|
+
version = '1.0.0'
|
|
25
|
+
|
|
26
|
+
android {
|
|
27
|
+
namespace 'dev.mediacache.alphavideo'
|
|
28
|
+
compileSdk safeExtGet('compileSdkVersion', 36)
|
|
29
|
+
ndkVersion safeExtGet('ndkVersion', '27.1.12297006')
|
|
30
|
+
|
|
31
|
+
defaultConfig {
|
|
32
|
+
minSdk safeExtGet('minSdkVersion', 24)
|
|
33
|
+
consumerProguardFiles 'consumer-rules.pro'
|
|
34
|
+
|
|
35
|
+
externalNativeBuild {
|
|
36
|
+
cmake {
|
|
37
|
+
cppFlags '-std=c++17 -frtti -fexceptions -O3'
|
|
38
|
+
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
|
|
39
|
+
arguments '-DANDROID_STL=c++_shared'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
externalNativeBuild {
|
|
45
|
+
cmake {
|
|
46
|
+
path 'src/main/cpp/CMakeLists.txt'
|
|
47
|
+
version '3.22.1'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
compileOptions {
|
|
52
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
53
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
sourceSets {
|
|
57
|
+
main {
|
|
58
|
+
// The one class that uses range-source's types; the React Native package swaps in
|
|
59
|
+
// a stub when the app hasn't installed it
|
|
60
|
+
java.srcDirs += 'src/rangesource/java'
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
publishing {
|
|
65
|
+
singleVariant('release') {
|
|
66
|
+
withSourcesJar()
|
|
67
|
+
withJavadocJar()
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
repositories {
|
|
73
|
+
google()
|
|
74
|
+
mavenCentral()
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
dependencies {
|
|
78
|
+
// Included by default and removable: an app can exclude it, and the player then falls back
|
|
79
|
+
// to the basic input (RangeSourceLink)
|
|
80
|
+
api 'dev.mediacache:range-source:1.0.0'
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (project == rootProject) {
|
|
84
|
+
apply from: 'publish.gradle'
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
android.useAndroidX=true
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Maven publication for dev.mediacache:alpha-video, and for alpha-video-vpx and -av1
|
|
2
|
+
// (their build.gradle sets publishArtifactId, publishDescription and publishLicenses, the bundled
|
|
3
|
+
// code's licences beside MIT, before applying this). Run it through scripts/publish-android.sh.
|
|
4
|
+
//
|
|
5
|
+
// Signing reads ORG_GRADLE_PROJECT_signingInMemoryKey (armored secret key), …KeyPassword and
|
|
6
|
+
// optionally …KeyId. Without a key the artifacts are left unsigned, which is enough for
|
|
7
|
+
// publishToMavenLocal.
|
|
8
|
+
|
|
9
|
+
apply plugin: 'maven-publish'
|
|
10
|
+
apply plugin: 'signing'
|
|
11
|
+
|
|
12
|
+
def repoUrl = 'https://github.com/MediaCacheDev/alpha-video'
|
|
13
|
+
def artifact = project.ext.has('publishArtifactId') ? project.ext.publishArtifactId : 'alpha-video'
|
|
14
|
+
def bundledLicenses = project.ext.has('publishLicenses') ? project.ext.publishLicenses : [
|
|
15
|
+
[name: 'BSD-3-Clause (bundled libwebm parser)', url: 'https://chromium.googlesource.com/webm/libwebm/+/refs/heads/main/LICENSE.TXT'],
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
afterEvaluate {
|
|
19
|
+
publishing {
|
|
20
|
+
publications {
|
|
21
|
+
release(MavenPublication) {
|
|
22
|
+
from components.release
|
|
23
|
+
artifactId = artifact
|
|
24
|
+
|
|
25
|
+
pom {
|
|
26
|
+
name = artifact
|
|
27
|
+
description = project.ext.has('publishDescription') ? project.ext.publishDescription : 'Transparent video for Android: VP9 or AV1 WebM with alpha on MediaCodec, or in software with alpha-video-vpx and alpha-video-av1, drawn into a TextureView.'
|
|
28
|
+
url = repoUrl
|
|
29
|
+
inceptionYear = '2026'
|
|
30
|
+
licenses {
|
|
31
|
+
license {
|
|
32
|
+
name = 'MIT'
|
|
33
|
+
url = 'https://opensource.org/licenses/MIT'
|
|
34
|
+
distribution = 'repo'
|
|
35
|
+
}
|
|
36
|
+
bundledLicenses.each { bundled ->
|
|
37
|
+
license {
|
|
38
|
+
name = bundled.name
|
|
39
|
+
url = bundled.url
|
|
40
|
+
distribution = 'repo'
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
developers {
|
|
45
|
+
developer {
|
|
46
|
+
id = 'danielkpl2'
|
|
47
|
+
name = 'Daniel Kasprowicz'
|
|
48
|
+
email = '9932671+danielkpl2@users.noreply.github.com'
|
|
49
|
+
url = 'https://github.com/danielkpl2'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
scm {
|
|
53
|
+
connection = "scm:git:${repoUrl}.git"
|
|
54
|
+
developerConnection = "scm:git:${repoUrl}.git"
|
|
55
|
+
url = repoUrl
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
repositories {
|
|
61
|
+
maven {
|
|
62
|
+
name = 'staging'
|
|
63
|
+
// Both artifacts, so that one bundle uploads them together
|
|
64
|
+
url = rootProject.layout.buildDirectory.dir('staging-repo')
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
def signingKey = findProperty('signingInMemoryKey')
|
|
70
|
+
if (signingKey) {
|
|
71
|
+
signing {
|
|
72
|
+
def keyId = findProperty('signingInMemoryKeyId')
|
|
73
|
+
def password = findProperty('signingInMemoryKeyPassword')
|
|
74
|
+
if (keyId) {
|
|
75
|
+
useInMemoryPgpKeys(keyId, signingKey, password)
|
|
76
|
+
} else {
|
|
77
|
+
useInMemoryPgpKeys(signingKey, password)
|
|
78
|
+
}
|
|
79
|
+
sign publishing.publications.release
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.22.1)
|
|
2
|
+
project(alphavideo)
|
|
3
|
+
|
|
4
|
+
set(CMAKE_CXX_STANDARD 17)
|
|
5
|
+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
6
|
+
|
|
7
|
+
# Get the module root directory (react-native-webm-alpha-player/). CMAKE_CURRENT_SOURCE_DIR, not
|
|
8
|
+
# CMAKE_SOURCE_DIR, so that React Native's build can add this directory to its own.
|
|
9
|
+
get_filename_component(MODULE_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../../../.." ABSOLUTE)
|
|
10
|
+
|
|
11
|
+
# libwebm's WebM parser, built from source
|
|
12
|
+
set(WEBM_PARSER "${MODULE_ROOT}/third_party/libwebm/webm_parser")
|
|
13
|
+
file(GLOB WEBM_PARSER_SOURCES "${WEBM_PARSER}/src/*.cc")
|
|
14
|
+
|
|
15
|
+
# range-source's C interface and the basic input (third_party/range-source/include, vendored by
|
|
16
|
+
# scripts/vendor_range_source.sh). The add-on itself is dev.mediacache:range-source, its own
|
|
17
|
+
# library, found at run time (RangeSourceLink.java).
|
|
18
|
+
set(RANGE_SOURCE "${MODULE_ROOT}/third_party/range-source")
|
|
19
|
+
|
|
20
|
+
# Source files. The software decoders are codec modules (android/vpx, android/av1), each its own
|
|
21
|
+
# library, which register with the core at run time (AlphaVideoCodecs.java).
|
|
22
|
+
set(NATIVE_SOURCES
|
|
23
|
+
${MODULE_ROOT}/cpp/AlphaDemuxer.cpp
|
|
24
|
+
${MODULE_ROOT}/cpp/Av1SequenceHeader.cpp
|
|
25
|
+
${MODULE_ROOT}/cpp/ByteSource.cpp
|
|
26
|
+
${MODULE_ROOT}/cpp/VideoDecoder.cpp
|
|
27
|
+
${MODULE_ROOT}/cpp/WebMAlphaPlayer.cpp
|
|
28
|
+
${MODULE_ROOT}/cpp/WebMAlphaPlayer_jni.cpp
|
|
29
|
+
${MODULE_ROOT}/cpp/YuvToRgb.cpp
|
|
30
|
+
${WEBM_PARSER_SOURCES}
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
# Create the native library
|
|
34
|
+
add_library(alphavideo SHARED ${NATIVE_SOURCES})
|
|
35
|
+
|
|
36
|
+
target_include_directories(alphavideo PRIVATE
|
|
37
|
+
${MODULE_ROOT}/cpp
|
|
38
|
+
${RANGE_SOURCE}/include
|
|
39
|
+
${WEBM_PARSER}
|
|
40
|
+
${WEBM_PARSER}/include
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# Google Play requires 16 KB-aligned segments for Android 15+; NDK r27 and older link 4 KB by default.
|
|
44
|
+
target_link_options(alphavideo PRIVATE "-Wl,-z,max-page-size=16384")
|
|
45
|
+
|
|
46
|
+
# Find Android log library
|
|
47
|
+
find_library(log-lib log)
|
|
48
|
+
|
|
49
|
+
target_link_libraries(alphavideo
|
|
50
|
+
${log-lib}
|
|
51
|
+
android
|
|
52
|
+
m
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
# Set library properties
|
|
56
|
+
set_target_properties(alphavideo PROPERTIES
|
|
57
|
+
CXX_VISIBILITY_PRESET hidden
|
|
58
|
+
C_VISIBILITY_PRESET hidden
|
|
59
|
+
)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
package dev.mediacache.alphavideo;
|
|
2
|
+
|
|
3
|
+
import android.util.Log;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The software decoders the C++ core plays with, for files and devices MediaCodec can't take
|
|
7
|
+
* (see {@link AlphaVideoView#setDecoder}). The codec modules, {@code dev.mediacache:alpha-video-vpx}
|
|
8
|
+
* (libvpx, VP9) and {@code alpha-video-av1} (dav1d), register themselves when they're on the
|
|
9
|
+
* classpath: nothing to call. Without them the core plays through MediaCodec alone, and a file it
|
|
10
|
+
* would decode in software reports {@link AlphaVideoView#ERROR_NO_DECODER}.
|
|
11
|
+
*/
|
|
12
|
+
public final class AlphaVideoCodecs {
|
|
13
|
+
private static final String TAG = "AlphaVideoCodecs";
|
|
14
|
+
|
|
15
|
+
// Each module's class has a static pluginList(), its AlphaVideoDecoderPluginList's address
|
|
16
|
+
private static final String[] MODULES = {
|
|
17
|
+
"dev.mediacache.alphavideo.vpx.VpxCodec",
|
|
18
|
+
"dev.mediacache.alphavideo.av1.Av1Codec",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
private static boolean discovered;
|
|
22
|
+
|
|
23
|
+
static {
|
|
24
|
+
System.loadLibrary("alphavideo");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
private AlphaVideoCodecs() {}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Registers another software decoder: {@code pluginList} is the address of a native
|
|
31
|
+
* {@code AlphaVideoDecoderPluginList} (cpp/AlphaVideoDecoderPlugin.h). Registered decoders come
|
|
32
|
+
* after the modules', which a stream tries first.
|
|
33
|
+
*
|
|
34
|
+
* @throws IllegalArgumentException for a decoder built for another plugin ABI
|
|
35
|
+
*/
|
|
36
|
+
public static synchronized void register(long pluginList) {
|
|
37
|
+
discover();
|
|
38
|
+
String error = nativeRegister(pluginList);
|
|
39
|
+
if (error != null) throw new IllegalArgumentException(error);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** The registered software decoders, e.g. {"libvpx v1.14.0", "dav1d 1.5.1"}; empty with none. */
|
|
43
|
+
public static String[] softwareDecoders() {
|
|
44
|
+
discover();
|
|
45
|
+
return nativeSoftwareDecoders();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Registers the codec modules on the classpath, once. */
|
|
49
|
+
static synchronized void discover() {
|
|
50
|
+
if (discovered) return;
|
|
51
|
+
discovered = true;
|
|
52
|
+
for (String name : MODULES) {
|
|
53
|
+
Class<?> module;
|
|
54
|
+
try {
|
|
55
|
+
module = Class.forName(name);
|
|
56
|
+
} catch (ClassNotFoundException e) {
|
|
57
|
+
continue;
|
|
58
|
+
} catch (LinkageError e) {
|
|
59
|
+
Log.e(TAG, name + " is there but its native library didn't load", e);
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
String error = nativeRegister((Long) module.getMethod("pluginList").invoke(null));
|
|
64
|
+
if (error != null) Log.e(TAG, name + ": " + error);
|
|
65
|
+
} catch (ReflectiveOperationException | RuntimeException | LinkageError e) {
|
|
66
|
+
Log.e(TAG, name + " didn't register", e);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
private static native String nativeRegister(long pluginList);
|
|
72
|
+
private static native String[] nativeSoftwareDecoders();
|
|
73
|
+
}
|