【发布时间】:2015-08-07 06:15:06
【问题描述】:
我正在尝试使用 NDK 编译带有 libstagefright 的 ffmpeg。我在编译 libstagefright.cpp 时收到以下错误:
libavcodec/libstagefright.cpp: In function 'int Stagefright_init(AVCodecContext*)':
libavcodec/libstagefright.cpp:283:9: error: no match for 'operator!' (operand type is 'android::sp<android::MetaData>')
if (!meta) {
^
libavcodec/libstagefright.cpp:283:9: note: candidate is:
libavcodec/libstagefright.cpp:283:9: note: operator!(bool) <built-in>
libavcodec/libstagefright.cpp:283:9: note: no known conversion for argument 1 from 'android::sp<android::MetaData>' to 'bool'
make: *** [libavcodec/libstagefright.o] Error 1
libstagefright.cpp相关部分的代码为:
meta = new MetaData;
if (!meta) {
ret = AVERROR(ENOMEM);
goto fail;
}
meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_AVC);
meta->setInt32(kKeyWidth, avctx->width);
meta->setInt32(kKeyHeight, avctx->height);
meta->setData(kKeyAVCC, kTypeAVCC, avctx->extradata, avctx->extradata_size);
我正在使用NDK r10e-rc4 (64-bit) 和Ubuntu 14 64 bit
谁能指导一下为什么会发生这个错误,我做错了什么?
【问题讨论】:
标签: android c++ ffmpeg android-ndk stagefright