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,72 @@
|
|
|
1
|
+
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by a BSD-style license
|
|
4
|
+
// that can be found in the LICENSE file in the root of the source
|
|
5
|
+
// tree. An additional intellectual property rights grant can be found
|
|
6
|
+
// in the file PATENTS. All contributing project authors may
|
|
7
|
+
// be found in the AUTHORS file in the root of the source tree.
|
|
8
|
+
#include "src/virtual_block_parser.h"
|
|
9
|
+
|
|
10
|
+
#include <cassert>
|
|
11
|
+
#include <cstdint>
|
|
12
|
+
|
|
13
|
+
#include "webm/element.h"
|
|
14
|
+
|
|
15
|
+
namespace webm {
|
|
16
|
+
|
|
17
|
+
Status VirtualBlockParser::Init(const ElementMetadata& metadata,
|
|
18
|
+
std::uint64_t max_size) {
|
|
19
|
+
assert(metadata.size == kUnknownElementSize || metadata.size <= max_size);
|
|
20
|
+
|
|
21
|
+
if (metadata.size == kUnknownElementSize || metadata.size < 4) {
|
|
22
|
+
return Status(Status::kInvalidElementSize);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
*this = {};
|
|
26
|
+
my_size_ = metadata.size;
|
|
27
|
+
|
|
28
|
+
return Status(Status::kOkCompleted);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
Status VirtualBlockParser::Feed(Callback* callback, Reader* reader,
|
|
32
|
+
std::uint64_t* num_bytes_read) {
|
|
33
|
+
assert(callback != nullptr);
|
|
34
|
+
assert(reader != nullptr);
|
|
35
|
+
assert(num_bytes_read != nullptr);
|
|
36
|
+
|
|
37
|
+
*num_bytes_read = 0;
|
|
38
|
+
|
|
39
|
+
Status status;
|
|
40
|
+
std::uint64_t local_num_bytes_read;
|
|
41
|
+
|
|
42
|
+
while (true) {
|
|
43
|
+
switch (state_) {
|
|
44
|
+
case State::kReadingHeader: {
|
|
45
|
+
status = parser_.Feed(callback, reader, &local_num_bytes_read);
|
|
46
|
+
*num_bytes_read += local_num_bytes_read;
|
|
47
|
+
total_bytes_read_ += local_num_bytes_read;
|
|
48
|
+
if (!status.completed_ok()) {
|
|
49
|
+
return status;
|
|
50
|
+
}
|
|
51
|
+
value_.track_number = parser_.value().track_number;
|
|
52
|
+
value_.timecode = parser_.value().timecode;
|
|
53
|
+
state_ = State::kValidatingSize;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
case State::kValidatingSize: {
|
|
58
|
+
if (my_size_ < total_bytes_read_) {
|
|
59
|
+
return Status(Status::kInvalidElementValue);
|
|
60
|
+
}
|
|
61
|
+
state_ = State::kDone;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
case State::kDone: {
|
|
66
|
+
return Status(Status::kOkCompleted);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
} // namespace webm
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by a BSD-style license
|
|
4
|
+
// that can be found in the LICENSE file in the root of the source
|
|
5
|
+
// tree. An additional intellectual property rights grant can be found
|
|
6
|
+
// in the file PATENTS. All contributing project authors may
|
|
7
|
+
// be found in the AUTHORS file in the root of the source tree.
|
|
8
|
+
#ifndef SRC_VIRTUAL_BLOCK_PARSER_H_
|
|
9
|
+
#define SRC_VIRTUAL_BLOCK_PARSER_H_
|
|
10
|
+
|
|
11
|
+
#include <cassert>
|
|
12
|
+
#include <cstdint>
|
|
13
|
+
|
|
14
|
+
#include "src/block_header_parser.h"
|
|
15
|
+
#include "src/element_parser.h"
|
|
16
|
+
#include "webm/callback.h"
|
|
17
|
+
#include "webm/dom_types.h"
|
|
18
|
+
#include "webm/element.h"
|
|
19
|
+
#include "webm/reader.h"
|
|
20
|
+
#include "webm/status.h"
|
|
21
|
+
|
|
22
|
+
namespace webm {
|
|
23
|
+
|
|
24
|
+
// Spec reference:
|
|
25
|
+
// http://matroska.org/technical/specs/index.html#BlockVirtual
|
|
26
|
+
// http://www.webmproject.org/docs/container/#BlockVirtual
|
|
27
|
+
// http://matroska.org/technical/specs/index.html#block_virtual
|
|
28
|
+
class VirtualBlockParser : public ElementParser {
|
|
29
|
+
public:
|
|
30
|
+
Status Init(const ElementMetadata& metadata, std::uint64_t max_size) override;
|
|
31
|
+
|
|
32
|
+
Status Feed(Callback* callback, Reader* reader,
|
|
33
|
+
std::uint64_t* num_bytes_read) override;
|
|
34
|
+
|
|
35
|
+
// Gets the parsed block header information. This must not be called until the
|
|
36
|
+
// parse has been successfully completed.
|
|
37
|
+
const VirtualBlock& value() const {
|
|
38
|
+
assert(state_ == State::kDone);
|
|
39
|
+
return value_;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Gets the parsed block header information. This must not be called until the
|
|
43
|
+
// parse has been successfully completed.
|
|
44
|
+
VirtualBlock* mutable_value() {
|
|
45
|
+
assert(state_ == State::kDone);
|
|
46
|
+
return &value_;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private:
|
|
50
|
+
std::uint64_t my_size_;
|
|
51
|
+
std::uint64_t total_bytes_read_ = 0;
|
|
52
|
+
|
|
53
|
+
VirtualBlock value_{};
|
|
54
|
+
|
|
55
|
+
BlockHeaderParser parser_;
|
|
56
|
+
|
|
57
|
+
enum class State {
|
|
58
|
+
/* clang-format off */
|
|
59
|
+
// State Transitions to state When
|
|
60
|
+
kReadingHeader, // kValidatingSize header parsed
|
|
61
|
+
kValidatingSize, // kDone no errors
|
|
62
|
+
kDone, // No transitions from here (must call Init)
|
|
63
|
+
/* clang-format on */
|
|
64
|
+
} state_ = State::kReadingHeader;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
} // namespace webm
|
|
68
|
+
|
|
69
|
+
#endif // SRC_VIRTUAL_BLOCK_PARSER_H_
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by a BSD-style license
|
|
4
|
+
// that can be found in the LICENSE file in the root of the source
|
|
5
|
+
// tree. An additional intellectual property rights grant can be found
|
|
6
|
+
// in the file PATENTS. All contributing project authors may
|
|
7
|
+
// be found in the AUTHORS file in the root of the source tree.
|
|
8
|
+
#include "src/void_parser.h"
|
|
9
|
+
|
|
10
|
+
#include <cassert>
|
|
11
|
+
#include <cstdint>
|
|
12
|
+
|
|
13
|
+
#include "webm/callback.h"
|
|
14
|
+
#include "webm/element.h"
|
|
15
|
+
#include "webm/id.h"
|
|
16
|
+
#include "webm/reader.h"
|
|
17
|
+
#include "webm/status.h"
|
|
18
|
+
|
|
19
|
+
namespace webm {
|
|
20
|
+
|
|
21
|
+
Status VoidParser::Init(const ElementMetadata& metadata,
|
|
22
|
+
std::uint64_t max_size) {
|
|
23
|
+
assert(metadata.size == kUnknownElementSize || metadata.size <= max_size);
|
|
24
|
+
|
|
25
|
+
if (metadata.size == kUnknownElementSize) {
|
|
26
|
+
return Status(Status::kInvalidElementSize);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
metadata_ = metadata;
|
|
30
|
+
bytes_remaining_ = metadata.size;
|
|
31
|
+
|
|
32
|
+
return Status(Status::kOkCompleted);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
Status VoidParser::Feed(Callback* callback, Reader* reader,
|
|
36
|
+
std::uint64_t* num_bytes_read) {
|
|
37
|
+
assert(callback != nullptr);
|
|
38
|
+
assert(reader != nullptr);
|
|
39
|
+
assert(num_bytes_read != nullptr);
|
|
40
|
+
|
|
41
|
+
const std::uint64_t original_bytes_remaining = bytes_remaining_;
|
|
42
|
+
const Status status = callback->OnVoid(metadata_, reader, &bytes_remaining_);
|
|
43
|
+
assert(bytes_remaining_ <= original_bytes_remaining);
|
|
44
|
+
|
|
45
|
+
*num_bytes_read = original_bytes_remaining - bytes_remaining_;
|
|
46
|
+
return status;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
} // namespace webm
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by a BSD-style license
|
|
4
|
+
// that can be found in the LICENSE file in the root of the source
|
|
5
|
+
// tree. An additional intellectual property rights grant can be found
|
|
6
|
+
// in the file PATENTS. All contributing project authors may
|
|
7
|
+
// be found in the AUTHORS file in the root of the source tree.
|
|
8
|
+
#ifndef SRC_VOID_PARSER_H_
|
|
9
|
+
#define SRC_VOID_PARSER_H_
|
|
10
|
+
|
|
11
|
+
#include <cstdint>
|
|
12
|
+
|
|
13
|
+
#include "src/element_parser.h"
|
|
14
|
+
#include "webm/callback.h"
|
|
15
|
+
#include "webm/reader.h"
|
|
16
|
+
#include "webm/status.h"
|
|
17
|
+
|
|
18
|
+
namespace webm {
|
|
19
|
+
|
|
20
|
+
// Parses a Void element by delegating to Callback::OnVoid.
|
|
21
|
+
// Spec reference:
|
|
22
|
+
// http://matroska.org/technical/specs/index.html#Void
|
|
23
|
+
// http://www.webmproject.org/docs/container/#Void
|
|
24
|
+
class VoidParser : public ElementParser {
|
|
25
|
+
public:
|
|
26
|
+
Status Init(const ElementMetadata& metadata, std::uint64_t max_size) override;
|
|
27
|
+
|
|
28
|
+
Status Feed(Callback* callback, Reader* reader,
|
|
29
|
+
std::uint64_t* num_bytes_read) override;
|
|
30
|
+
|
|
31
|
+
private:
|
|
32
|
+
// The metadata for this element.
|
|
33
|
+
ElementMetadata metadata_;
|
|
34
|
+
|
|
35
|
+
// The number of bytes remaining that have not been read in the element.
|
|
36
|
+
std::uint64_t bytes_remaining_ = 0;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
} // namespace webm
|
|
40
|
+
|
|
41
|
+
#endif // SRC_VOID_PARSER_H_
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
// Copyright (c) 2016 The WebM project authors. All Rights Reserved.
|
|
2
|
+
//
|
|
3
|
+
// Use of this source code is governed by a BSD-style license
|
|
4
|
+
// that can be found in the LICENSE file in the root of the source
|
|
5
|
+
// tree. An additional intellectual property rights grant can be found
|
|
6
|
+
// in the file PATENTS. All contributing project authors may
|
|
7
|
+
// be found in the AUTHORS file in the root of the source tree.
|
|
8
|
+
#include "webm/webm_parser.h"
|
|
9
|
+
|
|
10
|
+
#include <cassert>
|
|
11
|
+
#include <cstdint>
|
|
12
|
+
|
|
13
|
+
#include "src/ebml_parser.h"
|
|
14
|
+
#include "src/master_parser.h"
|
|
15
|
+
#include "src/segment_parser.h"
|
|
16
|
+
#include "src/unknown_parser.h"
|
|
17
|
+
#include "webm/element.h"
|
|
18
|
+
|
|
19
|
+
namespace webm {
|
|
20
|
+
|
|
21
|
+
// Parses WebM EBML documents (i.e. level-0 WebM elements).
|
|
22
|
+
class WebmParser::DocumentParser {
|
|
23
|
+
public:
|
|
24
|
+
// Resets the parser after a seek to a new position in the reader.
|
|
25
|
+
void DidSeek() {
|
|
26
|
+
PrepareForNextChild();
|
|
27
|
+
did_seek_ = true;
|
|
28
|
+
state_ = State::kBegin;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Feeds the parser; will return Status::kOkCompleted when the reader returns
|
|
32
|
+
// Status::kEndOfFile, but only if the parser has already completed parsing
|
|
33
|
+
// its child elements.
|
|
34
|
+
Status Feed(Callback* callback, Reader* reader) {
|
|
35
|
+
assert(callback != nullptr);
|
|
36
|
+
assert(reader != nullptr);
|
|
37
|
+
|
|
38
|
+
Callback* const original_callback = callback;
|
|
39
|
+
if (action_ == Action::kSkip) {
|
|
40
|
+
callback = &skip_callback_;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
Status status;
|
|
44
|
+
std::uint64_t num_bytes_read;
|
|
45
|
+
while (true) {
|
|
46
|
+
switch (state_) {
|
|
47
|
+
case State::kBegin: {
|
|
48
|
+
child_metadata_.header_size = 0;
|
|
49
|
+
child_metadata_.position = reader->Position();
|
|
50
|
+
state_ = State::kReadingChildId;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
case State::kReadingChildId: {
|
|
55
|
+
assert(child_parser_ == nullptr);
|
|
56
|
+
status = id_parser_.Feed(callback, reader, &num_bytes_read);
|
|
57
|
+
child_metadata_.header_size += num_bytes_read;
|
|
58
|
+
if (!status.completed_ok()) {
|
|
59
|
+
if (status.code == Status::kEndOfFile &&
|
|
60
|
+
reader->Position() == child_metadata_.position) {
|
|
61
|
+
state_ = State::kEndReached;
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
return status;
|
|
65
|
+
}
|
|
66
|
+
state_ = State::kReadingChildSize;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
case State::kReadingChildSize: {
|
|
71
|
+
assert(child_parser_ == nullptr);
|
|
72
|
+
status = size_parser_.Feed(callback, reader, &num_bytes_read);
|
|
73
|
+
child_metadata_.header_size += num_bytes_read;
|
|
74
|
+
if (!status.completed_ok()) {
|
|
75
|
+
return status;
|
|
76
|
+
}
|
|
77
|
+
child_metadata_.id = id_parser_.id();
|
|
78
|
+
child_metadata_.size = size_parser_.size();
|
|
79
|
+
state_ = State::kValidatingChildSize;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
case State::kValidatingChildSize: {
|
|
84
|
+
assert(child_parser_ == nullptr);
|
|
85
|
+
|
|
86
|
+
if (child_metadata_.id == Id::kSegment) {
|
|
87
|
+
child_parser_ = &segment_parser_;
|
|
88
|
+
did_seek_ = false;
|
|
89
|
+
state_ = State::kGettingAction;
|
|
90
|
+
continue;
|
|
91
|
+
} else if (child_metadata_.id == Id::kEbml) {
|
|
92
|
+
child_parser_ = &ebml_parser_;
|
|
93
|
+
did_seek_ = false;
|
|
94
|
+
state_ = State::kGettingAction;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
Ancestory ancestory;
|
|
99
|
+
if (did_seek_ && Ancestory::ById(child_metadata_.id, &ancestory)) {
|
|
100
|
+
assert(!ancestory.empty());
|
|
101
|
+
assert(ancestory.id() == Id::kSegment ||
|
|
102
|
+
ancestory.id() == Id::kEbml);
|
|
103
|
+
|
|
104
|
+
if (ancestory.id() == Id::kSegment) {
|
|
105
|
+
child_parser_ = &segment_parser_;
|
|
106
|
+
} else {
|
|
107
|
+
child_parser_ = &ebml_parser_;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
child_parser_->InitAfterSeek(ancestory.next(), child_metadata_);
|
|
111
|
+
child_metadata_.id = ancestory.id();
|
|
112
|
+
child_metadata_.header_size = kUnknownHeaderSize;
|
|
113
|
+
child_metadata_.size = kUnknownElementSize;
|
|
114
|
+
child_metadata_.position = kUnknownElementPosition;
|
|
115
|
+
did_seek_ = false;
|
|
116
|
+
action_ = Action::kRead;
|
|
117
|
+
state_ = State::kReadingChildBody;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (child_metadata_.id == Id::kVoid) {
|
|
122
|
+
child_parser_ = &void_parser_;
|
|
123
|
+
} else {
|
|
124
|
+
if (child_metadata_.size == kUnknownElementSize) {
|
|
125
|
+
return Status(Status::kIndefiniteUnknownElement);
|
|
126
|
+
}
|
|
127
|
+
child_parser_ = &unknown_parser_;
|
|
128
|
+
}
|
|
129
|
+
state_ = State::kGettingAction;
|
|
130
|
+
continue;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
case State::kGettingAction: {
|
|
134
|
+
assert(child_parser_ != nullptr);
|
|
135
|
+
status = callback->OnElementBegin(child_metadata_, &action_);
|
|
136
|
+
if (!status.completed_ok()) {
|
|
137
|
+
return status;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (action_ == Action::kSkip) {
|
|
141
|
+
callback = &skip_callback_;
|
|
142
|
+
if (child_metadata_.size != kUnknownElementSize) {
|
|
143
|
+
child_parser_ = &skip_parser_;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
state_ = State::kInitializingChildParser;
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
case State::kInitializingChildParser: {
|
|
151
|
+
assert(child_parser_ != nullptr);
|
|
152
|
+
status = child_parser_->Init(child_metadata_, child_metadata_.size);
|
|
153
|
+
if (!status.completed_ok()) {
|
|
154
|
+
return status;
|
|
155
|
+
}
|
|
156
|
+
state_ = State::kReadingChildBody;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
case State::kReadingChildBody: {
|
|
161
|
+
assert(child_parser_ != nullptr);
|
|
162
|
+
status = child_parser_->Feed(callback, reader, &num_bytes_read);
|
|
163
|
+
if (!status.completed_ok()) {
|
|
164
|
+
return status;
|
|
165
|
+
}
|
|
166
|
+
if (child_parser_->GetCachedMetadata(&child_metadata_)) {
|
|
167
|
+
state_ = State::kValidatingChildSize;
|
|
168
|
+
} else {
|
|
169
|
+
child_metadata_.header_size = 0;
|
|
170
|
+
state_ = State::kReadingChildId;
|
|
171
|
+
}
|
|
172
|
+
PrepareForNextChild();
|
|
173
|
+
callback = original_callback;
|
|
174
|
+
child_metadata_.position = reader->Position();
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
case State::kEndReached: {
|
|
179
|
+
return Status(Status::kOkCompleted);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
private:
|
|
186
|
+
// Parsing states for the finite-state machine.
|
|
187
|
+
enum class State {
|
|
188
|
+
/* clang-format off */
|
|
189
|
+
// State Transitions to state When
|
|
190
|
+
kBegin, // kReadingChildId done
|
|
191
|
+
kReadingChildId, // kReadingChildSize done
|
|
192
|
+
// kEndReached EOF
|
|
193
|
+
kReadingChildSize, // kValidatingChildSize done
|
|
194
|
+
kValidatingChildSize, // kGettingAction done
|
|
195
|
+
kGettingAction, // kInitializingChildParser done
|
|
196
|
+
kInitializingChildParser, // kReadingChildBody done
|
|
197
|
+
kReadingChildBody, // kValidatingChildSize cached metadata
|
|
198
|
+
// kReadingChildId otherwise
|
|
199
|
+
kEndReached, // No transitions from here
|
|
200
|
+
/* clang-format on */
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
// The parser for parsing child element Ids.
|
|
204
|
+
IdParser id_parser_;
|
|
205
|
+
|
|
206
|
+
// The parser for parsing child element sizes.
|
|
207
|
+
SizeParser size_parser_;
|
|
208
|
+
|
|
209
|
+
// The parser for Id::kEbml elements.
|
|
210
|
+
EbmlParser ebml_parser_;
|
|
211
|
+
|
|
212
|
+
// The parser for Id::kSegment child elements.
|
|
213
|
+
SegmentParser segment_parser_;
|
|
214
|
+
|
|
215
|
+
// The parser for Id::kVoid child elements.
|
|
216
|
+
VoidParser void_parser_;
|
|
217
|
+
|
|
218
|
+
// The parser used when skipping elements (if the element's size is known).
|
|
219
|
+
SkipParser skip_parser_;
|
|
220
|
+
|
|
221
|
+
// The parser used for unknown children.
|
|
222
|
+
UnknownParser unknown_parser_;
|
|
223
|
+
|
|
224
|
+
// The callback used when skipping elements.
|
|
225
|
+
SkipCallback skip_callback_;
|
|
226
|
+
|
|
227
|
+
// The parser that is parsing the current child element.
|
|
228
|
+
ElementParser* child_parser_ = nullptr;
|
|
229
|
+
|
|
230
|
+
// Metadata for the current child being parsed.
|
|
231
|
+
ElementMetadata child_metadata_ = {};
|
|
232
|
+
|
|
233
|
+
// Action for the current child being parsed.
|
|
234
|
+
Action action_ = Action::kRead;
|
|
235
|
+
|
|
236
|
+
// True if a seek was performed and the parser needs to handle it.
|
|
237
|
+
bool did_seek_ = false;
|
|
238
|
+
|
|
239
|
+
// The current state of the finite state machine.
|
|
240
|
+
State state_ = State::kBegin;
|
|
241
|
+
|
|
242
|
+
// Resets state in preparation for parsing a child element.
|
|
243
|
+
void PrepareForNextChild() {
|
|
244
|
+
id_parser_ = {};
|
|
245
|
+
size_parser_ = {};
|
|
246
|
+
child_parser_ = nullptr;
|
|
247
|
+
action_ = Action::kRead;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
// We have to explicitly declare a destructor (even if it's just defaulted)
|
|
252
|
+
// because using the pimpl idiom with std::unique_ptr requires it. See Herb
|
|
253
|
+
// Sutter's GotW #100 for further explanation.
|
|
254
|
+
WebmParser::~WebmParser() = default;
|
|
255
|
+
|
|
256
|
+
WebmParser::WebmParser() : parser_(new DocumentParser) {}
|
|
257
|
+
|
|
258
|
+
void WebmParser::DidSeek() {
|
|
259
|
+
parser_->DidSeek();
|
|
260
|
+
parsing_status_ = Status(Status::kOkPartial);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
Status WebmParser::Feed(Callback* callback, Reader* reader) {
|
|
264
|
+
assert(callback != nullptr);
|
|
265
|
+
assert(reader != nullptr);
|
|
266
|
+
|
|
267
|
+
if (parsing_status_.is_parsing_error()) {
|
|
268
|
+
return parsing_status_;
|
|
269
|
+
}
|
|
270
|
+
parsing_status_ = parser_->Feed(callback, reader);
|
|
271
|
+
return parsing_status_;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
void WebmParser::Swap(WebmParser* other) {
|
|
275
|
+
assert(other != nullptr);
|
|
276
|
+
parser_.swap(other->parser_);
|
|
277
|
+
std::swap(parsing_status_, other->parsing_status_);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
void swap(WebmParser& left, WebmParser& right) { left.Swap(&right); }
|
|
281
|
+
|
|
282
|
+
} // namespace webm
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Daniel Kasprowicz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# range-source (native)
|
|
2
|
+
|
|
3
|
+
`include/` is `native/include` from [range-source](https://github.com/MediaCacheDev/range-source), unmodified, at commit `5c5dd0929ddbfbb51730b41d9dfd1a468d35e58e`. MIT, by the same author as this repository.
|
|
4
|
+
|
|
5
|
+
- `include/range_source.h` is the add-on's C interface, a table of functions, with a C++ wrapper over it. The player finds the add-on at runtime and reads URLs and data sources through it (`cpp/RangeSourceClient.h`).
|
|
6
|
+
- `include/range_source_download.h` is the basic input, for when the add-on isn't there: a URL downloaded whole into a temporary file, read as it arrives.
|
|
7
|
+
|
|
8
|
+
To update, run `scripts/vendor_range_source.sh` against a newer checkout. Its tests live in that repository (`native/test`).
|