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

Commit eb9aca6a authored by Chong Zhang's avatar Chong Zhang
Browse files

Translate resource related errors in NdkMediaCodec

NdkMediaCodec is not reporting resource lost errors properly.
Translate the error codes to match that in MediaCodec JNI.

bug: 168307955
bug: 154733526
Change-Id: I4b3d0eecb55a31e4cd83407ff71ff16fb0557935
parent ffebb80b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@ static media_status_t translate_error(status_t err) {
        return AMEDIA_OK;
    } else if (err == -EAGAIN) {
        return (media_status_t) AMEDIACODEC_INFO_TRY_AGAIN_LATER;
    } else if (err == NO_MEMORY) {
        return AMEDIACODEC_ERROR_INSUFFICIENT_RESOURCE;
    } else if (err == DEAD_OBJECT) {
        return AMEDIACODEC_ERROR_RECLAIMED;
    }
    ALOGE("sf error code: %d", err);
    return AMEDIA_ERROR_UNKNOWN;
@@ -255,7 +259,7 @@ void CodecHandler::onMessageReceived(const sp<AMessage> &msg) {
                         break;
                     }
                     msg->findString("detail", &detail);
                     ALOGE("Decoder reported error(0x%x), actionCode(%d), detail(%s)",
                     ALOGE("Codec reported error(0x%x), actionCode(%d), detail(%s)",
                           err, actionCode, detail.c_str());

                     Mutex::Autolock _l(mCodec->mAsyncCallbackLock);