基本找到原因
在OMXCodec::Create中findMatchingCodecs
list = MediaCodecList::getInstance();
parseXMLFile解析/etc/media_codecs.xml
得到OMX.rk.video_decoder.avc和RkOn2Decoder
循环匹配mine
list->findCodecByType(mime, createEncoder, index);}
将匹配到的解码组件添加到列表中
if (((flags & kSoftwareCodecsOnly) && IsSoftwareCodec(componentName)) ||
((flags & kHardwareCodecsOnly) && !IsSoftwareCodec(componentName)) ||
(!(flags & (kSoftwareCodecsOnly | kHardwareCodecsOnly)))) {
ssize_t index = matchingCodecs->add();
CodecNameAndQuirks *entry = &matchingCodecs->editItemAt(index);
entry->mName = String8(componentName);
entry->mQuirks = getComponentQuirks(list, matchIndex);
}
在setNativeWindow_l中
if(!pfrmanager->mPlayerExtCfg.use_iommu){
err = initVideoDecoder(OMXCodec::kSoftwareCodecsOnly);
}else{
err = initVideoDecoder(OMXCodec::kHardwareCodecsOnly);
}
注意这里的flag是和传入的flag相与的结果,当io_mmu设置为1时,这里的flag为kHardwareCodecsOnly,为0时flag为kSoftwareCodecsOnly
事实证明
当社会io_mmu为1时此时匹配到的解码组件应该是OMX.rk.video_decoder.avc,io_mmu为0时匹配到的是RkOn2Decoder,这也解释了为什么设置io_mmu为1时可以解码隔行视频是因为AWESOMPLAYER调用了RkOn2Decoder解码和以及在FrameQueueManager里的IEP来解交错!
基本找到原因
在OMXCodec::Create中findMatchingCodecs
list = MediaCodecList::getInstance();
parseXMLFile解析/etc/media_codecs.xml
得到OMX.rk.video_decoder.avc和RkOn2Decoder
循环匹配mine
list->findCodecByType(mime, createEncoder, index);}
将匹配到的解码组件添加到列表中
if (((flags & kSoftwareCodecsOnly) && IsSoftwareCodec(componentName)) ||
((flags & kHardwareCodecsOnly) && !IsSoftwareCodec(componentName)) ||
(!(flags & (kSoftwareCodecsOnly | kHardwareCodecsOnly)))) {
ssize_t index = matchingCodecs->add();
CodecNameAndQuirks *entry = &matchingCodecs->editItemAt(index);
entry->mName = String8(componentName);
entry->mQuirks = getComponentQuirks(list, matchIndex);
}
在setNativeWindow_l中
if(!pfrmanager->mPlayerExtCfg.use_iommu){
err = initVideoDecoder(OMXCodec::kSoftwareCodecsOnly);
}else{
err = initVideoDecoder(OMXCodec::kHardwareCodecsOnly);
}
注意这里的flag是和传入的flag相与的结果,当io_mmu设置为1时,这里的flag为kHardwareCodecsOnly,为0时flag为kSoftwareCodecsOnly
事实证明
当社会io_mmu为1时此时匹配到的解码组件应该是OMX.rk.video_decoder.avc,io_mmu为0时匹配到的是RkOn2Decoder,这也解释了为什么设置io_mmu为1时可以解码隔行视频是因为AWESOMPLAYER调用了RkOn2Decoder解码和以及在FrameQueueManager里的IEP来解交错!
举报