1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-11-23 03:15:21 +01:00

fix ffmpeg header file

This commit is contained in:
luvletter2333 2021-06-26 02:31:48 +08:00
parent 7814c6514f
commit 067fe3c18a
No known key found for this signature in database
GPG Key ID: BFD68B892BECC1D8
2 changed files with 55 additions and 8 deletions

View File

@ -0,0 +1,32 @@
#ifndef FFMPEG_MATHOPS_FIX_H
#define FFMPEG_MATHOPS_FIX_H
#ifndef NEG_USR32
# define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s)))
#endif
#ifndef NEG_SSR32
# define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s)))
#endif
#ifndef sign_extend
static inline av_const int sign_extend(int val, unsigned bits)
{
unsigned shift = 8 * sizeof(int) - bits;
union { unsigned u; int s; } v = { (unsigned) val << shift };
return v.s >> shift;
}
#endif
#ifndef zero_extend
static inline av_const unsigned zero_extend(unsigned val, unsigned bits)
{
return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits);
}
#endif
#ifndef SUINT
#define SUINT unsigned
#endif
#endif

View File

@ -4,11 +4,26 @@ set -e
patch -d ffmpeg -p1 < patches/ffmpeg/0001-compilation-magic.patch
cp ffmpeg/libavformat/dv.h ffmpeg/build/arm64-v8a/include/libavformat/dv.h
cp ffmpeg/libavformat/isom.h ffmpeg/build/arm64-v8a/include/libavformat/isom.h
cp ffmpeg/libavformat/dv.h ffmpeg/build/armeabi-v7a/include/libavformat/dv.h
cp ffmpeg/libavformat/isom.h ffmpeg/build/armeabi-v7a/include/libavformat/isom.h
cp ffmpeg/libavformat/dv.h ffmpeg/build/x86/include/libavformat/dv.h
cp ffmpeg/libavformat/isom.h ffmpeg/build/x86/include/libavformat/isom.h
cp ffmpeg/libavformat/dv.h ffmpeg/build/x86_64/include/libavformat/dv.h
cp ffmpeg/libavformat/isom.h ffmpeg/build/x86_64/include/libavformat/isom.h
libavformat=('dv.h' 'isom.h')
libavcodec=('bytestream.h' 'get_bits.h' 'put_bits.h' 'golomb.h' 'vlc.h')
libavutil=('intmath.h' 'reverse.h')
for arch in arm64-v8a armeabi-v7a x86 x86_64
do
for file in ${libavformat[*]}
do
cp ffmpeg/libavformat/"$file" ffmpeg/build/$arch/include/libavformat/"$file"
done
# fix DrKLo's mystery include since 7.8.0
for file in ${libavcodec[*]}
do
cp ffmpeg/libavcodec/"$file" ffmpeg/build/$arch/include/libavcodec/"$file"
done
for file in ${libavutil[*]}
do
cp ffmpeg/libavutil/"$file" ffmpeg/build/$arch/include/libavutil/"$file"
done
cp ffmpeg_mathops_fix.h ffmpeg/build/$arch/include/libavcodec/ffmpeg_mathops_fix.h
sed -i 's/mathops/ffmpeg_mathops_fix/g' ffmpeg/build/$arch/include/libavcodec/get_bits.h
done