C++ Build native-lib_arm64-v8a:错误:没有用于调用'的匹配函数;av#U rescale#U q#rnd';

C++ Build native-lib_arm64-v8a:错误:没有用于调用'的匹配函数;av#U rescale#U q#rnd';,c++,ffmpeg,android-ndk,android-ffmpeg,C++,Ffmpeg,Android Ndk,Android Ffmpeg,我正在尝试编译我的native-lib.cpp,但不断出现此错误。这里的问题是参数 pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX)); pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_bas

我正在尝试编译我的native-lib.cpp,但不断出现此错误。这里的问题是参数

pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
        pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
        pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
我犯的错误

> Task :app:externalNativeBuildRelease
Build native-lib_armeabi-v7a
ninja: Entering directory `\app\.cxx\cmake\release\armeabi-v7a'
[1/2] Building CXX object CMakeFiles/native-lib.dir/native-lib.cpp.o
[2/2] Linking CXX shared library \app\build\intermediates\cmake\release\obj\armeabi-v7a\libnative-lib.so
Build native-lib_arm64-v8a
ninja: Entering directory `\app\.cxx\cmake\release\arm64-v8a'
[1/2] Building CXX object CMakeFiles/native-lib.dir/native-lib.cpp.o
FAILED: CMakeFiles/native-lib.dir/native-lib.cpp.o 
\AppData\Local\Android\Sdk\ndk\21.0.6113669\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android23 --gcc-toolchain=/Local/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=/Local/Android/Sdk/ndk/21.0.6113669/toolchains/llvm/prebuilt/windows-x86_64/sysroot  -Dnative_lib_EXPORTS -I/app/src/main/libs/arm64-v8a/include -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security  -frtti -fexceptions -O2 -DNDEBUG  -fPIC -MD -MT CMakeFiles/native-lib.dir/native-lib.cpp.o -MF CMakeFiles\native-lib.dir\native-lib.cpp.o.d -o CMakeFiles/native-lib.dir/native-lib.cpp.o -c /app/src/main/cpp/native-lib.cpp
/app/src/main/cpp/native-lib.cpp:716:19: error: no matching function for call to 'av_rescale_q_rnd'
        pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (enum AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
                  ^~~~~~~~~~~~~~~~
/app/src/main/libs/arm64-v8a/include\libavutil/mathematics.h:160:9: note: candidate function not viable: no known conversion from 'AVRational *' to 'AVRational' for 2nd argument; dereference the argument with *
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
        ^
/app/src/main/cpp/native-lib.cpp:717:19: error: no matching function for call to 'av_rescale_q_rnd'
        pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base, (enum AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
                  ^~~~~~~~~~~~~~~~
/app/src/main/libs/arm64-v8a/include\libavutil/mathematics.h:160:9: note: candidate function not viable: no known conversion from 'AVRational *' to 'AVRational' for 2nd argument; dereference the argument with *
int64_t av_rescale_q_rnd(int64_t a, AVRational bq, AVRational cq,
        ^
/app/src/main/cpp/native-lib.cpp:718:24: error: no matching function for call to 'av_rescale_q'
        pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
                       ^~~~~~~~~~~~
/app/src/main/libs/arm64-v8a/include\libavutil/mathematics.h:151:9: note: candidate function not viable: no known conversion from 'AVRational *' to 'AVRational' for 2nd argument; dereference the argument with *
int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const;
        ^
3 errors generated.
ninja: build stopped: subcommand failed.

> Task :app:externalNativeBuildRelease FAILED
从上面的错误来看,我认为它只适用于arm64-v8

app\src\main\libs\arm64-v8a\include\libavutil\mathematics.h:151:9: note: candidate function not viable: no known conversion from 'AVRational *' to 'AVRational' for 2nd argument; dereference the argument with *

因为这是一个ffmpeg示例代码块,所以我没有做任何更改。只有当我尝试生成签名的apk时,Android Studio才会抛出错误,并且我可以在我的Android 6设备中无误地运行它

我尝试将
in\u-stream->time\u-base,out\u-stream->time\u-base
替换为
*in\u-stream->time\u-base,*out\u-stream->time\u-base
,这会引发其他类型的错误

app\src\main\cpp\native-lib.cpp:716:45: error: indirection requires pointer operand ('AVRational' invalid)

我不明白你怎么会犯这个错误;
AVStream
结构的
time\u base
字段已经是AVRational。这是哪个版本的ffmpeg?Íts“ffmpeg快照”。一个月前下载的那么结帐中该字段的类型是什么?
AVRational*time\u base;(来自main\libs\arm64-v8a\include\libavformat\avformat.h)
AVStream*in\u-stream、*out\u-stream;(来自native lib.cpp)
该字段是一个普通的AVRational(不是指针)。看起来你不小心把它改了。请确保您的ffmpeg结账是原始的,或者告诉我们您还更改了什么。