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

Commit fc74084b authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8877244 from 5e69d777 to tm-qpr1-release

Change-Id: I88307a67e954565643748093cb1aa2827c0cd1e9
parents c050ba79 5e69d777
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2197,8 +2197,11 @@ typedef enum acamera_metadata_tag {
     * flashlight brightness level via
     * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraManager.html#turnOnTorchWithStrengthLevel">CameraManager#turnOnTorchWithStrengthLevel</a>.
     * If this value is equal to 1, flashlight brightness control is not supported.
     * The value for this key will be null for devices with no flash unit.
     * This level must be set to a safe value to prevent any burn out issues.</p>
     * The value for this key will be null for devices with no flash unit.</p>
     * <p>The maximum value is guaranteed to be safe to use for an indefinite duration in
     * terms of device flashlight lifespan, but may be too bright for comfort for many
     * use cases. Use the default torch brightness value to avoid problems with an
     * over-bright flashlight.</p>
     */
    ACAMERA_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL =                 // int32
            ACAMERA_FLASH_INFO_START + 2,
+16 −7
Original line number Diff line number Diff line
@@ -529,22 +529,31 @@ media_status_t AMediaCodec_setAsyncNotifyCallback(
        AMediaCodecOnAsyncNotifyCallback callback,
        void *userdata) {

    {
        Mutex::Autolock _l(mData->mAsyncCallbackLock);

        if (mData->mAsyncNotify == NULL) {
            mData->mAsyncNotify = new AMessage(kWhatAsyncNotify, mData->mHandler);
        }
        // we set this ahead so that we can be ready
        // to receive callbacks as soon as the next call is a
        // success.
        mData->mAsyncCallback = callback;
        mData->mAsyncCallbackUserData = userdata;
    }

    // always call, codec may have been reset/re-configured since last call.
    status_t err = mData->mCodec->setCallback(mData->mAsyncNotify);
    if (err != OK) {
        {
            //The setup gone wrong. clean up the pointers.
            Mutex::Autolock _l(mData->mAsyncCallbackLock);
            mData->mAsyncCallback = {};
            mData->mAsyncCallbackUserData = nullptr;
        }
        ALOGE("setAsyncNotifyCallback: err(%d), failed to set async callback", err);
        return translate_error(err);
    }

    mData->mAsyncCallback = callback;
    mData->mAsyncCallbackUserData = userdata;

    return AMEDIA_OK;
}