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

Commit f1a5af0e authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6465939 from 40fae84d to mainline-release

Change-Id: Id5e9ca3555e34e133550846a66404602dde9ac99
parents d697b3f2 40fae84d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -549,7 +549,7 @@ bool C2SoftAvcDec::setDecodeArgs(ivd_video_decode_ip_t *ps_decode_ip,
    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[1] = chromaSize;
    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[2] = chromaSize;
    if (outBuffer) {
        if (outBuffer->width() < displayStride || outBuffer->height() < displayHeight) {
        if (outBuffer->height() < displayHeight) {
            ALOGE("Output buffer too small: provided (%dx%d) required (%ux%u)",
                  outBuffer->width(), outBuffer->height(), displayStride, displayHeight);
            return false;
+1 −1
Original line number Diff line number Diff line
@@ -544,7 +544,7 @@ bool C2SoftHevcDec::setDecodeArgs(ivd_video_decode_ip_t *ps_decode_ip,
    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[1] = chromaSize;
    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[2] = chromaSize;
    if (outBuffer) {
        if (outBuffer->width() < displayStride || outBuffer->height() < displayHeight) {
        if (outBuffer->height() < displayHeight) {
            ALOGE("Output buffer too small: provided (%dx%d) required (%ux%u)",
                  outBuffer->width(), outBuffer->height(), displayStride, displayHeight);
            return false;
+1 −1
Original line number Diff line number Diff line
@@ -618,7 +618,7 @@ bool C2SoftMpeg2Dec::setDecodeArgs(ivd_video_decode_ip_t *ps_decode_ip,
    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[1] = chromaSize;
    ps_decode_ip->s_out_buffer.u4_min_out_buf_size[2] = chromaSize;
    if (outBuffer) {
        if (outBuffer->width() < displayStride || outBuffer->height() < displayHeight) {
        if (outBuffer->height() < displayHeight) {
            ALOGE("Output buffer too small: provided (%dx%d) required (%ux%u)",
                  outBuffer->width(), outBuffer->height(), displayStride, displayHeight);
            return false;
+18 −2
Original line number Diff line number Diff line
@@ -354,6 +354,12 @@ aaudio_result_t AudioStreamInternal::requestStart()
    drainTimestampsFromService();

    aaudio_result_t result = mServiceInterface.startStream(mServiceStreamHandle);
    if (result == AAUDIO_ERROR_INVALID_HANDLE) {
        ALOGD("%s() INVALID_HANDLE, stream was probably stolen", __func__);
        // Stealing was added in R. Coerce result to improve backward compatibility.
        result = AAUDIO_ERROR_DISCONNECTED;
        setState(AAUDIO_STREAM_STATE_DISCONNECTED);
    }

    startTime = AudioClock::getNanoseconds();
    mClockModel.start(startTime);
@@ -397,7 +403,12 @@ aaudio_result_t AudioStreamInternal::stopCallback()
    if (isDataCallbackSet()
            && (isActive() || getState() == AAUDIO_STREAM_STATE_DISCONNECTED)) {
        mCallbackEnabled.store(false);
        return joinThread(NULL); // may temporarily unlock mStreamLock
        aaudio_result_t result = joinThread(NULL); // may temporarily unlock mStreamLock
        if (result == AAUDIO_ERROR_INVALID_HANDLE) {
            ALOGD("%s() INVALID_HANDLE, stream was probably stolen", __func__);
            result = AAUDIO_OK;
        }
        return result;
    } else {
        return AAUDIO_OK;
    }
@@ -427,7 +438,12 @@ aaudio_result_t AudioStreamInternal::requestStop() {
    setState(AAUDIO_STREAM_STATE_STOPPING);
    mAtomicInternalTimestamp.clear();

    return mServiceInterface.stopStream(mServiceStreamHandle);
    result = mServiceInterface.stopStream(mServiceStreamHandle);
    if (result == AAUDIO_ERROR_INVALID_HANDLE) {
        ALOGD("%s() INVALID_HANDLE, stream was probably stolen", __func__);
        result = AAUDIO_OK;
    }
    return result;
}

aaudio_result_t AudioStreamInternal::registerThread() {
+12 −0
Original line number Diff line number Diff line
@@ -226,3 +226,15 @@ cc_test {
        "libutils",
    ],
}

cc_test {
    name: "test_steal_exclusive",
    defaults: ["libaaudio_tests_defaults"],
    srcs: ["test_steal_exclusive.cpp"],
    shared_libs: [
        "libaaudio",
        "libbinder",
        "libcutils",
        "libutils",
    ],
}
Loading