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

Commit b7ae92ba authored by Ram Mohan M's avatar Ram Mohan M Committed by Pawin Vongmasa
Browse files

bug fix: configure output port frame dimensions

frame dimensions are configured for input port but not output port.
As a result in qcom encoder components, the encoded image is getting
downsized to default dimensions configured for output port. This is now
corrected.

Test: make vts -j30 BUILD_GOOGLE_VTS=true TARGET_PRODUCT=aosp_arm64 &&
vts-tradefed run commandAndExit vts --skip-all-system-status-check
--primary-abi-only --skip-preconditions --module VtsHalMediaOmxV1_0Test
-l INFO

Bug: 62669756
Change-Id: Ib38006edbc82427d322632534ca78d78c5f30eff
parent 0de2f15a
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -521,12 +521,15 @@ void getLatency(sp<IOmxNode> omxNode, OMX_U32 portIndex, uint32_t* latency) {
// Set Default port param.
void setDefaultPortParam(sp<IOmxNode> omxNode, OMX_U32 portIndex,
                         OMX_VIDEO_CODINGTYPE eCompressionFormat,
                         OMX_U32 nFrameWidth, OMX_U32 nFrameHeight,
                         OMX_U32 nBitrate, OMX_U32 xFramerate) {
    android::hardware::media::omx::V1_0::Status status;
    OMX_PARAM_PORTDEFINITIONTYPE portDef;
    status = getPortParam(omxNode, OMX_IndexParamPortDefinition, portIndex,
                          &portDef);
    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    portDef.format.video.nFrameWidth = nFrameWidth;
    portDef.format.video.nFrameHeight = nFrameHeight;
    portDef.format.video.nBitrate = nBitrate;
    portDef.format.video.xFramerate = xFramerate;
    portDef.format.video.bFlagErrorConcealment = OMX_TRUE;
@@ -1028,6 +1031,9 @@ void encodeNFrames(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
            } else if (msg.data.eventData.event == OMX_EventError) {
                EXPECT_TRUE(false) << "Received OMX_EventError, not sure why";
                break;
            } else if (msg.data.eventData.event == OMX_EventDataSpaceChanged) {
                // TODO: how am i supposed to respond now?
                std::cout << "[          ] Info ! OMX_EventDataSpaceChanged \n";
            } else {
                ASSERT_TRUE(false);
            }
@@ -1234,8 +1240,8 @@ TEST_F(VideoEncHidlTest, EncodeTest) {

    // Configure output port
    uint32_t nBitRate = 512000;
    setDefaultPortParam(omxNode, kPortIndexOutput, eCompressionFormat, nBitRate,
                        xFramerate);
    setDefaultPortParam(omxNode, kPortIndexOutput, eCompressionFormat,
                        nFrameWidth, nFrameHeight, nBitRate, xFramerate);
    setRefreshPeriod(omxNode, kPortIndexOutput, 0);

    unsigned int index;
@@ -1319,6 +1325,11 @@ TEST_F(VideoEncHidlTest, EncodeTestBufferMetaModes) {
    setupRAWPort(omxNode, kPortIndexInput, nFrameWidth, nFrameHeight, 0,
                 xFramerate, eColorFormat);

    // Configure output port
    uint32_t nBitRate = 512000;
    setDefaultPortParam(omxNode, kPortIndexOutput, eCompressionFormat,
                        nFrameWidth, nFrameHeight, nBitRate, xFramerate);

    // CreateInputSurface
    EXPECT_TRUE(omx->createInputSurface(
                       [&](android::hardware::media::omx::V1_0::Status _s,