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
package/package.json
CHANGED
|
@@ -1,6 +1,152 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-alpha-video",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Transparent video for React Native: VP8, VP9 or AV1 WebM with alpha on iOS and Android, decoded by a C++ core (libvpx, dav1d for AV1) or the Android hardware decoder, drawn with Metal and OpenGL ES. On the web, alpha-video-web shows the alpha in every browser: <video>, WebCodecs or WebAssembly decoding.",
|
|
5
|
+
"source": "react-native/src/index.tsx",
|
|
6
|
+
"main": "lib/commonjs/index.js",
|
|
7
|
+
"module": "lib/module/index.js",
|
|
8
|
+
"types": "lib/typescript/react-native/src/index.d.ts",
|
|
9
|
+
"react-native": "react-native/src/index.tsx",
|
|
10
|
+
"files": [
|
|
11
|
+
"react-native",
|
|
12
|
+
"lib",
|
|
13
|
+
"cpp",
|
|
14
|
+
"codecs",
|
|
15
|
+
"ios",
|
|
16
|
+
"android",
|
|
17
|
+
"scripts",
|
|
18
|
+
"prebuilt",
|
|
19
|
+
"third_party",
|
|
20
|
+
"react-native-alpha-video.podspec",
|
|
21
|
+
"react-native.config.js",
|
|
22
|
+
"THIRD_PARTY_NOTICES.md",
|
|
23
|
+
"licenses",
|
|
24
|
+
"!scripts/build",
|
|
25
|
+
"!**/__tests__",
|
|
26
|
+
"!**/__fixtures__",
|
|
27
|
+
"!**/__mocks__",
|
|
28
|
+
"!android/build",
|
|
29
|
+
"!android/.gradle",
|
|
30
|
+
"!android/.cxx",
|
|
31
|
+
"!android/*/build",
|
|
32
|
+
"!android/*/.cxx",
|
|
33
|
+
"!android/local.properties",
|
|
34
|
+
"!react-native/android/build",
|
|
35
|
+
"!react-native/android/.gradle",
|
|
36
|
+
"!react-native/android/.cxx",
|
|
37
|
+
"!android/gradle",
|
|
38
|
+
"!android/gradlew",
|
|
39
|
+
"!android/gradlew.bat",
|
|
40
|
+
"!prebuilt/*.xcframework",
|
|
41
|
+
"!prebuilt/*.xcframework.zip",
|
|
42
|
+
"!ios/build",
|
|
43
|
+
"!.DS_Store"
|
|
44
|
+
],
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "bob build",
|
|
47
|
+
"typescript": "tsc --noEmit",
|
|
48
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
49
|
+
"test:core": "cmake -S tests/core -B tests/core/build -G Ninja && cmake --build tests/core/build && tests/core/build/core_tests && tests/core/build/codec_registry_tests",
|
|
50
|
+
"prepare": "bob build",
|
|
51
|
+
"prepack": "bob build",
|
|
52
|
+
"build:codecs:ios": "cd scripts && ./build_codecs_ios.sh",
|
|
53
|
+
"build:codecs:ios:device": "cd scripts && ./build_codecs_ios_device.sh",
|
|
54
|
+
"build:codecs:ios:simulator": "cd scripts && ./build_codecs_ios_simulator.sh",
|
|
55
|
+
"build:codecs:android": "cd scripts && ./build_codecs_android.sh",
|
|
56
|
+
"build:codecs:all": "npm run build:codecs:ios && npm run build:codecs:android",
|
|
57
|
+
"build:xcframework": "scripts/build_xcframework.sh",
|
|
58
|
+
"publish:android:local": "scripts/publish-android.sh local",
|
|
59
|
+
"fetch:prebuilt": "scripts/fetch-prebuilt.sh",
|
|
60
|
+
"package:release": "scripts/package_release.sh"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"react-native",
|
|
64
|
+
"alpha",
|
|
65
|
+
"transparent-video",
|
|
66
|
+
"transparency",
|
|
67
|
+
"webm",
|
|
68
|
+
"vp8",
|
|
69
|
+
"vp9",
|
|
70
|
+
"video",
|
|
71
|
+
"player",
|
|
72
|
+
"av1",
|
|
73
|
+
"ios",
|
|
74
|
+
"android",
|
|
75
|
+
"react-native-web",
|
|
76
|
+
"metal",
|
|
77
|
+
"opengl"
|
|
78
|
+
],
|
|
79
|
+
"repository": {
|
|
80
|
+
"type": "git",
|
|
81
|
+
"url": "git+https://github.com/MediaCacheDev/alpha-video.git"
|
|
82
|
+
},
|
|
83
|
+
"author": "Daniel Kasprowicz",
|
|
84
|
+
"license": "MIT",
|
|
85
|
+
"bugs": {
|
|
86
|
+
"url": "https://github.com/MediaCacheDev/alpha-video/issues"
|
|
87
|
+
},
|
|
88
|
+
"homepage": "https://github.com/MediaCacheDev/alpha-video#readme",
|
|
89
|
+
"codegenConfig": {
|
|
90
|
+
"name": "RNAlphaVideoSpec",
|
|
91
|
+
"type": "all",
|
|
92
|
+
"jsSrcsDir": "react-native/src",
|
|
93
|
+
"android": {
|
|
94
|
+
"javaPackageName": "dev.mediacache.alphavideo.reactnative"
|
|
95
|
+
},
|
|
96
|
+
"ios": {
|
|
97
|
+
"componentProvider": {
|
|
98
|
+
"RNAlphaVideoView": "RNAlphaVideoViewComponentView"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"publishConfig": {
|
|
103
|
+
"registry": "https://registry.npmjs.org/"
|
|
104
|
+
},
|
|
105
|
+
"devDependencies": {
|
|
106
|
+
"@babel/preset-env": "^7.28.5",
|
|
107
|
+
"@babel/preset-react": "^7.28.5",
|
|
108
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
109
|
+
"@types/react": "^18.2.0",
|
|
110
|
+
"@types/react-native": "^0.72.0",
|
|
111
|
+
"react": "^18.2.0",
|
|
112
|
+
"react-native": "^0.73.0",
|
|
113
|
+
"react-native-builder-bob": "^0.23.0",
|
|
114
|
+
"typescript": "^5.0.0"
|
|
115
|
+
},
|
|
116
|
+
"dependencies": {
|
|
117
|
+
"alpha-video-web": "^1.0.0"
|
|
118
|
+
},
|
|
119
|
+
"peerDependencies": {
|
|
120
|
+
"react": "*",
|
|
121
|
+
"react-native": "*"
|
|
122
|
+
},
|
|
123
|
+
"peerDependenciesMeta": {
|
|
124
|
+
"react-native-web": {
|
|
125
|
+
"optional": true
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"react-native-builder-bob": {
|
|
129
|
+
"source": "react-native/src",
|
|
130
|
+
"output": "lib",
|
|
131
|
+
"targets": [
|
|
132
|
+
[
|
|
133
|
+
"commonjs",
|
|
134
|
+
{
|
|
135
|
+
"configFile": true
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
[
|
|
139
|
+
"module",
|
|
140
|
+
{
|
|
141
|
+
"configFile": true
|
|
142
|
+
}
|
|
143
|
+
],
|
|
144
|
+
[
|
|
145
|
+
"typescript",
|
|
146
|
+
{
|
|
147
|
+
"project": "tsconfig.build.json"
|
|
148
|
+
}
|
|
149
|
+
]
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2018, VideoLAN and dav1d authors
|
|
3
|
+
* Copyright © 2018, Two Orioles, LLC
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Redistribution and use in source and binary forms, with or without
|
|
7
|
+
* modification, are permitted provided that the following conditions are met:
|
|
8
|
+
*
|
|
9
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
* list of conditions and the following disclaimer.
|
|
11
|
+
*
|
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
* and/or other materials provided with the distribution.
|
|
15
|
+
*
|
|
16
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
17
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
18
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
20
|
+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
21
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
22
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
23
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
24
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
25
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
#ifndef DAV1D_COMMON_H
|
|
29
|
+
#define DAV1D_COMMON_H
|
|
30
|
+
|
|
31
|
+
#include <errno.h>
|
|
32
|
+
#include <stddef.h>
|
|
33
|
+
#include <stdint.h>
|
|
34
|
+
|
|
35
|
+
#ifdef __cplusplus
|
|
36
|
+
extern "C" {
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#ifndef DAV1D_API
|
|
40
|
+
#if defined _WIN32
|
|
41
|
+
#if defined DAV1D_BUILDING_DLL
|
|
42
|
+
#define DAV1D_API __declspec(dllexport)
|
|
43
|
+
#else
|
|
44
|
+
#define DAV1D_API
|
|
45
|
+
#endif
|
|
46
|
+
#else
|
|
47
|
+
#if __GNUC__ >= 4
|
|
48
|
+
#define DAV1D_API __attribute__ ((visibility ("default")))
|
|
49
|
+
#else
|
|
50
|
+
#define DAV1D_API
|
|
51
|
+
#endif
|
|
52
|
+
#endif
|
|
53
|
+
#endif
|
|
54
|
+
|
|
55
|
+
#if EPERM > 0
|
|
56
|
+
#define DAV1D_ERR(e) (-(e)) ///< Negate POSIX error code.
|
|
57
|
+
#else
|
|
58
|
+
#define DAV1D_ERR(e) (e)
|
|
59
|
+
#endif
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* A reference-counted object wrapper for a user-configurable pointer.
|
|
63
|
+
*/
|
|
64
|
+
typedef struct Dav1dUserData {
|
|
65
|
+
const uint8_t *data; ///< data pointer
|
|
66
|
+
struct Dav1dRef *ref; ///< allocation origin
|
|
67
|
+
} Dav1dUserData;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Input packet metadata which are copied from the input data used to
|
|
71
|
+
* decode each image into the matching structure of the output image
|
|
72
|
+
* returned back to the user. Since these are metadata fields, they
|
|
73
|
+
* can be used for other purposes than the documented ones, they will
|
|
74
|
+
* still be passed from input data to output picture without being
|
|
75
|
+
* used internally.
|
|
76
|
+
*/
|
|
77
|
+
typedef struct Dav1dDataProps {
|
|
78
|
+
int64_t timestamp; ///< container timestamp of input data, INT64_MIN if unknown (default)
|
|
79
|
+
int64_t duration; ///< container duration of input data, 0 if unknown (default)
|
|
80
|
+
int64_t offset; ///< stream offset of input data, -1 if unknown (default)
|
|
81
|
+
size_t size; ///< packet size, default Dav1dData.sz
|
|
82
|
+
struct Dav1dUserData user_data; ///< user-configurable data, default NULL members
|
|
83
|
+
} Dav1dDataProps;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Release reference to a Dav1dDataProps.
|
|
87
|
+
*/
|
|
88
|
+
DAV1D_API void dav1d_data_props_unref(Dav1dDataProps *props);
|
|
89
|
+
|
|
90
|
+
#ifdef __cplusplus
|
|
91
|
+
} /* extern "C" */
|
|
92
|
+
#endif
|
|
93
|
+
|
|
94
|
+
#endif /* DAV1D_COMMON_H */
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © 2018, VideoLAN and dav1d authors
|
|
3
|
+
* Copyright © 2018, Two Orioles, LLC
|
|
4
|
+
* All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Redistribution and use in source and binary forms, with or without
|
|
7
|
+
* modification, are permitted provided that the following conditions are met:
|
|
8
|
+
*
|
|
9
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
* list of conditions and the following disclaimer.
|
|
11
|
+
*
|
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
* and/or other materials provided with the distribution.
|
|
15
|
+
*
|
|
16
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
17
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
18
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
19
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
20
|
+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
21
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
22
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
23
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
24
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
25
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
#ifndef DAV1D_DATA_H
|
|
29
|
+
#define DAV1D_DATA_H
|
|
30
|
+
|
|
31
|
+
#include <stddef.h>
|
|
32
|
+
#include <stdint.h>
|
|
33
|
+
|
|
34
|
+
#include "common.h"
|
|
35
|
+
|
|
36
|
+
#ifdef __cplusplus
|
|
37
|
+
extern "C" {
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
typedef struct Dav1dData {
|
|
41
|
+
const uint8_t *data; ///< data pointer
|
|
42
|
+
size_t sz; ///< data size
|
|
43
|
+
struct Dav1dRef *ref; ///< allocation origin
|
|
44
|
+
Dav1dDataProps m; ///< user provided metadata passed to the output picture
|
|
45
|
+
} Dav1dData;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Allocate data.
|
|
49
|
+
*
|
|
50
|
+
* @param data Input context.
|
|
51
|
+
* @param sz Size of the data that should be allocated.
|
|
52
|
+
*
|
|
53
|
+
* @return Pointer to the allocated buffer on success. NULL on error.
|
|
54
|
+
*/
|
|
55
|
+
DAV1D_API uint8_t * dav1d_data_create(Dav1dData *data, size_t sz);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Wrap an existing data array.
|
|
59
|
+
*
|
|
60
|
+
* @param data Input context.
|
|
61
|
+
* @param buf The data to be wrapped.
|
|
62
|
+
* @param sz Size of the data.
|
|
63
|
+
* @param free_callback Function to be called when we release our last
|
|
64
|
+
* reference to this data. In this callback, $buf will be
|
|
65
|
+
* the $buf argument to this function, and $cookie will
|
|
66
|
+
* be the $cookie input argument to this function.
|
|
67
|
+
* @param cookie Opaque parameter passed to free_callback().
|
|
68
|
+
*
|
|
69
|
+
* @return 0 on success. A negative DAV1D_ERR value on error.
|
|
70
|
+
*/
|
|
71
|
+
DAV1D_API int dav1d_data_wrap(Dav1dData *data, const uint8_t *buf, size_t sz,
|
|
72
|
+
void (*free_callback)(const uint8_t *buf, void *cookie),
|
|
73
|
+
void *cookie);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Wrap a user-provided data pointer into a reference counted object.
|
|
77
|
+
*
|
|
78
|
+
* data->m.user_data field will initialized to wrap the provided $user_data
|
|
79
|
+
* pointer.
|
|
80
|
+
*
|
|
81
|
+
* $free_callback will be called on the same thread that released the last
|
|
82
|
+
* reference. If frame threading is used, make sure $free_callback is
|
|
83
|
+
* thread-safe.
|
|
84
|
+
*
|
|
85
|
+
* @param data Input context.
|
|
86
|
+
* @param user_data The user data to be wrapped.
|
|
87
|
+
* @param free_callback Function to be called when we release our last
|
|
88
|
+
* reference to this data. In this callback, $user_data
|
|
89
|
+
* will be the $user_data argument to this function, and
|
|
90
|
+
* $cookie will be the $cookie input argument to this
|
|
91
|
+
* function.
|
|
92
|
+
* @param cookie Opaque parameter passed to $free_callback.
|
|
93
|
+
*
|
|
94
|
+
* @return 0 on success. A negative DAV1D_ERR value on error.
|
|
95
|
+
*/
|
|
96
|
+
DAV1D_API int dav1d_data_wrap_user_data(Dav1dData *data,
|
|
97
|
+
const uint8_t *user_data,
|
|
98
|
+
void (*free_callback)(const uint8_t *user_data,
|
|
99
|
+
void *cookie),
|
|
100
|
+
void *cookie);
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Free the data reference.
|
|
104
|
+
*
|
|
105
|
+
* The reference count for data->m.user_data will be decremented (if it has been
|
|
106
|
+
* initialized with dav1d_data_wrap_user_data). The $data object will be memset
|
|
107
|
+
* to 0.
|
|
108
|
+
*
|
|
109
|
+
* @param data Input context.
|
|
110
|
+
*/
|
|
111
|
+
DAV1D_API void dav1d_data_unref(Dav1dData *data);
|
|
112
|
+
|
|
113
|
+
#ifdef __cplusplus
|
|
114
|
+
} /* extern "C" */
|
|
115
|
+
#endif
|
|
116
|
+
|
|
117
|
+
#endif /* DAV1D_DATA_H */
|