Nuplayer
bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) {
......
for (size_t matchIndex = 0; matchIndex < matchingCodecs.size();
++matchIndex) {
componentName = matchingCodecs.itemAt(matchIndex).mName.string();
quirks = matchingCodecs.itemAt(matchIndex).mQuirks;
pid_t tid = androidGetTid();
int prevPriority = androidGetThreadPriority(tid);
androidSetThreadPriority(tid, ANDROID_PRIORITY_FOREGROUND);
status_t err = omx->allocateNode(componentName.c_str(), observer, &node);
androidSetThreadPriority(tid, prevPriority);
if (err == OK) {//Get codecs by index in media_codecs.xml
break;
} else {
ALOGW("Allocating component '%s' failed, try next one.", componentName.c_str());
}
node = NULL;
}
......
}