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

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

Snap for 13566433 from 9b7f01b4 to 25Q3-release

Change-Id: I2401afb119ff425f41c4e4c4c6128cec86cbbaef
parents 2f43e4f8 9b7f01b4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -86,6 +86,10 @@ apex {
    manifest: "manifest.json",
    defaults: ["com.android.media-defaults"],
    prebuilts: ["current_sdkinfo"],
    licenses: [
        "frameworks_av_license",
        "opensourcerequest",
    ],
}

linker_config {
@@ -251,6 +255,10 @@ apex {
    name: "com.android.media.swcodec",
    manifest: "manifest_codec.json",
    defaults: ["com.android.media.swcodec-defaults"],
    licenses: [
        "frameworks_av_license",
        "opensourcerequest",
    ],
}

apex_key {
+7 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <stdint.h>
#include <sys/types.h>

#include <audio_utils/atomic.h>
#include <audio_utils/minifloat.h>
#include <utils/threads.h>
#include <utils/Log.h>
@@ -315,7 +316,12 @@ protected:
    const bool      mIsOut;             // true for AudioTrack, false for AudioRecord
    const bool      mClientInServer;    // true for OutputTrack, false for AudioTrack & AudioRecord
    bool            mIsShutdown;        // latch set to true when shared memory corruption detected
    size_t          mUnreleased;        // unreleased frames remaining from most recent obtainBuffer

    // mUnreleased is the number frames remaining from most recent obtainBuffer(s).
    // Generally accessed by a single thread, but for Java offload,
    // this variable may be accessed from multiple threads.  It is used to
    // bounds check the releaseBuffer call after the obtainBuffer.
    audio_utils::atomic<size_t, audio_utils::memory_order_relaxed>  mUnreleased;
};

// ----------------------------------------------------------------------------
+0 −5
Original line number Diff line number Diff line
@@ -870,11 +870,6 @@ aaudio_result_t AudioStreamInternal::processData(void *buffer, int32_t numFrames
        framesLeft -= (int32_t) framesProcessed;
        audioData += framesProcessed * getBytesPerFrame();

        if (framesLeft <= 0) {
            // No need to wait, all data has been written.
            break;
        }

        // Should we block?
        if (timeoutNanoseconds == 0) {
            break; // don't block
+4 −4
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ status_t ClientProxy::obtainBuffer(Buffer* buffer, const struct timespec *reques
            // take the maximum of the two mUnreleased (consistency check variable)
            // to avoid triggering an assertion on releaseBuffer.
            // TODO(b/419572928) improve this logic.
            mUnreleased = std::max(mUnreleased, part1);
            mUnreleased.max(part1);
            status = NO_ERROR;
            break;
        }
@@ -401,7 +401,7 @@ void ClientProxy::releaseBuffer(Buffer* buffer)
    LOG_ALWAYS_FATAL_IF(!(stepCount <= mUnreleased && mUnreleased <= mFrameCount),
            "%s: mUnreleased out of range, "
            "!(stepCount:%zu <= mUnreleased:%zu <= mFrameCount:%zu), BufferSizeInFrames:%u",
            __func__, stepCount, mUnreleased, mFrameCount, getBufferSizeInFrames());
            __func__, stepCount, mUnreleased.load(), mFrameCount, getBufferSizeInFrames());
    mUnreleased -= stepCount;
    audio_track_cblk_t* cblk = mCblk;
    // Both of these barriers are required
@@ -922,7 +922,7 @@ void ServerProxy::releaseBuffer(Buffer* buffer)
    LOG_ALWAYS_FATAL_IF(!(stepCount <= mUnreleased && mUnreleased <= mFrameCount),
            "%s: mUnreleased out of range, "
            "!(stepCount:%zu <= mUnreleased:%zu <= mFrameCount:%zu)",
            __func__, stepCount, mUnreleased, mFrameCount);
            __func__, stepCount, mUnreleased.load(), mFrameCount);
    mUnreleased -= stepCount;
    audio_track_cblk_t* cblk = mCblk;
    if (mIsOut) {
@@ -1235,7 +1235,7 @@ void StaticAudioTrackServerProxy::releaseBuffer(Buffer* buffer)
    LOG_ALWAYS_FATAL_IF(!(stepCount <= mUnreleased),
            "%s: stepCount out of range, "
            "!(stepCount:%zu <= mUnreleased:%zu)",
            __func__, stepCount, mUnreleased);
            __func__, stepCount, mUnreleased.load());
    if (stepCount == 0) {
        // prevent accidental re-use of buffer
        buffer->mRaw = NULL;
+2 −1
Original line number Diff line number Diff line
@@ -188,7 +188,8 @@ HalStream getHalStream(const Stream& stream) {
  halStream.producerUsage = static_cast<BufferUsage>(
      static_cast<int64_t>(stream.usage) |
      static_cast<int64_t>(BufferUsage::CAMERA_OUTPUT) |
      static_cast<int64_t>(BufferUsage::GPU_RENDER_TARGET));
      static_cast<int64_t>(BufferUsage::GPU_RENDER_TARGET) |
      static_cast<int64_t>(BufferUsage::CPU_WRITE_OFTEN));

  halStream.supportOffline = false;
  return halStream;
Loading