Loading media/libstagefright/ACodec.cpp +17 −15 Original line number Diff line number Diff line Loading @@ -1826,6 +1826,23 @@ status_t ACodec::configureCodec( mRepeatFrameDelayUs = -1LL; } if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) { float captureRate; if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) { mCaptureFps = captureRate; } else { mCaptureFps = -1.0; } } if (!msg->findInt32( KEY_CREATE_INPUT_SURFACE_SUSPENDED, (int32_t*)&mCreateInputBuffersSuspended)) { mCreateInputBuffersSuspended = false; } } if (encoder && (mIsVideo || mIsImage)) { // only allow 32-bit value, since we pass it as U32 to OMX. if (!msg->findInt64(KEY_MAX_PTS_GAP_TO_ENCODER, &mMaxPtsGapUs)) { mMaxPtsGapUs = 0LL; Loading @@ -1842,21 +1859,6 @@ status_t ACodec::configureCodec( if (mMaxPtsGapUs < 0LL) { mMaxFps = -1; } if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) { float captureRate; if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) { mCaptureFps = captureRate; } else { mCaptureFps = -1.0; } } if (!msg->findInt32( KEY_CREATE_INPUT_SURFACE_SUSPENDED, (int32_t*)&mCreateInputBuffersSuspended)) { mCreateInputBuffersSuspended = false; } } // NOTE: we only use native window for video decoders Loading media/ndk/NdkMediaCodec.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -221,7 +221,13 @@ void CodecHandler::onMessageReceived(const sp<AMessage> &msg) { break; } AMediaFormat *aMediaFormat = AMediaFormat_fromMsg(&format); // Here format is MediaCodec's internal copy of output format. // Make a copy since the client might modify it. sp<AMessage> copy; if (format != nullptr) { copy = format->dup(); } AMediaFormat *aMediaFormat = AMediaFormat_fromMsg(©); Mutex::Autolock _l(mCodec->mAsyncCallbackLock); if (mCodec->mAsyncCallbackUserData != NULL Loading services/camera/libcameraservice/api2/HeicCompositeStream.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -1671,8 +1671,13 @@ void HeicCompositeStream::CodecCallbackHandler::onMessageReceived(const sp<AMess ALOGE("CB_OUTPUT_FORMAT_CHANGED: format is expected."); break; } parent->onHeicFormatChanged(format); // Here format is MediaCodec's internal copy of output format. // Make a copy since onHeicFormatChanged() might modify it. sp<AMessage> formatCopy; if (format != nullptr) { formatCopy = format->dup(); } parent->onHeicFormatChanged(formatCopy); break; } Loading Loading
media/libstagefright/ACodec.cpp +17 −15 Original line number Diff line number Diff line Loading @@ -1826,6 +1826,23 @@ status_t ACodec::configureCodec( mRepeatFrameDelayUs = -1LL; } if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) { float captureRate; if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) { mCaptureFps = captureRate; } else { mCaptureFps = -1.0; } } if (!msg->findInt32( KEY_CREATE_INPUT_SURFACE_SUSPENDED, (int32_t*)&mCreateInputBuffersSuspended)) { mCreateInputBuffersSuspended = false; } } if (encoder && (mIsVideo || mIsImage)) { // only allow 32-bit value, since we pass it as U32 to OMX. if (!msg->findInt64(KEY_MAX_PTS_GAP_TO_ENCODER, &mMaxPtsGapUs)) { mMaxPtsGapUs = 0LL; Loading @@ -1842,21 +1859,6 @@ status_t ACodec::configureCodec( if (mMaxPtsGapUs < 0LL) { mMaxFps = -1; } if (!msg->findDouble("time-lapse-fps", &mCaptureFps)) { float captureRate; if (msg->findAsFloat(KEY_CAPTURE_RATE, &captureRate)) { mCaptureFps = captureRate; } else { mCaptureFps = -1.0; } } if (!msg->findInt32( KEY_CREATE_INPUT_SURFACE_SUSPENDED, (int32_t*)&mCreateInputBuffersSuspended)) { mCreateInputBuffersSuspended = false; } } // NOTE: we only use native window for video decoders Loading
media/ndk/NdkMediaCodec.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -221,7 +221,13 @@ void CodecHandler::onMessageReceived(const sp<AMessage> &msg) { break; } AMediaFormat *aMediaFormat = AMediaFormat_fromMsg(&format); // Here format is MediaCodec's internal copy of output format. // Make a copy since the client might modify it. sp<AMessage> copy; if (format != nullptr) { copy = format->dup(); } AMediaFormat *aMediaFormat = AMediaFormat_fromMsg(©); Mutex::Autolock _l(mCodec->mAsyncCallbackLock); if (mCodec->mAsyncCallbackUserData != NULL Loading
services/camera/libcameraservice/api2/HeicCompositeStream.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -1671,8 +1671,13 @@ void HeicCompositeStream::CodecCallbackHandler::onMessageReceived(const sp<AMess ALOGE("CB_OUTPUT_FORMAT_CHANGED: format is expected."); break; } parent->onHeicFormatChanged(format); // Here format is MediaCodec's internal copy of output format. // Make a copy since onHeicFormatChanged() might modify it. sp<AMessage> formatCopy; if (format != nullptr) { formatCopy = format->dup(); } parent->onHeicFormatChanged(formatCopy); break; } Loading