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

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

Snap for 4551672 from e1883526 to pi-release

Change-Id: Ibd856466f81e8781df28cd2a4e463a6b4f252dbc
parents ea0ba84c e1883526
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@ LIBAAUDIO {
    AAudioStreamBuilder_setSharingMode;
    AAudioStreamBuilder_setDirection;
    AAudioStreamBuilder_setBufferCapacityInFrames;
    AAudioStreamBuilder_setUsage;
    AAudioStreamBuilder_setContentType;
    AAudioStreamBuilder_setInputPreset;
    AAudioStreamBuilder_setUsage;       # introduced=28
    AAudioStreamBuilder_setContentType; # introduced=28
    AAudioStreamBuilder_setInputPreset; # introduced=28
    AAudioStreamBuilder_openStream;
    AAudioStreamBuilder_delete;
    AAudioStream_close;
@@ -45,9 +45,9 @@ LIBAAUDIO {
    AAudioStream_getFormat;
    AAudioStream_getSharingMode;
    AAudioStream_getDirection;
    AAudioStream_getUsage;
    AAudioStream_getContentType;
    AAudioStream_getInputPreset;
    AAudioStream_getUsage;       # introduced=28
    AAudioStream_getContentType; # introduced=28
    AAudioStream_getInputPreset; # introduced=28
    AAudioStream_getFramesWritten;
    AAudioStream_getFramesRead;
    AAudioStream_getTimestamp;
+8 −0
Original line number Diff line number Diff line
@@ -112,6 +112,10 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) {
    request.getConfiguration().setDirection(getDirection());
    request.getConfiguration().setSharingMode(getSharingMode());

    request.getConfiguration().setUsage(getUsage());
    request.getConfiguration().setContentType(getContentType());
    request.getConfiguration().setInputPreset(getInputPreset());

    request.getConfiguration().setBufferCapacity(builder.getBufferCapacity());

    mServiceStreamHandle = mServiceInterface.openStream(request, configurationOutput);
@@ -131,6 +135,10 @@ aaudio_result_t AudioStreamInternal::open(const AudioStreamBuilder &builder) {
    setDeviceId(configurationOutput.getDeviceId());
    setSharingMode(configurationOutput.getSharingMode());

    setUsage(configurationOutput.getUsage());
    setContentType(configurationOutput.getContentType());
    setInputPreset(configurationOutput.getInputPreset());

    // Save device format so we can do format conversion and volume scaling together.
    mDeviceFormat = configurationOutput.getFormat();

+13 −0
Original line number Diff line number Diff line
@@ -112,6 +112,8 @@ aaudio_result_t AudioStream::open(const AudioStreamBuilder& builder)
          mDeviceId, mPerformanceMode,
          (isDataCallbackSet() ? "ON" : "OFF"),
          mFramesPerDataCallback);
    ALOGI("open() usage = %d, contentType = %d, inputPreset = %d",
          mUsage, mContentType, mInputPreset);

    return AAUDIO_OK;
}
@@ -234,6 +236,17 @@ aaudio_result_t AudioStream::createThread(int64_t periodNanoseconds,
    if (err != 0) {
        return AAudioConvert_androidToAAudioResult(-errno);
    } else {
        // Name the thread with an increasing index, "AAudio_#", for debugging.
        static std::atomic<uint32_t> nextThreadIndex{1};
        char name[16]; // max length for a pthread_name
        uint32_t index = nextThreadIndex++;
        // Wrap the index so that we do not hit the 16 char limit
        // and to avoid hard-to-read large numbers.
        index = index % 100000;  // arbitrary
        snprintf(name, sizeof(name), "AAudio_%u", index);
        err = pthread_setname_np(mThread, name);
        ALOGW_IF((err != 0), "Could not set name of AAudio thread. err = %d", err);

        mHasThread = true;
        return AAUDIO_OK;
    }
+22 −0
Original line number Diff line number Diff line
@@ -420,6 +420,7 @@ protected:

    /**
     * This should not be called after the open() call.
     * TODO for multiple setters: assert(mState == AAUDIO_STREAM_STATE_UNINITIALIZED)
     */
    void setSampleRate(int32_t sampleRate) {
        mSampleRate = sampleRate;
@@ -468,6 +469,27 @@ protected:
        return mPeriodNanoseconds.load(std::memory_order_acquire);
    }

    /**
     * This should not be called after the open() call.
     */
    void setUsage(aaudio_usage_t usage) {
        mUsage = usage;
    }

    /**
     * This should not be called after the open() call.
     */
    void setContentType(aaudio_content_type_t contentType) {
        mContentType = contentType;
    }

    /**
     * This should not be called after the open() call.
     */
    void setInputPreset(aaudio_input_preset_t inputPreset) {
        mInputPreset = inputPreset;
    }

private:

    std::mutex                 mStreamLock;
+15 −0
Original line number Diff line number Diff line
@@ -139,10 +139,18 @@ cc_library_static {
    },
}

filegroup {
    name: "mediaupdateservice_aidl",
    srcs: [
        "aidl/android/media/IMediaExtractorUpdateService.aidl",
    ],
}

cc_library_shared {
    name: "libmedia",

    srcs: [
        ":mediaupdateservice_aidl",
        "IDataSource.cpp",
        "BufferingSettings.cpp",
        "mediaplayer.cpp",
@@ -179,6 +187,11 @@ cc_library_shared {
        "StringArray.cpp",
    ],

    aidl: {
        local_include_dirs: ["aidl"],
        export_aidl_headers: true,
    },

    shared_libs: [
        "liblog",
        "libcutils",
@@ -306,6 +319,7 @@ cc_library_shared {

    srcs: [
        "AudioParameter.cpp",
        "JAudioTrack.cpp",
        "MediaPlayer2Factory.cpp",
        "MediaPlayer2Manager.cpp",
        "TestPlayerStub.cpp",
@@ -314,6 +328,7 @@ cc_library_shared {
    ],

    shared_libs: [
        "libandroid_runtime",
        "libaudioclient",
        "libbinder",
        "libcutils",
Loading