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

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

Snap for 13061484 from 9fa7607b to 25Q2-release

Change-Id: I1a33cee8ef0f8ebcfc92447472c7b8ca1e6e6fd4
parents f78bafc0 9fa7607b
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -1243,19 +1243,15 @@ status_t C2SoftApvDec::outputBuffer(const std::shared_ptr<C2BlockPool>& pool,
    getHDR10PlusInfoData(&hdrInfo, work);

    uint32_t format = HAL_PIXEL_FORMAT_YV12;
    std::shared_ptr<C2StreamColorAspectsInfo::output> codedColorAspects;
    if (OAPV_CS_GET_BIT_DEPTH(imgbOutput->cs) == 10 &&
        mPixelFormatInfo->value != HAL_PIXEL_FORMAT_YCBCR_420_888) {
        IntfImpl::Lock lock = mIntf->lock();
        codedColorAspects = mIntf->getColorAspects_l();

        bool allowRGBA1010102 = false;
        if (codedColorAspects->primaries == C2Color::PRIMARIES_BT2020 &&
            codedColorAspects->matrix == C2Color::MATRIX_BT2020 &&
            codedColorAspects->transfer == C2Color::TRANSFER_ST2084) {
            allowRGBA1010102 = true;
    if (mPixelFormatInfo->value != HAL_PIXEL_FORMAT_YCBCR_420_888) {
        if (isHalPixelFormatSupported((AHardwareBuffer_Format)AHARDWAREBUFFER_FORMAT_YCbCr_P210)) {
            format = AHARDWAREBUFFER_FORMAT_YCbCr_P210;
        } else if (isHalPixelFormatSupported(
                        (AHardwareBuffer_Format)HAL_PIXEL_FORMAT_YCBCR_P010)) {
            format = HAL_PIXEL_FORMAT_YCBCR_P010;
        } else {
            format = HAL_PIXEL_FORMAT_YV12;
        }
        format = getHalPixelFormatForBitDepth10(allowRGBA1010102);
    }

    if (mHalPixelFormat != format) {
+7 −0
Original line number Diff line number Diff line
@@ -424,6 +424,13 @@ public:
        printf("          2 = PCM_FLOAT\n");
        printf("          3 = PCM_I24_PACKED\n");
        printf("          4 = PCM_I32\n");
        printf("          6 = MP3\n");
        printf("          7 = AAC_LC\n");
        printf("          8 = AAC_HE_V1\n");
        printf("          9 = AAC_HE_V2\n");
        printf("          10 = AAC_ELD\n");
        printf("          12 = AAC_XHE\n");
        printf("          13 = OPUS\n");
        printf("      -i{inputPreset} eg. 5 for AAUDIO_INPUT_PRESET_CAMCORDER\n");
        printf("      -m{0|1|2|3} set MMAP policy\n");
        printf("          0 = _UNSPECIFIED, use aaudio.mmap_policy system property, default\n");
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ static float s_burnCPU(int32_t workload) {
class AAudioSimplePlayer {
public:
    AAudioSimplePlayer() {}
    ~AAudioSimplePlayer() {
    virtual ~AAudioSimplePlayer() {
        close();
    };

+19 −13
Original line number Diff line number Diff line
@@ -105,27 +105,33 @@ size_t AudioStreamLegacy::onMoreData(const android::AudioTrack::Buffer& buffer)
        // If the caller specified an exact size then use a block size adapter.
        if (mBlockAdapter != nullptr) {
            int32_t byteCount = buffer.getFrameCount() * getBytesPerDeviceFrame();
            callbackResult = mBlockAdapter->processVariableBlock(
            std::tie(callbackResult, written) = mBlockAdapter->processVariableBlock(
                    buffer.data(), byteCount);
        } else {
            // Call using the AAudio callback interface.
            callbackResult = callDataCallbackFrames(buffer.data(),
                                                    buffer.getFrameCount());
            written = callbackResult == AAUDIO_CALLBACK_RESULT_CONTINUE ?
                    buffer.getFrameCount() * getBytesPerDeviceFrame() : 0;
        }
        if (callbackResult == AAUDIO_CALLBACK_RESULT_CONTINUE) {
            written = buffer.getFrameCount() * getBytesPerDeviceFrame();
        } else {

        if (callbackResult != AAUDIO_CALLBACK_RESULT_CONTINUE) {
            if (callbackResult == AAUDIO_CALLBACK_RESULT_STOP) {
                ALOGD("%s() callback returned AAUDIO_CALLBACK_RESULT_STOP", __func__);
            } else {
                ALOGW("%s() callback returned invalid result = %d",
                      __func__, callbackResult);
            }
            written = 0;
            if (callbackResult != AAUDIO_CALLBACK_RESULT_STOP || shouldStopStream()) {
                // If the callback result is STOP, stop the stream if it should be stopped.
                // Currently, the framework will not call stop if the client is doing offload
                // playback and waiting for stream end. The client will already be STOPPING
                // state when waiting for stream end.
                systemStopInternal();
                // Disable the callback just in case the system keeps trying to call us.
                mCallbackEnabled.store(false);
            }
        }

        if (processCommands() != AAUDIO_OK) {
            forceDisconnect();
@@ -170,23 +176,23 @@ size_t AudioStreamLegacy::onMoreData(const android::AudioRecord::Buffer& buffer)
        // If the caller specified an exact size then use a block size adapter.
        if (mBlockAdapter != nullptr) {
            int32_t byteCount = buffer.getFrameCount() * getBytesPerDeviceFrame();
            callbackResult = mBlockAdapter->processVariableBlock(
            std::tie(callbackResult, written) = mBlockAdapter->processVariableBlock(
                    buffer.data(), byteCount);
        } else {
            // Call using the AAudio callback interface.
            callbackResult = callDataCallbackFrames(buffer.data(),
                                                    buffer.getFrameCount());
            written = callbackResult == AAUDIO_CALLBACK_RESULT_CONTINUE ?
                    buffer.getFrameCount() * getBytesPerDeviceFrame() : 0;
        }
        if (callbackResult == AAUDIO_CALLBACK_RESULT_CONTINUE) {
            written = buffer.getFrameCount() * getBytesPerDeviceFrame();
        } else {
        if (callbackResult != AAUDIO_CALLBACK_RESULT_CONTINUE) {
            if (callbackResult == AAUDIO_CALLBACK_RESULT_STOP) {
                ALOGD("%s() callback returned AAUDIO_CALLBACK_RESULT_STOP", __func__);
            } else {
                ALOGW("%s() callback returned invalid result = %d",
                      __func__, callbackResult);
            }
            written = 0;
            // Always stop the recording case if callback result is not CONTINUE.
            systemStopInternal();
            // Disable the callback just in case the system keeps trying to call us.
            mCallbackEnabled.store(false);
+2 −0
Original line number Diff line number Diff line
@@ -126,6 +126,8 @@ protected:
     */
    virtual int32_t getBufferCapacityFromDevice() const = 0;

    virtual bool shouldStopStream() const { return true; }

    // This is used for exact matching by MediaMetrics. So do not change it.
    // MediaMetricsConstants.h: AMEDIAMETRICS_PROP_CALLERNAME_VALUE_AAUDIO
    static constexpr char     kCallerName[] = "aaudio";
Loading