@drutech/react-native-audio-analyzer 1.1.1-alpha.1
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 +20 -0
- package/README.md +124 -0
- package/android/CMakeCache.txt +372 -0
- package/android/CMakeLists.txt +44 -0
- package/android/Makefile +211 -0
- package/android/build.gradle +110 -0
- package/android/cmake_install.cmake +49 -0
- package/android/cpp-adapter.cpp +40 -0
- package/android/ffmpeg_16kb/include/config.h +749 -0
- package/android/ffmpeg_16kb/include/libavcodec/ac3_parser.h +36 -0
- package/android/ffmpeg_16kb/include/libavcodec/adts_parser.h +37 -0
- package/android/ffmpeg_16kb/include/libavcodec/arm/mathops.h +108 -0
- package/android/ffmpeg_16kb/include/libavcodec/avcodec.h +3192 -0
- package/android/ffmpeg_16kb/include/libavcodec/avdct.h +88 -0
- package/android/ffmpeg_16kb/include/libavcodec/avfft.h +118 -0
- package/android/ffmpeg_16kb/include/libavcodec/bsf.h +332 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec.h +375 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_desc.h +128 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_id.h +661 -0
- package/android/ffmpeg_16kb/include/libavcodec/codec_par.h +247 -0
- package/android/ffmpeg_16kb/include/libavcodec/d3d11va.h +112 -0
- package/android/ffmpeg_16kb/include/libavcodec/defs.h +192 -0
- package/android/ffmpeg_16kb/include/libavcodec/dirac.h +131 -0
- package/android/ffmpeg_16kb/include/libavcodec/dv_profile.h +82 -0
- package/android/ffmpeg_16kb/include/libavcodec/dxva2.h +93 -0
- package/android/ffmpeg_16kb/include/libavcodec/jni.h +46 -0
- package/android/ffmpeg_16kb/include/libavcodec/mathops.h +255 -0
- package/android/ffmpeg_16kb/include/libavcodec/mediacodec.h +103 -0
- package/android/ffmpeg_16kb/include/libavcodec/packet.h +731 -0
- package/android/ffmpeg_16kb/include/libavcodec/qsv.h +109 -0
- package/android/ffmpeg_16kb/include/libavcodec/vdpau.h +157 -0
- package/android/ffmpeg_16kb/include/libavcodec/version.h +45 -0
- package/android/ffmpeg_16kb/include/libavcodec/version_major.h +52 -0
- package/android/ffmpeg_16kb/include/libavcodec/videotoolbox.h +150 -0
- package/android/ffmpeg_16kb/include/libavcodec/vorbis_parser.h +74 -0
- package/android/ffmpeg_16kb/include/libavcodec/x86/mathops.h +133 -0
- package/android/ffmpeg_16kb/include/libavcodec/xvmc.h +171 -0
- package/android/ffmpeg_16kb/include/libavdevice/avdevice.h +397 -0
- package/android/ffmpeg_16kb/include/libavdevice/version.h +45 -0
- package/android/ffmpeg_16kb/include/libavdevice/version_major.h +36 -0
- package/android/ffmpeg_16kb/include/libavfilter/avfilter.h +1491 -0
- package/android/ffmpeg_16kb/include/libavfilter/buffersink.h +173 -0
- package/android/ffmpeg_16kb/include/libavfilter/buffersrc.h +218 -0
- package/android/ffmpeg_16kb/include/libavfilter/version.h +48 -0
- package/android/ffmpeg_16kb/include/libavfilter/version_major.h +38 -0
- package/android/ffmpeg_16kb/include/libavformat/avformat.h +2826 -0
- package/android/ffmpeg_16kb/include/libavformat/avio.h +837 -0
- package/android/ffmpeg_16kb/include/libavformat/network.h +341 -0
- package/android/ffmpeg_16kb/include/libavformat/os_support.h +317 -0
- package/android/ffmpeg_16kb/include/libavformat/url.h +409 -0
- package/android/ffmpeg_16kb/include/libavformat/version.h +47 -0
- package/android/ffmpeg_16kb/include/libavformat/version_major.h +52 -0
- package/android/ffmpeg_16kb/include/libavutil/aarch64/timer.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/adler32.h +63 -0
- package/android/ffmpeg_16kb/include/libavutil/aes.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/aes_ctr.h +99 -0
- package/android/ffmpeg_16kb/include/libavutil/ambient_viewing_environment.h +72 -0
- package/android/ffmpeg_16kb/include/libavutil/arm/timer.h +46 -0
- package/android/ffmpeg_16kb/include/libavutil/attributes.h +173 -0
- package/android/ffmpeg_16kb/include/libavutil/attributes_internal.h +34 -0
- package/android/ffmpeg_16kb/include/libavutil/audio_fifo.h +186 -0
- package/android/ffmpeg_16kb/include/libavutil/avassert.h +75 -0
- package/android/ffmpeg_16kb/include/libavutil/avconfig.h +6 -0
- package/android/ffmpeg_16kb/include/libavutil/avstring.h +429 -0
- package/android/ffmpeg_16kb/include/libavutil/avutil.h +371 -0
- package/android/ffmpeg_16kb/include/libavutil/base64.h +72 -0
- package/android/ffmpeg_16kb/include/libavutil/blowfish.h +82 -0
- package/android/ffmpeg_16kb/include/libavutil/bprint.h +251 -0
- package/android/ffmpeg_16kb/include/libavutil/bswap.h +111 -0
- package/android/ffmpeg_16kb/include/libavutil/buffer.h +322 -0
- package/android/ffmpeg_16kb/include/libavutil/camellia.h +70 -0
- package/android/ffmpeg_16kb/include/libavutil/cast5.h +80 -0
- package/android/ffmpeg_16kb/include/libavutil/channel_layout.h +783 -0
- package/android/ffmpeg_16kb/include/libavutil/common.h +578 -0
- package/android/ffmpeg_16kb/include/libavutil/cpu.h +134 -0
- package/android/ffmpeg_16kb/include/libavutil/crc.h +102 -0
- package/android/ffmpeg_16kb/include/libavutil/csp.h +150 -0
- package/android/ffmpeg_16kb/include/libavutil/des.h +81 -0
- package/android/ffmpeg_16kb/include/libavutil/detection_bbox.h +108 -0
- package/android/ffmpeg_16kb/include/libavutil/dict.h +241 -0
- package/android/ffmpeg_16kb/include/libavutil/display.h +109 -0
- package/android/ffmpeg_16kb/include/libavutil/dovi_meta.h +236 -0
- package/android/ffmpeg_16kb/include/libavutil/downmix_info.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/encryption_info.h +205 -0
- package/android/ffmpeg_16kb/include/libavutil/error.h +128 -0
- package/android/ffmpeg_16kb/include/libavutil/eval.h +140 -0
- package/android/ffmpeg_16kb/include/libavutil/ffversion.h +5 -0
- package/android/ffmpeg_16kb/include/libavutil/fifo.h +448 -0
- package/android/ffmpeg_16kb/include/libavutil/file.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/film_grain_params.h +260 -0
- package/android/ffmpeg_16kb/include/libavutil/frame.h +964 -0
- package/android/ffmpeg_16kb/include/libavutil/getenv_utf8.h +86 -0
- package/android/ffmpeg_16kb/include/libavutil/hash.h +264 -0
- package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_metadata.h +343 -0
- package/android/ffmpeg_16kb/include/libavutil/hdr_dynamic_vivid_metadata.h +285 -0
- package/android/ffmpeg_16kb/include/libavutil/hmac.h +99 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext.h +610 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_cuda.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_d3d11va.h +178 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_drm.h +169 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_dxva2.h +75 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_mediacodec.h +61 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_opencl.h +100 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_qsv.h +64 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vaapi.h +117 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vdpau.h +44 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_videotoolbox.h +96 -0
- package/android/ffmpeg_16kb/include/libavutil/hwcontext_vulkan.h +281 -0
- package/android/ffmpeg_16kb/include/libavutil/imgutils.h +331 -0
- package/android/ffmpeg_16kb/include/libavutil/internal.h +190 -0
- package/android/ffmpeg_16kb/include/libavutil/intfloat.h +77 -0
- package/android/ffmpeg_16kb/include/libavutil/intreadwrite.h +644 -0
- package/android/ffmpeg_16kb/include/libavutil/lfg.h +81 -0
- package/android/ffmpeg_16kb/include/libavutil/libm.h +471 -0
- package/android/ffmpeg_16kb/include/libavutil/log.h +387 -0
- package/android/ffmpeg_16kb/include/libavutil/lzo.h +66 -0
- package/android/ffmpeg_16kb/include/libavutil/macros.h +80 -0
- package/android/ffmpeg_16kb/include/libavutil/mastering_display_metadata.h +128 -0
- package/android/ffmpeg_16kb/include/libavutil/mathematics.h +245 -0
- package/android/ffmpeg_16kb/include/libavutil/md5.h +89 -0
- package/android/ffmpeg_16kb/include/libavutil/mem.h +609 -0
- package/android/ffmpeg_16kb/include/libavutil/motion_vector.h +57 -0
- package/android/ffmpeg_16kb/include/libavutil/murmur3.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/opt.h +891 -0
- package/android/ffmpeg_16kb/include/libavutil/parseutils.h +197 -0
- package/android/ffmpeg_16kb/include/libavutil/pixdesc.h +435 -0
- package/android/ffmpeg_16kb/include/libavutil/pixelutils.h +51 -0
- package/android/ffmpeg_16kb/include/libavutil/pixfmt.h +691 -0
- package/android/ffmpeg_16kb/include/libavutil/random_seed.h +43 -0
- package/android/ffmpeg_16kb/include/libavutil/rational.h +221 -0
- package/android/ffmpeg_16kb/include/libavutil/rc4.h +69 -0
- package/android/ffmpeg_16kb/include/libavutil/replaygain.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/reverse.h +28 -0
- package/android/ffmpeg_16kb/include/libavutil/ripemd.h +83 -0
- package/android/ffmpeg_16kb/include/libavutil/samplefmt.h +269 -0
- package/android/ffmpeg_16kb/include/libavutil/sha.h +90 -0
- package/android/ffmpeg_16kb/include/libavutil/sha512.h +92 -0
- package/android/ffmpeg_16kb/include/libavutil/spherical.h +227 -0
- package/android/ffmpeg_16kb/include/libavutil/stereo3d.h +229 -0
- package/android/ffmpeg_16kb/include/libavutil/tea.h +71 -0
- package/android/ffmpeg_16kb/include/libavutil/thread.h +204 -0
- package/android/ffmpeg_16kb/include/libavutil/threadmessage.h +115 -0
- package/android/ffmpeg_16kb/include/libavutil/time.h +56 -0
- package/android/ffmpeg_16kb/include/libavutil/timecode.h +199 -0
- package/android/ffmpeg_16kb/include/libavutil/timer.h +156 -0
- package/android/ffmpeg_16kb/include/libavutil/timestamp.h +78 -0
- package/android/ffmpeg_16kb/include/libavutil/tree.h +137 -0
- package/android/ffmpeg_16kb/include/libavutil/twofish.h +70 -0
- package/android/ffmpeg_16kb/include/libavutil/tx.h +176 -0
- package/android/ffmpeg_16kb/include/libavutil/uuid.h +146 -0
- package/android/ffmpeg_16kb/include/libavutil/version.h +122 -0
- package/android/ffmpeg_16kb/include/libavutil/video_enc_params.h +171 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/asm.h +154 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/emms.h +58 -0
- package/android/ffmpeg_16kb/include/libavutil/x86/timer.h +50 -0
- package/android/ffmpeg_16kb/include/libavutil/xtea.h +94 -0
- package/android/ffmpeg_16kb/include/libswresample/swresample.h +650 -0
- package/android/ffmpeg_16kb/include/libswresample/version.h +46 -0
- package/android/ffmpeg_16kb/include/libswresample/version_major.h +31 -0
- package/android/ffmpeg_16kb/include/libswscale/swscale.h +436 -0
- package/android/ffmpeg_16kb/include/libswscale/version.h +44 -0
- package/android/ffmpeg_16kb/include/libswscale/version_major.h +35 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/arm64-v8a/libswscale.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavcodec_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavdevice_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavfilter_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavformat_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libavutil_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libswresample_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/armeabi-v7a/libswscale_neon.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/x86/libswscale.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavcodec.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavdevice.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavfilter.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavformat.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libavutil.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libswresample.so +0 -0
- package/android/ffmpeg_16kb/lib/x86_64/libswscale.so +0 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/audioanalyzer/AmplitudeData.java +20 -0
- package/android/src/main/java/com/audioanalyzer/AudioAnalyzerModule.java +52 -0
- package/android/src/main/java/com/audioanalyzer/AudioAnalyzerPackage.java +28 -0
- package/cpp/react-native-audio-analyzer.cpp +143 -0
- package/cpp/react-native-audio-analyzer.h +27 -0
- package/ios/AudioAnalyzer.h +19 -0
- package/ios/AudioAnalyzer.mm +43 -0
- package/lib/commonjs/helpers.js +34 -0
- package/lib/commonjs/helpers.js.map +1 -0
- package/lib/commonjs/helpers.test.js +49 -0
- package/lib/commonjs/helpers.test.js.map +1 -0
- package/lib/commonjs/index.js +35 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/helpers.js +27 -0
- package/lib/module/helpers.js.map +1 -0
- package/lib/module/helpers.test.js +47 -0
- package/lib/module/helpers.test.js.map +1 -0
- package/lib/module/index.js +15 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/helpers.d.ts +3 -0
- package/lib/typescript/src/helpers.d.ts.map +1 -0
- package/lib/typescript/src/helpers.test.d.ts +2 -0
- package/lib/typescript/src/helpers.test.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +7 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +163 -0
- package/react-native-audio-analyzer.podspec +44 -0
- package/src/helpers.test.ts +59 -0
- package/src/helpers.ts +34 -0
- package/src/index.tsx +30 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* simple math operations
|
|
3
|
+
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al
|
|
4
|
+
*
|
|
5
|
+
* This file is part of FFmpeg.
|
|
6
|
+
*
|
|
7
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
8
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
9
|
+
* License as published by the Free Software Foundation; either
|
|
10
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
11
|
+
*
|
|
12
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
13
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
15
|
+
* Lesser General Public License for more details.
|
|
16
|
+
*
|
|
17
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
18
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
19
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
#ifndef AVCODEC_X86_MATHOPS_H
|
|
23
|
+
#define AVCODEC_X86_MATHOPS_H
|
|
24
|
+
|
|
25
|
+
#include "config.h"
|
|
26
|
+
|
|
27
|
+
#include "libavutil/common.h"
|
|
28
|
+
#include "libavutil/x86/asm.h"
|
|
29
|
+
|
|
30
|
+
#if HAVE_INLINE_ASM
|
|
31
|
+
|
|
32
|
+
#if ARCH_X86_32
|
|
33
|
+
|
|
34
|
+
#define MULL MULL
|
|
35
|
+
static av_always_inline av_const int MULL(int a, int b, unsigned shift)
|
|
36
|
+
{
|
|
37
|
+
int rt, dummy;
|
|
38
|
+
__asm__ (
|
|
39
|
+
"imull %3 \n\t"
|
|
40
|
+
"shrdl %4, %%edx, %%eax \n\t"
|
|
41
|
+
:"=a"(rt), "=d"(dummy)
|
|
42
|
+
:"a"(a), "rm"(b), "ci"((uint8_t)shift)
|
|
43
|
+
);
|
|
44
|
+
return rt;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#define MULH MULH
|
|
48
|
+
static av_always_inline av_const int MULH(int a, int b)
|
|
49
|
+
{
|
|
50
|
+
int rt, dummy;
|
|
51
|
+
__asm__ (
|
|
52
|
+
"imull %3"
|
|
53
|
+
:"=d"(rt), "=a"(dummy)
|
|
54
|
+
:"a"(a), "rm"(b)
|
|
55
|
+
);
|
|
56
|
+
return rt;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#define MUL64 MUL64
|
|
60
|
+
static av_always_inline av_const int64_t MUL64(int a, int b)
|
|
61
|
+
{
|
|
62
|
+
int64_t rt;
|
|
63
|
+
__asm__ (
|
|
64
|
+
"imull %2"
|
|
65
|
+
:"=A"(rt)
|
|
66
|
+
:"a"(a), "rm"(b)
|
|
67
|
+
);
|
|
68
|
+
return rt;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
#endif /* ARCH_X86_32 */
|
|
72
|
+
|
|
73
|
+
#if HAVE_I686
|
|
74
|
+
/* median of 3 */
|
|
75
|
+
#define mid_pred mid_pred
|
|
76
|
+
static inline av_const int mid_pred(int a, int b, int c)
|
|
77
|
+
{
|
|
78
|
+
int i=b;
|
|
79
|
+
__asm__ (
|
|
80
|
+
"cmp %2, %1 \n\t"
|
|
81
|
+
"cmovg %1, %0 \n\t"
|
|
82
|
+
"cmovg %2, %1 \n\t"
|
|
83
|
+
"cmp %3, %1 \n\t"
|
|
84
|
+
"cmovl %3, %1 \n\t"
|
|
85
|
+
"cmp %1, %0 \n\t"
|
|
86
|
+
"cmovg %1, %0 \n\t"
|
|
87
|
+
:"+&r"(i), "+&r"(a)
|
|
88
|
+
:"r"(b), "r"(c)
|
|
89
|
+
);
|
|
90
|
+
return i;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
#if HAVE_6REGS
|
|
94
|
+
#define COPY3_IF_LT(x, y, a, b, c, d)\
|
|
95
|
+
__asm__ volatile(\
|
|
96
|
+
"cmpl %0, %3 \n\t"\
|
|
97
|
+
"cmovl %3, %0 \n\t"\
|
|
98
|
+
"cmovl %4, %1 \n\t"\
|
|
99
|
+
"cmovl %5, %2 \n\t"\
|
|
100
|
+
: "+&r" (x), "+&r" (a), "+r" (c)\
|
|
101
|
+
: "r" (y), "r" (b), "r" (d)\
|
|
102
|
+
);
|
|
103
|
+
#endif /* HAVE_6REGS */
|
|
104
|
+
|
|
105
|
+
#endif /* HAVE_I686 */
|
|
106
|
+
|
|
107
|
+
#define MASK_ABS(mask, level) \
|
|
108
|
+
__asm__ ("cdq \n\t" \
|
|
109
|
+
"xorl %1, %0 \n\t" \
|
|
110
|
+
"subl %1, %0 \n\t" \
|
|
111
|
+
: "+a"(level), "=&d"(mask))
|
|
112
|
+
|
|
113
|
+
// avoid +32 for shift optimization (gcc should do that ...)
|
|
114
|
+
#define NEG_SSR32 NEG_SSR32
|
|
115
|
+
static inline int32_t NEG_SSR32( int32_t a, int8_t s){
|
|
116
|
+
__asm__ ("sarl %1, %0\n\t"
|
|
117
|
+
: "+r" (a)
|
|
118
|
+
: "ic" ((uint8_t)(-s))
|
|
119
|
+
);
|
|
120
|
+
return a;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
#define NEG_USR32 NEG_USR32
|
|
124
|
+
static inline uint32_t NEG_USR32(uint32_t a, int8_t s){
|
|
125
|
+
__asm__ ("shrl %1, %0\n\t"
|
|
126
|
+
: "+r" (a)
|
|
127
|
+
: "ic" ((uint8_t)(-s))
|
|
128
|
+
);
|
|
129
|
+
return a;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
#endif /* HAVE_INLINE_ASM */
|
|
133
|
+
#endif /* AVCODEC_X86_MATHOPS_H */
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2003 Ivan Kalvachev
|
|
3
|
+
*
|
|
4
|
+
* This file is part of FFmpeg.
|
|
5
|
+
*
|
|
6
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
7
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
8
|
+
* License as published by the Free Software Foundation; either
|
|
9
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
10
|
+
*
|
|
11
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
12
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14
|
+
* Lesser General Public License for more details.
|
|
15
|
+
*
|
|
16
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
17
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
18
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
#ifndef AVCODEC_XVMC_H
|
|
22
|
+
#define AVCODEC_XVMC_H
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @file
|
|
26
|
+
* @ingroup lavc_codec_hwaccel_xvmc
|
|
27
|
+
* Public libavcodec XvMC header.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#pragma message("XvMC is no longer supported; this header is deprecated and will be removed")
|
|
31
|
+
|
|
32
|
+
#include <X11/extensions/XvMC.h>
|
|
33
|
+
|
|
34
|
+
#include "libavutil/attributes.h"
|
|
35
|
+
#include "avcodec.h"
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @defgroup lavc_codec_hwaccel_xvmc XvMC
|
|
39
|
+
* @ingroup lavc_codec_hwaccel
|
|
40
|
+
*
|
|
41
|
+
* @{
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
|
|
45
|
+
the number is 1337 speak for the letters IDCT MCo (motion compensation) */
|
|
46
|
+
|
|
47
|
+
struct attribute_deprecated xvmc_pix_fmt {
|
|
48
|
+
/** The field contains the special constant value AV_XVMC_ID.
|
|
49
|
+
It is used as a test that the application correctly uses the API,
|
|
50
|
+
and that there is no corruption caused by pixel routines.
|
|
51
|
+
- application - set during initialization
|
|
52
|
+
- libavcodec - unchanged
|
|
53
|
+
*/
|
|
54
|
+
int xvmc_id;
|
|
55
|
+
|
|
56
|
+
/** Pointer to the block array allocated by XvMCCreateBlocks().
|
|
57
|
+
The array has to be freed by XvMCDestroyBlocks().
|
|
58
|
+
Each group of 64 values represents one data block of differential
|
|
59
|
+
pixel information (in MoCo mode) or coefficients for IDCT.
|
|
60
|
+
- application - set the pointer during initialization
|
|
61
|
+
- libavcodec - fills coefficients/pixel data into the array
|
|
62
|
+
*/
|
|
63
|
+
short* data_blocks;
|
|
64
|
+
|
|
65
|
+
/** Pointer to the macroblock description array allocated by
|
|
66
|
+
XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
|
|
67
|
+
- application - set the pointer during initialization
|
|
68
|
+
- libavcodec - fills description data into the array
|
|
69
|
+
*/
|
|
70
|
+
XvMCMacroBlock* mv_blocks;
|
|
71
|
+
|
|
72
|
+
/** Number of macroblock descriptions that can be stored in the mv_blocks
|
|
73
|
+
array.
|
|
74
|
+
- application - set during initialization
|
|
75
|
+
- libavcodec - unchanged
|
|
76
|
+
*/
|
|
77
|
+
int allocated_mv_blocks;
|
|
78
|
+
|
|
79
|
+
/** Number of blocks that can be stored at once in the data_blocks array.
|
|
80
|
+
- application - set during initialization
|
|
81
|
+
- libavcodec - unchanged
|
|
82
|
+
*/
|
|
83
|
+
int allocated_data_blocks;
|
|
84
|
+
|
|
85
|
+
/** Indicate that the hardware would interpret data_blocks as IDCT
|
|
86
|
+
coefficients and perform IDCT on them.
|
|
87
|
+
- application - set during initialization
|
|
88
|
+
- libavcodec - unchanged
|
|
89
|
+
*/
|
|
90
|
+
int idct;
|
|
91
|
+
|
|
92
|
+
/** In MoCo mode it indicates that intra macroblocks are assumed to be in
|
|
93
|
+
unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
|
|
94
|
+
- application - set during initialization
|
|
95
|
+
- libavcodec - unchanged
|
|
96
|
+
*/
|
|
97
|
+
int unsigned_intra;
|
|
98
|
+
|
|
99
|
+
/** Pointer to the surface allocated by XvMCCreateSurface().
|
|
100
|
+
It has to be freed by XvMCDestroySurface() on application exit.
|
|
101
|
+
It identifies the frame and its state on the video hardware.
|
|
102
|
+
- application - set during initialization
|
|
103
|
+
- libavcodec - unchanged
|
|
104
|
+
*/
|
|
105
|
+
XvMCSurface* p_surface;
|
|
106
|
+
|
|
107
|
+
/** Set by the decoder before calling ff_draw_horiz_band(),
|
|
108
|
+
needed by the XvMCRenderSurface function. */
|
|
109
|
+
//@{
|
|
110
|
+
/** Pointer to the surface used as past reference
|
|
111
|
+
- application - unchanged
|
|
112
|
+
- libavcodec - set
|
|
113
|
+
*/
|
|
114
|
+
XvMCSurface* p_past_surface;
|
|
115
|
+
|
|
116
|
+
/** Pointer to the surface used as future reference
|
|
117
|
+
- application - unchanged
|
|
118
|
+
- libavcodec - set
|
|
119
|
+
*/
|
|
120
|
+
XvMCSurface* p_future_surface;
|
|
121
|
+
|
|
122
|
+
/** top/bottom field or frame
|
|
123
|
+
- application - unchanged
|
|
124
|
+
- libavcodec - set
|
|
125
|
+
*/
|
|
126
|
+
unsigned int picture_structure;
|
|
127
|
+
|
|
128
|
+
/** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
|
|
129
|
+
- application - unchanged
|
|
130
|
+
- libavcodec - set
|
|
131
|
+
*/
|
|
132
|
+
unsigned int flags;
|
|
133
|
+
//}@
|
|
134
|
+
|
|
135
|
+
/** Number of macroblock descriptions in the mv_blocks array
|
|
136
|
+
that have already been passed to the hardware.
|
|
137
|
+
- application - zeroes it on get_buffer().
|
|
138
|
+
A successful ff_draw_horiz_band() may increment it
|
|
139
|
+
with filled_mb_block_num or zero both.
|
|
140
|
+
- libavcodec - unchanged
|
|
141
|
+
*/
|
|
142
|
+
int start_mv_blocks_num;
|
|
143
|
+
|
|
144
|
+
/** Number of new macroblock descriptions in the mv_blocks array (after
|
|
145
|
+
start_mv_blocks_num) that are filled by libavcodec and have to be
|
|
146
|
+
passed to the hardware.
|
|
147
|
+
- application - zeroes it on get_buffer() or after successful
|
|
148
|
+
ff_draw_horiz_band().
|
|
149
|
+
- libavcodec - increment with one of each stored MB
|
|
150
|
+
*/
|
|
151
|
+
int filled_mv_blocks_num;
|
|
152
|
+
|
|
153
|
+
/** Number of the next free data block; one data block consists of
|
|
154
|
+
64 short values in the data_blocks array.
|
|
155
|
+
All blocks before this one have already been claimed by placing their
|
|
156
|
+
position into the corresponding block description structure field,
|
|
157
|
+
that are part of the mv_blocks array.
|
|
158
|
+
- application - zeroes it on get_buffer().
|
|
159
|
+
A successful ff_draw_horiz_band() may zero it together
|
|
160
|
+
with start_mb_blocks_num.
|
|
161
|
+
- libavcodec - each decoded macroblock increases it by the number
|
|
162
|
+
of coded blocks it contains.
|
|
163
|
+
*/
|
|
164
|
+
int next_free_data_block_num;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* @}
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
#endif /* AVCODEC_XVMC_H */
|
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of FFmpeg.
|
|
3
|
+
*
|
|
4
|
+
* FFmpeg is free software; you can redistribute it and/or
|
|
5
|
+
* modify it under the terms of the GNU Lesser General Public
|
|
6
|
+
* License as published by the Free Software Foundation; either
|
|
7
|
+
* version 2.1 of the License, or (at your option) any later version.
|
|
8
|
+
*
|
|
9
|
+
* FFmpeg is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
12
|
+
* Lesser General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Lesser General Public
|
|
15
|
+
* License along with FFmpeg; if not, write to the Free Software
|
|
16
|
+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#ifndef AVDEVICE_AVDEVICE_H
|
|
20
|
+
#define AVDEVICE_AVDEVICE_H
|
|
21
|
+
|
|
22
|
+
#include "version_major.h"
|
|
23
|
+
#ifndef HAVE_AV_CONFIG_H
|
|
24
|
+
/* When included as part of the ffmpeg build, only include the major version
|
|
25
|
+
* to avoid unnecessary rebuilds. When included externally, keep including
|
|
26
|
+
* the full version information. */
|
|
27
|
+
#include "version.h"
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @file
|
|
32
|
+
* @ingroup lavd
|
|
33
|
+
* Main libavdevice API header
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @defgroup lavd libavdevice
|
|
38
|
+
* Special devices muxing/demuxing library.
|
|
39
|
+
*
|
|
40
|
+
* Libavdevice is a complementary library to @ref libavf "libavformat". It
|
|
41
|
+
* provides various "special" platform-specific muxers and demuxers, e.g. for
|
|
42
|
+
* grabbing devices, audio capture and playback etc. As a consequence, the
|
|
43
|
+
* (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own
|
|
44
|
+
* I/O functions). The filename passed to avformat_open_input() often does not
|
|
45
|
+
* refer to an actually existing file, but has some special device-specific
|
|
46
|
+
* meaning - e.g. for xcbgrab it is the display name.
|
|
47
|
+
*
|
|
48
|
+
* To use libavdevice, simply call avdevice_register_all() to register all
|
|
49
|
+
* compiled muxers and demuxers. They all use standard libavformat API.
|
|
50
|
+
*
|
|
51
|
+
* @{
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
#include "libavutil/log.h"
|
|
55
|
+
#include "libavutil/opt.h"
|
|
56
|
+
#include "libavutil/dict.h"
|
|
57
|
+
#include "libavformat/avformat.h"
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Return the LIBAVDEVICE_VERSION_INT constant.
|
|
61
|
+
*/
|
|
62
|
+
unsigned avdevice_version(void);
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Return the libavdevice build-time configuration.
|
|
66
|
+
*/
|
|
67
|
+
const char *avdevice_configuration(void);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Return the libavdevice license.
|
|
71
|
+
*/
|
|
72
|
+
const char *avdevice_license(void);
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Initialize libavdevice and register all the input and output devices.
|
|
76
|
+
*/
|
|
77
|
+
void avdevice_register_all(void);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Audio input devices iterator.
|
|
81
|
+
*
|
|
82
|
+
* If d is NULL, returns the first registered input audio/video device,
|
|
83
|
+
* if d is non-NULL, returns the next registered input audio/video device after d
|
|
84
|
+
* or NULL if d is the last one.
|
|
85
|
+
*/
|
|
86
|
+
const AVInputFormat *av_input_audio_device_next(const AVInputFormat *d);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Video input devices iterator.
|
|
90
|
+
*
|
|
91
|
+
* If d is NULL, returns the first registered input audio/video device,
|
|
92
|
+
* if d is non-NULL, returns the next registered input audio/video device after d
|
|
93
|
+
* or NULL if d is the last one.
|
|
94
|
+
*/
|
|
95
|
+
const AVInputFormat *av_input_video_device_next(const AVInputFormat *d);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Audio output devices iterator.
|
|
99
|
+
*
|
|
100
|
+
* If d is NULL, returns the first registered output audio/video device,
|
|
101
|
+
* if d is non-NULL, returns the next registered output audio/video device after d
|
|
102
|
+
* or NULL if d is the last one.
|
|
103
|
+
*/
|
|
104
|
+
const AVOutputFormat *av_output_audio_device_next(const AVOutputFormat *d);
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Video output devices iterator.
|
|
108
|
+
*
|
|
109
|
+
* If d is NULL, returns the first registered output audio/video device,
|
|
110
|
+
* if d is non-NULL, returns the next registered output audio/video device after d
|
|
111
|
+
* or NULL if d is the last one.
|
|
112
|
+
*/
|
|
113
|
+
const AVOutputFormat *av_output_video_device_next(const AVOutputFormat *d);
|
|
114
|
+
|
|
115
|
+
typedef struct AVDeviceRect {
|
|
116
|
+
int x; /**< x coordinate of top left corner */
|
|
117
|
+
int y; /**< y coordinate of top left corner */
|
|
118
|
+
int width; /**< width */
|
|
119
|
+
int height; /**< height */
|
|
120
|
+
} AVDeviceRect;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Message types used by avdevice_app_to_dev_control_message().
|
|
124
|
+
*/
|
|
125
|
+
enum AVAppToDevMessageType {
|
|
126
|
+
/**
|
|
127
|
+
* Dummy message.
|
|
128
|
+
*/
|
|
129
|
+
AV_APP_TO_DEV_NONE = MKBETAG('N','O','N','E'),
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Window size change message.
|
|
133
|
+
*
|
|
134
|
+
* Message is sent to the device every time the application changes the size
|
|
135
|
+
* of the window device renders to.
|
|
136
|
+
* Message should also be sent right after window is created.
|
|
137
|
+
*
|
|
138
|
+
* data: AVDeviceRect: new window size.
|
|
139
|
+
*/
|
|
140
|
+
AV_APP_TO_DEV_WINDOW_SIZE = MKBETAG('G','E','O','M'),
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Repaint request message.
|
|
144
|
+
*
|
|
145
|
+
* Message is sent to the device when window has to be repainted.
|
|
146
|
+
*
|
|
147
|
+
* data: AVDeviceRect: area required to be repainted.
|
|
148
|
+
* NULL: whole area is required to be repainted.
|
|
149
|
+
*/
|
|
150
|
+
AV_APP_TO_DEV_WINDOW_REPAINT = MKBETAG('R','E','P','A'),
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Request pause/play.
|
|
154
|
+
*
|
|
155
|
+
* Application requests pause/unpause playback.
|
|
156
|
+
* Mostly usable with devices that have internal buffer.
|
|
157
|
+
* By default devices are not paused.
|
|
158
|
+
*
|
|
159
|
+
* data: NULL
|
|
160
|
+
*/
|
|
161
|
+
AV_APP_TO_DEV_PAUSE = MKBETAG('P', 'A', 'U', ' '),
|
|
162
|
+
AV_APP_TO_DEV_PLAY = MKBETAG('P', 'L', 'A', 'Y'),
|
|
163
|
+
AV_APP_TO_DEV_TOGGLE_PAUSE = MKBETAG('P', 'A', 'U', 'T'),
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Volume control message.
|
|
167
|
+
*
|
|
168
|
+
* Set volume level. It may be device-dependent if volume
|
|
169
|
+
* is changed per stream or system wide. Per stream volume
|
|
170
|
+
* change is expected when possible.
|
|
171
|
+
*
|
|
172
|
+
* data: double: new volume with range of 0.0 - 1.0.
|
|
173
|
+
*/
|
|
174
|
+
AV_APP_TO_DEV_SET_VOLUME = MKBETAG('S', 'V', 'O', 'L'),
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Mute control messages.
|
|
178
|
+
*
|
|
179
|
+
* Change mute state. It may be device-dependent if mute status
|
|
180
|
+
* is changed per stream or system wide. Per stream mute status
|
|
181
|
+
* change is expected when possible.
|
|
182
|
+
*
|
|
183
|
+
* data: NULL.
|
|
184
|
+
*/
|
|
185
|
+
AV_APP_TO_DEV_MUTE = MKBETAG(' ', 'M', 'U', 'T'),
|
|
186
|
+
AV_APP_TO_DEV_UNMUTE = MKBETAG('U', 'M', 'U', 'T'),
|
|
187
|
+
AV_APP_TO_DEV_TOGGLE_MUTE = MKBETAG('T', 'M', 'U', 'T'),
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Get volume/mute messages.
|
|
191
|
+
*
|
|
192
|
+
* Force the device to send AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED or
|
|
193
|
+
* AV_DEV_TO_APP_MUTE_STATE_CHANGED command respectively.
|
|
194
|
+
*
|
|
195
|
+
* data: NULL.
|
|
196
|
+
*/
|
|
197
|
+
AV_APP_TO_DEV_GET_VOLUME = MKBETAG('G', 'V', 'O', 'L'),
|
|
198
|
+
AV_APP_TO_DEV_GET_MUTE = MKBETAG('G', 'M', 'U', 'T'),
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Message types used by avdevice_dev_to_app_control_message().
|
|
203
|
+
*/
|
|
204
|
+
enum AVDevToAppMessageType {
|
|
205
|
+
/**
|
|
206
|
+
* Dummy message.
|
|
207
|
+
*/
|
|
208
|
+
AV_DEV_TO_APP_NONE = MKBETAG('N','O','N','E'),
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Create window buffer message.
|
|
212
|
+
*
|
|
213
|
+
* Device requests to create a window buffer. Exact meaning is device-
|
|
214
|
+
* and application-dependent. Message is sent before rendering first
|
|
215
|
+
* frame and all one-shot initializations should be done here.
|
|
216
|
+
* Application is allowed to ignore preferred window buffer size.
|
|
217
|
+
*
|
|
218
|
+
* @note: Application is obligated to inform about window buffer size
|
|
219
|
+
* with AV_APP_TO_DEV_WINDOW_SIZE message.
|
|
220
|
+
*
|
|
221
|
+
* data: AVDeviceRect: preferred size of the window buffer.
|
|
222
|
+
* NULL: no preferred size of the window buffer.
|
|
223
|
+
*/
|
|
224
|
+
AV_DEV_TO_APP_CREATE_WINDOW_BUFFER = MKBETAG('B','C','R','E'),
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Prepare window buffer message.
|
|
228
|
+
*
|
|
229
|
+
* Device requests to prepare a window buffer for rendering.
|
|
230
|
+
* Exact meaning is device- and application-dependent.
|
|
231
|
+
* Message is sent before rendering of each frame.
|
|
232
|
+
*
|
|
233
|
+
* data: NULL.
|
|
234
|
+
*/
|
|
235
|
+
AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER = MKBETAG('B','P','R','E'),
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Display window buffer message.
|
|
239
|
+
*
|
|
240
|
+
* Device requests to display a window buffer.
|
|
241
|
+
* Message is sent when new frame is ready to be displayed.
|
|
242
|
+
* Usually buffers need to be swapped in handler of this message.
|
|
243
|
+
*
|
|
244
|
+
* data: NULL.
|
|
245
|
+
*/
|
|
246
|
+
AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER = MKBETAG('B','D','I','S'),
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Destroy window buffer message.
|
|
250
|
+
*
|
|
251
|
+
* Device requests to destroy a window buffer.
|
|
252
|
+
* Message is sent when device is about to be destroyed and window
|
|
253
|
+
* buffer is not required anymore.
|
|
254
|
+
*
|
|
255
|
+
* data: NULL.
|
|
256
|
+
*/
|
|
257
|
+
AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER = MKBETAG('B','D','E','S'),
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Buffer fullness status messages.
|
|
261
|
+
*
|
|
262
|
+
* Device signals buffer overflow/underflow.
|
|
263
|
+
*
|
|
264
|
+
* data: NULL.
|
|
265
|
+
*/
|
|
266
|
+
AV_DEV_TO_APP_BUFFER_OVERFLOW = MKBETAG('B','O','F','L'),
|
|
267
|
+
AV_DEV_TO_APP_BUFFER_UNDERFLOW = MKBETAG('B','U','F','L'),
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Buffer readable/writable.
|
|
271
|
+
*
|
|
272
|
+
* Device informs that buffer is readable/writable.
|
|
273
|
+
* When possible, device informs how many bytes can be read/write.
|
|
274
|
+
*
|
|
275
|
+
* @warning Device may not inform when number of bytes than can be read/write changes.
|
|
276
|
+
*
|
|
277
|
+
* data: int64_t: amount of bytes available to read/write.
|
|
278
|
+
* NULL: amount of bytes available to read/write is not known.
|
|
279
|
+
*/
|
|
280
|
+
AV_DEV_TO_APP_BUFFER_READABLE = MKBETAG('B','R','D',' '),
|
|
281
|
+
AV_DEV_TO_APP_BUFFER_WRITABLE = MKBETAG('B','W','R',' '),
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Mute state change message.
|
|
285
|
+
*
|
|
286
|
+
* Device informs that mute state has changed.
|
|
287
|
+
*
|
|
288
|
+
* data: int: 0 for not muted state, non-zero for muted state.
|
|
289
|
+
*/
|
|
290
|
+
AV_DEV_TO_APP_MUTE_STATE_CHANGED = MKBETAG('C','M','U','T'),
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Volume level change message.
|
|
294
|
+
*
|
|
295
|
+
* Device informs that volume level has changed.
|
|
296
|
+
*
|
|
297
|
+
* data: double: new volume with range of 0.0 - 1.0.
|
|
298
|
+
*/
|
|
299
|
+
AV_DEV_TO_APP_VOLUME_LEVEL_CHANGED = MKBETAG('C','V','O','L'),
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Send control message from application to device.
|
|
304
|
+
*
|
|
305
|
+
* @param s device context.
|
|
306
|
+
* @param type message type.
|
|
307
|
+
* @param data message data. Exact type depends on message type.
|
|
308
|
+
* @param data_size size of message data.
|
|
309
|
+
* @return >= 0 on success, negative on error.
|
|
310
|
+
* AVERROR(ENOSYS) when device doesn't implement handler of the message.
|
|
311
|
+
*/
|
|
312
|
+
int avdevice_app_to_dev_control_message(struct AVFormatContext *s,
|
|
313
|
+
enum AVAppToDevMessageType type,
|
|
314
|
+
void *data, size_t data_size);
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Send control message from device to application.
|
|
318
|
+
*
|
|
319
|
+
* @param s device context.
|
|
320
|
+
* @param type message type.
|
|
321
|
+
* @param data message data. Can be NULL.
|
|
322
|
+
* @param data_size size of message data.
|
|
323
|
+
* @return >= 0 on success, negative on error.
|
|
324
|
+
* AVERROR(ENOSYS) when application doesn't implement handler of the message.
|
|
325
|
+
*/
|
|
326
|
+
int avdevice_dev_to_app_control_message(struct AVFormatContext *s,
|
|
327
|
+
enum AVDevToAppMessageType type,
|
|
328
|
+
void *data, size_t data_size);
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Structure describes basic parameters of the device.
|
|
332
|
+
*/
|
|
333
|
+
typedef struct AVDeviceInfo {
|
|
334
|
+
char *device_name; /**< device name, format depends on device */
|
|
335
|
+
char *device_description; /**< human friendly name */
|
|
336
|
+
enum AVMediaType *media_types; /**< array indicating what media types(s), if any, a device can provide. If null, cannot provide any */
|
|
337
|
+
int nb_media_types; /**< length of media_types array, 0 if device cannot provide any media types */
|
|
338
|
+
} AVDeviceInfo;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* List of devices.
|
|
342
|
+
*/
|
|
343
|
+
typedef struct AVDeviceInfoList {
|
|
344
|
+
AVDeviceInfo **devices; /**< list of autodetected devices */
|
|
345
|
+
int nb_devices; /**< number of autodetected devices */
|
|
346
|
+
int default_device; /**< index of default device or -1 if no default */
|
|
347
|
+
} AVDeviceInfoList;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* List devices.
|
|
351
|
+
*
|
|
352
|
+
* Returns available device names and their parameters.
|
|
353
|
+
*
|
|
354
|
+
* @note: Some devices may accept system-dependent device names that cannot be
|
|
355
|
+
* autodetected. The list returned by this function cannot be assumed to
|
|
356
|
+
* be always completed.
|
|
357
|
+
*
|
|
358
|
+
* @param s device context.
|
|
359
|
+
* @param[out] device_list list of autodetected devices.
|
|
360
|
+
* @return count of autodetected devices, negative on error.
|
|
361
|
+
*/
|
|
362
|
+
int avdevice_list_devices(struct AVFormatContext *s, AVDeviceInfoList **device_list);
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Convenient function to free result of avdevice_list_devices().
|
|
366
|
+
*
|
|
367
|
+
* @param device_list device list to be freed.
|
|
368
|
+
*/
|
|
369
|
+
void avdevice_free_list_devices(AVDeviceInfoList **device_list);
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* List devices.
|
|
373
|
+
*
|
|
374
|
+
* Returns available device names and their parameters.
|
|
375
|
+
* These are convinient wrappers for avdevice_list_devices().
|
|
376
|
+
* Device context is allocated and deallocated internally.
|
|
377
|
+
*
|
|
378
|
+
* @param device device format. May be NULL if device name is set.
|
|
379
|
+
* @param device_name device name. May be NULL if device format is set.
|
|
380
|
+
* @param device_options An AVDictionary filled with device-private options. May be NULL.
|
|
381
|
+
* The same options must be passed later to avformat_write_header() for output
|
|
382
|
+
* devices or avformat_open_input() for input devices, or at any other place
|
|
383
|
+
* that affects device-private options.
|
|
384
|
+
* @param[out] device_list list of autodetected devices
|
|
385
|
+
* @return count of autodetected devices, negative on error.
|
|
386
|
+
* @note device argument takes precedence over device_name when both are set.
|
|
387
|
+
*/
|
|
388
|
+
int avdevice_list_input_sources(const AVInputFormat *device, const char *device_name,
|
|
389
|
+
AVDictionary *device_options, AVDeviceInfoList **device_list);
|
|
390
|
+
int avdevice_list_output_sinks(const AVOutputFormat *device, const char *device_name,
|
|
391
|
+
AVDictionary *device_options, AVDeviceInfoList **device_list);
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* @}
|
|
395
|
+
*/
|
|
396
|
+
|
|
397
|
+
#endif /* AVDEVICE_AVDEVICE_H */
|