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

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

Snap for 4710485 from 79890542 to pi-release

Change-Id: Ife1b502ac4d9e5d788337644a54e3a4b18815c8b
parents 38baa36a 79890542
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include <inttypes.h>

#include <algorithm>
#include <vector>
#include <math.h>

@@ -61,8 +62,8 @@ status_t OpcodeListBuilder::addGainMapsForMetadata(uint32_t lsmWidth,
                                                   const float* lensShadingMap) {
    uint32_t activeAreaWidth = activeAreaRight - activeAreaLeft;
    uint32_t activeAreaHeight = activeAreaBottom - activeAreaTop;
    double spacingV = 1.0 / lsmHeight;
    double spacingH = 1.0 / lsmWidth;
    double spacingV = 1.0 / std::max(1u, lsmHeight - 1);
    double spacingH = 1.0 / std::max(1u, lsmWidth - 1);

    std::vector<float> redMapVector(lsmWidth * lsmHeight);
    float *redMap = redMapVector.data();
+10 −0
Original line number Diff line number Diff line
@@ -3,10 +3,12 @@ cc_library_headers {
    vendor_available: true,
    export_include_dirs: ["include"],
    header_libs:[
        "libgui_headers",
        "libstagefright_headers",
        "media_plugin_headers",
    ],
    export_header_lib_headers: [
        "libgui_headers",
        "libstagefright_headers",
        "media_plugin_headers",
    ],
@@ -192,6 +194,14 @@ cc_library {
        export_aidl_headers: true,
    },

    header_libs: [
        "libstagefright_headers",
    ],

    export_header_lib_headers: [
        "libstagefright_headers",
    ],

    shared_libs: [
        "liblog",
        "libcutils",
+66 −22
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <vector>
#include <list>

#include <cinttypes>
#include <unistd.h>

#include <hidl/MQDescriptor.h>
@@ -34,6 +35,8 @@
#include <media/OMXFenceParcelable.h>
#include <media/OMXBuffer.h>
#include <media/hardware/VideoAPI.h>
#include <media/stagefright/MediaErrors.h>
#include <gui/IGraphicBufferProducer.h>

#include <android/hardware/media/omx/1.0/types.h>
#include <android/hardware/media/omx/1.0/IOmx.h>
@@ -196,26 +199,6 @@ inline ::android::binder::Status toBinderStatus(
            t.isOk() ? static_cast<status_t>(static_cast<Status>(t)) : UNKNOWN_ERROR);
}

/**
 * \brief Convert `Return<Status>` to `status_t`. This is for legacy binder
 * calls.
 *
 * \param[in] t The source `Return<Status>`.
 * \return The corresponding `status_t`.
 *
 * This function first check if \p t has a transport error. If it does, then the
 * return value is the transport error code. Otherwise, the return value is
 * converted from `Status` contained inside \p t.
 *
 * Note:
 * - This `Status` is omx-specific. It is defined in `types.hal`.
 * - The name of this function is not `convert`.
 */
// convert: Status -> status_t
inline status_t toStatusT(Return<Status> const& t) {
    return t.isOk() ? static_cast<status_t>(static_cast<Status>(t)) : UNKNOWN_ERROR;
}

/**
 * \brief Convert `Return<void>` to `status_t`. This is for legacy binder calls.
 *
@@ -235,7 +218,47 @@ inline status_t toStatusT(Return<void> const& t) {
 */
// convert: Status -> status_t
inline status_t toStatusT(Status const& t) {
    switch (t) {
    case Status::NO_ERROR:
    case Status::NAME_NOT_FOUND:
    case Status::WOULD_BLOCK:
    case Status::NO_MEMORY:
    case Status::ALREADY_EXISTS:
    case Status::NO_INIT:
    case Status::BAD_VALUE:
    case Status::DEAD_OBJECT:
    case Status::INVALID_OPERATION:
    case Status::TIMED_OUT:
    case Status::ERROR_UNSUPPORTED:
    case Status::UNKNOWN_ERROR:
    case Status::RELEASE_ALL_BUFFERS:
        return static_cast<status_t>(t);
    case Status::BUFFER_NEEDS_REALLOCATION:
        return NOT_ENOUGH_DATA;
    default:
        ALOGW("Unrecognized status value: %" PRId32, static_cast<int32_t>(t));
        return static_cast<status_t>(t);
    }
}

/**
 * \brief Convert `Return<Status>` to `status_t`. This is for legacy binder
 * calls.
 *
 * \param[in] t The source `Return<Status>`.
 * \return The corresponding `status_t`.
 *
 * This function first check if \p t has a transport error. If it does, then the
 * return value is the transport error code. Otherwise, the return value is
 * converted from `Status` contained inside \p t.
 *
 * Note:
 * - This `Status` is omx-specific. It is defined in `types.hal`.
 * - The name of this function is not `convert`.
 */
// convert: Status -> status_t
inline status_t toStatusT(Return<Status> const& t) {
    return t.isOk() ? toStatusT(static_cast<Status>(t)) : UNKNOWN_ERROR;
}

/**
@@ -246,7 +269,28 @@ inline status_t toStatusT(Status const& t) {
 */
// convert: status_t -> Status
inline Status toStatus(status_t l) {
    switch (l) {
    case NO_ERROR:
    case NAME_NOT_FOUND:
    case WOULD_BLOCK:
    case NO_MEMORY:
    case ALREADY_EXISTS:
    case NO_INIT:
    case BAD_VALUE:
    case DEAD_OBJECT:
    case INVALID_OPERATION:
    case TIMED_OUT:
    case ERROR_UNSUPPORTED:
    case UNKNOWN_ERROR:
    case IGraphicBufferProducer::RELEASE_ALL_BUFFERS:
    case IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION:
        return static_cast<Status>(l);
    case NOT_ENOUGH_DATA:
        return Status::BUFFER_NEEDS_REALLOCATION;
    default:
        ALOGW("Unrecognized status value: %" PRId32, static_cast<int32_t>(l));
        return static_cast<Status>(l);
    }
}

/**
+56 −13
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <vector>
#include <list>

#include <cinttypes>
#include <unistd.h>

#include <hidl/MQDescriptor.h>
@@ -35,6 +36,7 @@
#include <media/OMXFenceParcelable.h>
#include <media/OMXBuffer.h>
#include <media/hardware/VideoAPI.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/bqhelper/Conversion.h>

#include <android/hidl/memory/1.0/IMemory.h>
@@ -140,6 +142,37 @@ using ::android::conversion::toStatusT;
 * `convertTo()` do.
 */

/**
 * \brief Convert `Status` to `status_t`. This is for legacy binder calls.
 *
 * \param[in] t The source `Status`.
 * \return the corresponding `status_t`.
 */
// convert: Status -> status_t
inline status_t toStatusT(Status const& t) {
    switch (t) {
    case Status::NO_ERROR:
    case Status::NAME_NOT_FOUND:
    case Status::WOULD_BLOCK:
    case Status::NO_MEMORY:
    case Status::ALREADY_EXISTS:
    case Status::NO_INIT:
    case Status::BAD_VALUE:
    case Status::DEAD_OBJECT:
    case Status::INVALID_OPERATION:
    case Status::TIMED_OUT:
    case Status::ERROR_UNSUPPORTED:
    case Status::UNKNOWN_ERROR:
    case Status::RELEASE_ALL_BUFFERS:
        return static_cast<status_t>(t);
    case Status::BUFFER_NEEDS_REALLOCATION:
        return NOT_ENOUGH_DATA;
    default:
        ALOGW("Unrecognized status value: %" PRId32, static_cast<int32_t>(t));
        return static_cast<status_t>(t);
    }
}

/**
 * \brief Convert `Return<Status>` to `status_t`. This is for legacy binder
 * calls.
@@ -157,18 +190,7 @@ using ::android::conversion::toStatusT;
 */
// convert: Status -> status_t
inline status_t toStatusT(Return<Status> const& t) {
    return t.isOk() ? static_cast<status_t>(static_cast<Status>(t)) : UNKNOWN_ERROR;
}

/**
 * \brief Convert `Status` to `status_t`. This is for legacy binder calls.
 *
 * \param[in] t The source `Status`.
 * \return the corresponding `status_t`.
 */
// convert: Status -> status_t
inline status_t toStatusT(Status const& t) {
    return static_cast<status_t>(t);
    return t.isOk() ? toStatusT(static_cast<Status>(t)) : UNKNOWN_ERROR;
}

/**
@@ -179,7 +201,28 @@ inline status_t toStatusT(Status const& t) {
 */
// convert: status_t -> Status
inline Status toStatus(status_t l) {
    switch (l) {
    case NO_ERROR:
    case NAME_NOT_FOUND:
    case WOULD_BLOCK:
    case NO_MEMORY:
    case ALREADY_EXISTS:
    case NO_INIT:
    case BAD_VALUE:
    case DEAD_OBJECT:
    case INVALID_OPERATION:
    case TIMED_OUT:
    case ERROR_UNSUPPORTED:
    case UNKNOWN_ERROR:
    case IGraphicBufferProducer::RELEASE_ALL_BUFFERS:
    case IGraphicBufferProducer::BUFFER_NEEDS_REALLOCATION:
        return static_cast<Status>(l);
    case NOT_ENOUGH_DATA:
        return Status::BUFFER_NEEDS_REALLOCATION;
    default:
        ALOGW("Unrecognized status value: %" PRId32, static_cast<int32_t>(l));
        return static_cast<Status>(l);
    }
}

/**
+2 −2
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,
        break;

    case STRATEGY_SONIFICATION_RESPECTFUL:
        if (isInCall()) {
        if (isInCall() || outputs.isStreamActiveLocally(AUDIO_STREAM_VOICE_CALL)) {
            device = getDeviceForStrategyInt(
                    STRATEGY_SONIFICATION, availableOutputDevices, availableInputDevices, outputs,
                    outputDeviceTypesToIgnore);
@@ -409,7 +409,7 @@ audio_devices_t Engine::getDeviceForStrategyInt(routing_strategy strategy,

        // If incall, just select the STRATEGY_PHONE device: The rest of the behavior is handled by
        // handleIncallSonification().
        if (isInCall()) {
        if (isInCall() || outputs.isStreamActiveLocally(AUDIO_STREAM_VOICE_CALL)) {
            device = getDeviceForStrategyInt(
                    STRATEGY_PHONE, availableOutputDevices, availableInputDevices, outputs,
                    outputDeviceTypesToIgnore);
Loading