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

Commit c0424d71 authored by Ram Mohan M's avatar Ram Mohan M Committed by android-build-merger
Browse files

Merge "Add support for preset ANW buffer mode" into oc-mr1-dev

am: 5f03369e

Change-Id: I05f800f7c941b20e99557c33272c05eda20e6b7f
parents 089b8813 5f03369e
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -316,6 +316,25 @@ void allocateBuffer(sp<IOmxNode> omxNode, BufferInfo* buffer, OMX_U32 portIndex,
                buffer->id = id;
            });
        ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    } else if (portMode == PortMode::PRESET_ANW_BUFFER) {
        OMX_PARAM_PORTDEFINITIONTYPE portDef;
        status = getPortParam(omxNode, OMX_IndexParamPortDefinition, portIndex,
                              &portDef);
        int32_t nStride;
        buffer->owner = client;
        buffer->omxBuffer.type = CodecBuffer::Type::ANW_BUFFER;
        allocateGraphicBuffers(omxNode, portIndex, buffer,
                               portDef.format.video.nFrameWidth,
                               portDef.format.video.nFrameHeight, &nStride,
                               portDef.format.video.eColorFormat);
        omxNode->useBuffer(
            portIndex, buffer->omxBuffer,
            [&status, &buffer](android::hardware::media::omx::V1_0::Status _s,
                               uint32_t id) {
                status = _s;
                buffer->id = id;
            });
        ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    }
}

@@ -520,6 +539,7 @@ void dispatchOutputBuffer(sp<IOmxNode> omxNode,
            status =
                omxNode->fillBuffer((*buffArray)[bufferIndex].id, t, fenceNh);
            break;
        case PortMode::PRESET_ANW_BUFFER:
        case PortMode::PRESET_SECURE_BUFFER:
        case PortMode::PRESET_BYTE_BUFFER:
            t.sharedMemory = android::hardware::hidl_memory();
+7 −1
Original line number Diff line number Diff line
@@ -1286,10 +1286,16 @@ TEST_F(VideoDecHidlTest, SimpleEOSTest) {
    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);

    // set port mode
    portMode[0] = PortMode::PRESET_BYTE_BUFFER;
    portMode[1] = PortMode::PRESET_ANW_BUFFER;
    status = omxNode->setPortMode(kPortIndexInput, portMode[0]);
    ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
    if (status != ::android::hardware::media::omx::V1_0::Status::OK) {
        portMode[1] = PortMode::PRESET_BYTE_BUFFER;
        status = omxNode->setPortMode(kPortIndexOutput, portMode[1]);
        ASSERT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    }

    // set Port Params
    uint32_t nFrameWidth, nFrameHeight, xFramerate;