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

Commit 02f2504f authored by Songyue Han's avatar Songyue Han Committed by Automerger Merge Worker
Browse files

Merge changes from topics "cherrypick-pixel-format-metric-r71x1vhwrt",...

Merge changes from topics "cherrypick-pixel-format-metric-r71x1vhwrt", "cherrypicker-L69100000963159156:N69100001407413784" into udc-qpr-dev am: 615b4344

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/24838455



Change-Id: I2086193650476413f8be6c53883270c4f8fed50a
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 5c10c1bd 615b4344
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -202,8 +202,10 @@ C2OMXNode::C2OMXNode(const std::shared_ptr<Codec2Client::Component> &comp)
    android_fdsan_set_error_level(ANDROID_FDSAN_ERROR_LEVEL_WARN_ALWAYS);
    mQueueThread->run("C2OMXNode", PRIORITY_AUDIO);

    Mutexed<android_dataspace>::Locked ds(mDataspace);
    *ds = HAL_DATASPACE_UNKNOWN;
    android_dataspace ds = HAL_DATASPACE_UNKNOWN;
    mDataspace.lock().set(ds);
    uint32_t pf = PIXEL_FORMAT_UNKNOWN;
    mPixelFormat.lock().set(pf);
}

status_t C2OMXNode::freeNode() {
@@ -521,8 +523,8 @@ status_t C2OMXNode::dispatchMessage(const omx_message& msg) {
    ALOGD("dataspace changed to %#x pixel format: %#x", dataSpace, pixelFormat);
    mQueueThread->setDataspace(dataSpace);

    Mutexed<android_dataspace>::Locked ds(mDataspace);
    *ds = dataSpace;
    mDataspace.lock().set(dataSpace);
    mPixelFormat.lock().set(pixelFormat);
    return OK;
}

@@ -559,6 +561,10 @@ android_dataspace C2OMXNode::getDataspace() {
    return *mDataspace.lock();
}

uint32_t C2OMXNode::getPixelFormat() {
    return *mPixelFormat.lock();
}

void C2OMXNode::setPriority(int priority) {
    mQueueThread->setPriority(priority);
}
+6 −0
Original line number Diff line number Diff line
@@ -98,6 +98,11 @@ struct C2OMXNode : public BnOMXNode {
     */
    android_dataspace getDataspace();

    /**
     * Returns dataspace information from GraphicBufferSource.
     */
    uint32_t getPixelFormat();

    /**
     * Sets priority of the queue thread.
     */
@@ -112,6 +117,7 @@ private:
    uint32_t mHeight;
    uint64_t mUsage;
    Mutexed<android_dataspace> mDataspace;
    Mutexed<uint32_t> mPixelFormat;

    // WORKAROUND: timestamp adjustment

+6 −0
Original line number Diff line number Diff line
@@ -431,6 +431,10 @@ public:
        return mNode->getDataspace();
    }

    uint32_t getPixelFormat() override {
        return mNode->getPixelFormat();
    }

private:
    sp<HGraphicBufferSource> mSource;
    sp<C2OMXNode> mNode;
@@ -2510,6 +2514,8 @@ void CCodec::onMessageReceived(const sp<AMessage> &msg) {
                uint32_t pf = PIXEL_FORMAT_UNKNOWN;
                if (!config->mInputSurface) {
                    pf = mChannel->getBuffersPixelFormat(config->mDomain & Config::IS_ENCODER);
                } else {
                    pf = config->mInputSurface->getPixelFormat();
                }
                if (pf != PIXEL_FORMAT_UNKNOWN) {
                    mMetrics->setInt64(kCodecPixelFormat, pf);
+8 −1
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@ namespace android {
class InputSurfaceWrapper {
public:
    InputSurfaceWrapper()
        : mDataSpace(HAL_DATASPACE_UNKNOWN) {
        : mDataSpace(HAL_DATASPACE_UNKNOWN),
          mPixelFormat(PIXEL_FORMAT_UNKNOWN) {
    }

    virtual ~InputSurfaceWrapper() = default;
@@ -112,8 +113,14 @@ public:
     */
    virtual android_dataspace getDataspace() { return mDataSpace; }

    /**
     * Returns pixel format information from GraphicBufferSource.
     */
    virtual uint32_t getPixelFormat() { return mPixelFormat; }

protected:
    android_dataspace mDataSpace;
    uint32_t mPixelFormat;
};

}  // namespace android