react-native-audio-api 0.8.0-nightly-5a12f24-20250901 → 0.8.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/RNAudioAPI.podspec +15 -6
- package/android/build.gradle +11 -2
- package/android/src/main/cpp/audioapi/CMakeLists.txt +24 -17
- package/android/src/main/cpp/audioapi/android/core/AudioDecoder.cpp +51 -21
- package/android/src/main/jniLibs/arm64-v8a/libavcodec.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libavformat.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libavutil.so +0 -0
- package/android/src/main/jniLibs/arm64-v8a/libswresample.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libavcodec.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libavformat.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libavutil.so +0 -0
- package/android/src/main/jniLibs/armeabi-v7a/libswresample.so +0 -0
- package/android/src/main/jniLibs/x86/libavcodec.so +0 -0
- package/android/src/main/jniLibs/x86/libavformat.so +0 -0
- package/android/src/main/jniLibs/x86/libavutil.so +0 -0
- package/android/src/main/jniLibs/x86/libswresample.so +0 -0
- package/android/src/main/jniLibs/x86_64/libavcodec.so +0 -0
- package/android/src/main/jniLibs/x86_64/libavformat.so +0 -0
- package/android/src/main/jniLibs/x86_64/libavutil.so +0 -0
- package/android/src/main/jniLibs/x86_64/libswresample.so +0 -0
- package/common/cpp/audioapi/HostObjects/BaseAudioContextHostObject.h +11 -0
- package/common/cpp/audioapi/HostObjects/StreamerNodeHostObject.h +30 -0
- package/common/cpp/audioapi/core/BaseAudioContext.cpp +9 -0
- package/common/cpp/audioapi/core/BaseAudioContext.h +2 -0
- package/common/cpp/audioapi/core/sources/StreamerNode.cpp +299 -0
- package/common/cpp/audioapi/core/sources/StreamerNode.h +123 -0
- package/common/cpp/audioapi/core/utils/AudioDecoder.h +61 -0
- package/common/cpp/audioapi/core/utils/AudioNodeManager.cpp +14 -2
- package/common/cpp/audioapi/core/utils/AudioNodeManager.h +3 -0
- package/common/cpp/audioapi/external/arm64-v8a/libcrypto.a +0 -0
- package/common/cpp/audioapi/external/arm64-v8a/libssl.a +0 -0
- package/common/cpp/audioapi/external/armeabi-v7a/libcrypto.a +0 -0
- package/common/cpp/audioapi/external/armeabi-v7a/libssl.a +0 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/ac3_parser.h +36 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/adts_parser.h +37 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avcodec.h +2947 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/avdct.h +88 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/bsf.h +332 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec.h +367 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_desc.h +134 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_id.h +681 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/codec_par.h +248 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/d3d11va.h +109 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/defs.h +359 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dirac.h +135 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dv_profile.h +82 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/dxva2.h +90 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/jni.h +67 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/mediacodec.h +103 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/packet.h +907 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/qsv.h +109 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vdpau.h +138 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version.h +45 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/version_major.h +55 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/videotoolbox.h +85 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavcodec/vorbis_parser.h +74 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avformat.h +3004 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavformat/avio.h +831 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version.h +47 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavformat/version_major.h +50 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/adler32.h +63 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes.h +69 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/aes_ctr.h +99 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ambient_viewing_environment.h +72 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/attributes.h +175 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/audio_fifo.h +187 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avassert.h +120 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avconfig.h +6 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avstring.h +428 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/avutil.h +364 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/base64.h +72 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/blowfish.h +82 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bprint.h +254 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/bswap.h +105 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/buffer.h +322 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/camellia.h +70 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cast5.h +80 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/channel_layout.h +762 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/common.h +589 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/container_fifo.h +130 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/cpu.h +150 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/crc.h +102 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/csp.h +192 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/des.h +81 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/detection_bbox.h +108 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dict.h +242 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/display.h +109 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/dovi_meta.h +396 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/downmix_info.h +115 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/encryption_info.h +205 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/error.h +129 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/eval.h +140 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/executor.h +67 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ffversion.h +5 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/fifo.h +242 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/file.h +62 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/film_grain_params.h +282 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/frame.h +1163 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hash.h +264 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_metadata.h +376 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hdr_dynamic_vivid_metadata.h +292 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hmac.h +99 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext.h +601 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_amf.h +46 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_cuda.h +74 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d11va.h +178 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_d3d12va.h +142 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_drm.h +169 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_dxva2.h +75 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_mediacodec.h +61 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_oh.h +34 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_opencl.h +100 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_qsv.h +87 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vaapi.h +117 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vdpau.h +44 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_videotoolbox.h +106 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/hwcontext_vulkan.h +377 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/iamf.h +694 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/imgutils.h +377 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intfloat.h +77 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/intreadwrite.h +677 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lfg.h +81 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/log.h +427 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/lzo.h +66 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/macros.h +80 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mastering_display_metadata.h +137 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mathematics.h +300 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/md5.h +89 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/mem.h +607 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/motion_vector.h +57 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/murmur3.h +115 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/opt.h +1194 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/parseutils.h +197 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixdesc.h +440 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixelutils.h +51 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/pixfmt.h +797 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/random_seed.h +57 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rational.h +225 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/rc4.h +69 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/refstruct.h +297 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/replaygain.h +50 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/ripemd.h +83 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/samplefmt.h +269 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha.h +90 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/sha512.h +92 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/spherical.h +243 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/stereo3d.h +325 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tdrdi.h +164 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tea.h +71 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/threadmessage.h +115 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timecode.h +199 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/timestamp.h +85 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tree.h +137 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/twofish.h +70 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/tx.h +210 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/uuid.h +146 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/version.h +119 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_enc_params.h +171 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/video_hint.h +107 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libavutil/xtea.h +94 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libswresample/swresample.h +587 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version.h +46 -0
- package/common/cpp/audioapi/external/ffmpeg_include/libswresample/version_major.h +31 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/Info.plist +44 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64/libavcodec.framework/libavcodec +0 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavcodec.xcframework/ios-arm64_x86_64-simulator/libavcodec.framework/libavcodec +0 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/Info.plist +44 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64/libavformat.framework/libavformat +0 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavformat.xcframework/ios-arm64_x86_64-simulator/libavformat.framework/libavformat +0 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/Info.plist +44 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64/libavutil.framework/libavutil +0 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libavutil.xcframework/ios-arm64_x86_64-simulator/libavutil.framework/libavutil +0 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/Info.plist +44 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64/libswresample.framework/libswresample +0 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/Info.plist +1 -0
- package/common/cpp/audioapi/external/libswresample.xcframework/ios-arm64_x86_64-simulator/libswresample.framework/libswresample +0 -0
- package/common/cpp/audioapi/external/x86/libcrypto.a +0 -0
- package/common/cpp/audioapi/external/x86/libssl.a +0 -0
- package/common/cpp/audioapi/external/x86_64/libcrypto.a +0 -0
- package/common/cpp/audioapi/external/x86_64/libssl.a +0 -0
- package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.cpp +402 -0
- package/common/cpp/audioapi/libs/ffmpeg/FFmpegDecoding.h +27 -0
- package/common/cpp/audioapi/libs/ffmpeg/INSTRUCTIONS.md +26 -0
- package/common/cpp/audioapi/libs/ffmpeg/create_xcframework.sh +111 -0
- package/common/cpp/audioapi/libs/ffmpeg/ffmpeg_setup.sh +361 -0
- package/common/cpp/audioapi/utils/SpscChannel.hpp +47 -38
- package/common/cpp/test/CMakeLists.txt +7 -1
- package/ios/audioapi/ios/core/AudioDecoder.mm +22 -2
- package/lib/commonjs/api.js +7 -0
- package/lib/commonjs/api.js.map +1 -1
- package/lib/commonjs/core/AudioContext.js.map +1 -1
- package/lib/commonjs/core/BaseAudioContext.js +4 -0
- package/lib/commonjs/core/BaseAudioContext.js.map +1 -1
- package/lib/commonjs/core/StreamerNode.js +15 -0
- package/lib/commonjs/core/StreamerNode.js.map +1 -0
- package/lib/module/api.js +1 -0
- package/lib/module/api.js.map +1 -1
- package/lib/module/core/AudioContext.js.map +1 -1
- package/lib/module/core/BaseAudioContext.js +4 -0
- package/lib/module/core/BaseAudioContext.js.map +1 -1
- package/lib/module/core/StreamerNode.js +9 -0
- package/lib/module/core/StreamerNode.js.map +1 -0
- package/lib/typescript/api.d.ts +1 -0
- package/lib/typescript/api.d.ts.map +1 -1
- package/lib/typescript/core/AudioContext.d.ts +1 -1
- package/lib/typescript/core/AudioContext.d.ts.map +1 -1
- package/lib/typescript/core/BaseAudioContext.d.ts +2 -0
- package/lib/typescript/core/BaseAudioContext.d.ts.map +1 -1
- package/lib/typescript/core/StreamerNode.d.ts +5 -0
- package/lib/typescript/core/StreamerNode.d.ts.map +1 -0
- package/lib/typescript/interfaces.d.ts +5 -1
- package/lib/typescript/interfaces.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/api.ts +1 -0
- package/src/core/AudioContext.ts +1 -1
- package/src/core/BaseAudioContext.ts +5 -0
- package/src/core/StreamerNode.ts +8 -0
- package/src/interfaces.ts +6 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* JNI public API functions
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015-2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of FFmpeg.
|
|
7
|
+
*
|
|
8
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef AVCODEC_JNI_H
|
|
24
|
+
#define AVCODEC_JNI_H
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* Manually set a Java virtual machine which will be used to retrieve the JNI
|
|
28
|
+
* environment. Once a Java VM is set it cannot be changed afterwards, meaning
|
|
29
|
+
* you can call multiple times av_jni_set_java_vm with the same Java VM pointer
|
|
30
|
+
* however it will error out if you try to set a different Java VM.
|
|
31
|
+
*
|
|
32
|
+
* @param vm Java virtual machine
|
|
33
|
+
* @param log_ctx context used for logging, can be NULL
|
|
34
|
+
* @return 0 on success, < 0 otherwise
|
|
35
|
+
*/
|
|
36
|
+
int av_jni_set_java_vm(void *vm, void *log_ctx);
|
|
37
|
+
|
|
38
|
+
/*
|
|
39
|
+
* Get the Java virtual machine which has been set with av_jni_set_java_vm.
|
|
40
|
+
*
|
|
41
|
+
* @param vm Java virtual machine
|
|
42
|
+
* @return a pointer to the Java virtual machine
|
|
43
|
+
*/
|
|
44
|
+
void *av_jni_get_java_vm(void *log_ctx);
|
|
45
|
+
|
|
46
|
+
/*
|
|
47
|
+
* Set the Android application context which will be used to retrieve the Android
|
|
48
|
+
* content resolver to handle content uris.
|
|
49
|
+
*
|
|
50
|
+
* This function is only available on Android.
|
|
51
|
+
*
|
|
52
|
+
* @param app_ctx global JNI reference to the Android application context
|
|
53
|
+
* @return 0 on success, < 0 otherwise
|
|
54
|
+
*/
|
|
55
|
+
int av_jni_set_android_app_ctx(void *app_ctx, void *log_ctx);
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Get the Android application context that has been set with
|
|
59
|
+
* av_jni_set_android_app_ctx.
|
|
60
|
+
*
|
|
61
|
+
* This function is only available on Android.
|
|
62
|
+
*
|
|
63
|
+
* @return a pointer the the Android application context
|
|
64
|
+
*/
|
|
65
|
+
void *av_jni_get_android_app_ctx(void);
|
|
66
|
+
|
|
67
|
+
#endif /* AVCODEC_JNI_H */
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Android MediaCodec public API
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2016 Matthieu Bouron <matthieu.bouron stupeflix.com>
|
|
5
|
+
*
|
|
6
|
+
* This file is part of FFmpeg.
|
|
7
|
+
*
|
|
8
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
9
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
10
|
+
* License as published by the Free Software Foundation; either
|
|
11
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
12
|
+
*
|
|
13
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
14
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
16
|
+
* Lesser General Public License for more details.
|
|
17
|
+
*
|
|
18
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
19
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
20
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
#ifndef AVCODEC_MEDIACODEC_H
|
|
24
|
+
#define AVCODEC_MEDIACODEC_H
|
|
25
|
+
|
|
26
|
+
#include "libavcodec/avcodec.h"
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* This structure holds a reference to a android/view/Surface object that will
|
|
30
|
+
* be used as output by the decoder.
|
|
31
|
+
*
|
|
32
|
+
*/
|
|
33
|
+
typedef struct AVMediaCodecContext {
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* android/view/Surface object reference.
|
|
37
|
+
*/
|
|
38
|
+
void *surface;
|
|
39
|
+
|
|
40
|
+
} AVMediaCodecContext;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Allocate and initialize a MediaCodec context.
|
|
44
|
+
*
|
|
45
|
+
* When decoding with MediaCodec is finished, the caller must free the
|
|
46
|
+
* MediaCodec context with av_mediacodec_default_free.
|
|
47
|
+
*
|
|
48
|
+
* @return a pointer to a newly allocated AVMediaCodecContext on success, NULL otherwise
|
|
49
|
+
*/
|
|
50
|
+
AVMediaCodecContext *av_mediacodec_alloc_context(void);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Convenience function that sets up the MediaCodec context.
|
|
54
|
+
*
|
|
55
|
+
* @param avctx codec context
|
|
56
|
+
* @param ctx MediaCodec context to initialize
|
|
57
|
+
* @param surface reference to an android/view/Surface
|
|
58
|
+
* @return 0 on success, < 0 otherwise
|
|
59
|
+
*/
|
|
60
|
+
int av_mediacodec_default_init(AVCodecContext *avctx, AVMediaCodecContext *ctx, void *surface);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* This function must be called to free the MediaCodec context initialized with
|
|
64
|
+
* av_mediacodec_default_init().
|
|
65
|
+
*
|
|
66
|
+
* @param avctx codec context
|
|
67
|
+
*/
|
|
68
|
+
void av_mediacodec_default_free(AVCodecContext *avctx);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Opaque structure representing a MediaCodec buffer to render.
|
|
72
|
+
*/
|
|
73
|
+
typedef struct MediaCodecBuffer AVMediaCodecBuffer;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Release a MediaCodec buffer and render it to the surface that is associated
|
|
77
|
+
* with the decoder. This function should only be called once on a given
|
|
78
|
+
* buffer, once released the underlying buffer returns to the codec, thus
|
|
79
|
+
* subsequent calls to this function will have no effect.
|
|
80
|
+
*
|
|
81
|
+
* @param buffer the buffer to render
|
|
82
|
+
* @param render 1 to release and render the buffer to the surface or 0 to
|
|
83
|
+
* discard the buffer
|
|
84
|
+
* @return 0 on success, < 0 otherwise
|
|
85
|
+
*/
|
|
86
|
+
int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Release a MediaCodec buffer and render it at the given time to the surface
|
|
90
|
+
* that is associated with the decoder. The timestamp must be within one second
|
|
91
|
+
* of the current `java/lang/System#nanoTime()` (which is implemented using
|
|
92
|
+
* `CLOCK_MONOTONIC` on Android). See the Android MediaCodec documentation
|
|
93
|
+
* of [`android/media/MediaCodec#releaseOutputBuffer(int,long)`][0] for more details.
|
|
94
|
+
*
|
|
95
|
+
* @param buffer the buffer to render
|
|
96
|
+
* @param time timestamp in nanoseconds of when to render the buffer
|
|
97
|
+
* @return 0 on success, < 0 otherwise
|
|
98
|
+
*
|
|
99
|
+
* [0]: https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long)
|
|
100
|
+
*/
|
|
101
|
+
int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time);
|
|
102
|
+
|
|
103
|
+
#endif /* AVCODEC_MEDIACODEC_H */
|