|
|
|
@ -860,7 +860,15 @@ static CodecBase *CreateCCodec() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//static
|
|
|
|
|
sp<CodecBase> MediaCodec::GetCodecBase(const AString &name) {
|
|
|
|
|
sp<CodecBase> MediaCodec::GetCodecBase(const AString &name, const char *owner) {
|
|
|
|
|
if (owner) {
|
|
|
|
|
if (strncmp(owner, "default", 8) == 0) {
|
|
|
|
|
return new ACodec;
|
|
|
|
|
} else if (strncmp(owner, "codec2", 7) == 0) {
|
|
|
|
|
return CreateCCodec();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (name.startsWithIgnoreCase("c2.")) {
|
|
|
|
|
return CreateCCodec();
|
|
|
|
|
} else if (name.startsWithIgnoreCase("omx.")) {
|
|
|
|
@ -884,11 +892,6 @@ status_t MediaCodec::init(const AString &name) {
|
|
|
|
|
// we need to invest in an extra looper to free the main event
|
|
|
|
|
// queue.
|
|
|
|
|
|
|
|
|
|
mCodec = GetCodecBase(name);
|
|
|
|
|
if (mCodec == NULL) {
|
|
|
|
|
return NAME_NOT_FOUND;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mCodecInfo.clear();
|
|
|
|
|
|
|
|
|
|
bool secureCodec = false;
|
|
|
|
@ -922,6 +925,11 @@ status_t MediaCodec::init(const AString &name) {
|
|
|
|
|
return NAME_NOT_FOUND;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mCodec = GetCodecBase(name, mCodecInfo->getOwnerName());
|
|
|
|
|
if (mCodec == NULL) {
|
|
|
|
|
return NAME_NOT_FOUND;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mIsVideo) {
|
|
|
|
|
// video codec needs dedicated looper
|
|
|
|
|
if (mCodecLooper == NULL) {
|
|
|
|
|