Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7473877 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

media: retain codec name for MediaCodec.getCodecInfo

Bug: 123962331
Change-Id: I4d349d673fcb62888681c96e7df325fa9e4b3b37
parent dd6125c0
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -153,8 +153,12 @@ JMediaCodec::JMediaCodec(

    if (nameIsType) {
        mCodec = MediaCodec::CreateByType(mLooper, name, encoder, &mInitStatus);
        if (mCodec == nullptr || mCodec->getName(&mNameAtCreation) != OK) {
            mNameAtCreation = "(null)";
        }
    } else {
        mCodec = MediaCodec::CreateByComponentName(mLooper, name, &mInitStatus);
        mNameAtCreation = name;
    }
    CHECK((mCodec != NULL) != (mInitStatus != OK));
}
@@ -699,9 +703,8 @@ status_t JMediaCodec::getCodecInfo(JNIEnv *env, jobject *codecInfoObject) const
        return err;
    }

    // TODO: get alias
    ScopedLocalRef<jstring> nameObject(env,
            env->NewStringUTF(codecInfo->getCodecName()));
            env->NewStringUTF(mNameAtCreation.c_str()));

    ScopedLocalRef<jstring> canonicalNameObject(env,
            env->NewStringUTF(codecInfo->getCodecName()));
+1 −0
Original line number Diff line number Diff line
@@ -155,6 +155,7 @@ private:

    sp<ALooper> mLooper;
    sp<MediaCodec> mCodec;
    AString mNameAtCreation;

    sp<AMessage> mCallbackNotification;
    sp<AMessage> mOnFrameRenderedNotification;