当前位置:网站首页>codec2 BlockPool:不可读库
codec2 BlockPool:不可读库
2022-07-31 07:09:00 【Technical Notes from HUI】
使用CreateCodec2BlockPool创建codec2的block pool会报错
下面这段代码在CCodecBufferChannel中可以找到:
std::shared_ptr<C2AllocatorStore> store = GetCodec2PlatformAllocatorStore();
int poolMask = GetCodec2PoolMask();
C2PlatformAllocatorStore::id_t preferredLinearId = GetPreferredLinearAllocatorId(poolMask);
std::shared_ptr<C2BlockPool> pool;
if ((poolMask >> preferredLinearId) & 1) {
err = CreateCodec2BlockPool(preferredLinearId, nullptr, &pool);
} else {
err = C2_NOT_FOUND;
}
直接copyCome and use it in your own program,会报错LOG:
05-16 06:03:01.600 +0000 14826 14826 F DEBUG : backtrace:
05-16 06:03:01.600 +0000 14826 14826 F DEBUG : NOTE: Function names and BuildId information is missing for some frames due
05-16 06:03:01.600 +0000 14826 14826 F DEBUG : NOTE: to unreadable libraries. For unwinds of apps, only shared libraries
05-16 06:03:01.600 +0000 14826 14826 F DEBUG : NOTE: found under the lib/ directory are readable.
05-16 06:03:01.600 +0000 14826 14826 F DEBUG : #00 pc 000000000006d0b8 /system/lib64/libcodec2_vndk.so (android::(anonymous namespace)::_C2BlockPoolCache::_createBlockPool(unsigned int, std::__1::shared_ptr<C2Component const>, unsigned long, std::__1::shared_ptr<C2BlockPool>*)+828) (BuildId: cbfb54bd2fbd0f7588c8bbd79c9a8288)
05-16 06:03:01.600 +0000 14826 14826 F DEBUG : #01 pc 000000000006ed34 /system/lib64/libcodec2_vndk.so (android::CreateCodec2BlockPool(unsigned int, std::__1::shared_ptr<C2Component const>, std::__1::shared_ptr<C2BlockPool>*) (.cfi)+212) (BuildId: cbfb54bd2fbd0f7588c8bbd79c9a8288)
The reason was not found in the end.
效仿codec2play中的用法也报错:
这段代码在std::make_shared<C2PooledBlockPool>
的时候也是报错,和前面的log是一样的.
std::shared_ptr<C2AllocatorStore> store = GetCodec2PlatformAllocatorStore();
if (!store) {
GST_ERROR("Get codec2 allocator store failed.\n");
}
store->fetchAllocator(C2AllocatorStore::DEFAULT_LINEAR, &allocator);
if (!allocator) {
GST_ERROR("fetch allocator failed.\n");
}
linearPoolId = allocator->getId();
linearPool = std::make_shared<C2PooledBlockPool>(allocator, linearPoolId);
if (!linearPool) {
GST_DEBUG("create linear pool failed.\n");
}
最后试了下,成功的用法:
直接使用GetCodec2BlockPool
获取block pool
,都不用通过AllocatorStore
:
c2_status_t err = C2_NO_INIT;
C2BlockPool::local_id_t inputPoolId = C2BlockPool::BASIC_LINEAR;
err = GetCodec2BlockPool(inputPoolId, nullptr, &linearPool);
边栏推荐
猜你喜欢
随机推荐
高并发与多线程之间的难点对比(容易混淆)
OSI七层模型
Oracle入门 06 - Windows 服务器安装配置
小实战项目之——吃货联盟订餐系统
Gradle剔除依赖演示
编辑时过滤当前节点及根据限制的层数过滤数据
全网首发!ADK To Win11PE(1)中文+包
SSH远程管理
TypeScript编译(tsconfig.json)
emby,jellyfin,kodi系列
LVM和磁盘配额
服务器和客户端信息的获取
浅析伪类和伪元素
Dart入门
DirectExchange交换机简单入门demo
js原型详解
第十六章:构建n(5,7)阶素数幻方
@ConfigurationProperties和@EnableConfigurationProperties
MySql的安装配置超详细教程与简单的建库建表方法
svn冲突产生原因