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

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

bug fix: fix encoder input port configuration issues

1. Number of P frames being INT_MAX - 1 is misleading few components.
avoid this value
2. enumerate level: The level information is obtained from
enumerateProfileandLevel. Now the component supports up to this level
or 1 step below this level is unclear. This is causing few problems in
the configuration of input port.
3. Disable few error checks for index types that are not universally
supported

Test: VtsHalMediaOmxV1_0Host
Bug: 37501531
Change-Id: I0c3220ec8d17d3527fa5fdae1a2f9c5add11a5de
parent 538b7d85
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -248,8 +248,7 @@ class VideoEncHidlTest : public ::testing::VtsHalHidlTargetTestBase {
            if (msg.data.extendedBufferData.rangeLength != 0) {
                // Test if current timestamp is among the list of queued
                // timestamps
                if (timestampDevTest && (prependSPSPPS ||
                                         (msg.data.extendedBufferData.flags &
                if (timestampDevTest && ((msg.data.extendedBufferData.flags &
                                          OMX_BUFFERFLAG_CODECCONFIG) == 0)) {
                    bool tsHit = false;
                    android::List<uint64_t>::iterator it =
+19 −9
Original line number Diff line number Diff line
@@ -179,7 +179,7 @@ void setupAVCPort(sp<IOmxNode> omxNode, OMX_U32 portIndex,
    status = getPortParam(omxNode, OMX_IndexParamVideoAvc, portIndex, &param);
    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    param.nSliceHeaderSpacing = 0;
    param.nPFrames = 0xFFFFFFFE;
    param.nPFrames = 300;
    param.nBFrames = 0;
    param.bUseHadamard = OMX_TRUE;
    param.nRefFrames = 1;
@@ -204,9 +204,13 @@ void setupHEVCPort(sp<IOmxNode> omxNode, OMX_U32 portIndex,
    status = getPortParam(omxNode, (OMX_INDEXTYPE)OMX_IndexParamVideoHevc,
                          portIndex, &param);
    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    param.eProfile = eProfile;
    param.eLevel = eLevel;
    param.nKeyFrameInterval = 0xFFFFFFFE;
    (void)eProfile;
    (void)eLevel;
    // SPECIAL CASE; OMX.qcom.video.encoder.hevc does not support the level it
    // enumerated in the list. Lets skip this for now
    // param.eProfile = eProfile;
    // param.eLevel = eLevel;
    param.nKeyFrameInterval = 300;
    status = setPortParam(omxNode, (OMX_INDEXTYPE)OMX_IndexParamVideoHevc,
                          portIndex, &param);
    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
@@ -225,7 +229,7 @@ void setupMPEG4Port(sp<IOmxNode> omxNode, OMX_U32 portIndex,
    param.nSliceHeaderSpacing = 0;
    param.bSVH = OMX_FALSE;
    param.bGov = OMX_FALSE;
    param.nPFrames = 0xFFFFFFFE;
    param.nPFrames = 300;
    param.nBFrames = 0;
    param.nIDCVLCThreshold = 0;
    param.bACPred = OMX_TRUE;
@@ -250,7 +254,7 @@ void setupH263Port(sp<IOmxNode> omxNode, OMX_U32 portIndex,
    status = getPortParam(omxNode, OMX_IndexParamVideoH263, portIndex, &param);
    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);

    param.nPFrames = 0xFFFFFFFE;
    param.nPFrames = 300;
    param.nBFrames = 0;
    param.eProfile = eProfile;
    param.eLevel = eLevel;
@@ -272,16 +276,22 @@ void setupVPXPort(sp<IOmxNode> omxNode, OMX_U32 portIndex, OMX_U32 xFramerate) {
    status = getPortParam(omxNode,
                          (OMX_INDEXTYPE)OMX_IndexParamVideoAndroidVp8Encoder,
                          portIndex, &param);
    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    // EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    // SPECIAL CASE; OMX.qcom.video.encoder.vp8 does not support this index
    // type. Dont flag error for now
    if (status != ::android::hardware::media::omx::V1_0::Status::OK) return;

    param.nKeyFrameInterval = 0xFFFFFFFE;
    param.nKeyFrameInterval = 300;
    param.eTemporalPattern = OMX_VIDEO_VPXTemporalLayerPatternNone;
    param.nMinQuantizer = 2;
    param.nMaxQuantizer = 63;
    status = setPortParam(omxNode,
                          (OMX_INDEXTYPE)OMX_IndexParamVideoAndroidVp8Encoder,
                          portIndex, &param);
    EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    // EXPECT_EQ(status, ::android::hardware::media::omx::V1_0::Status::OK);
    // SPECIAL CASE; OMX.qcom.video.encoder.vp8 does not support this index
    // type. Dont flag error for now
    if (status != ::android::hardware::media::omx::V1_0::Status::OK) return;
}

void setupVP8Port(sp<IOmxNode> omxNode, OMX_U32 portIndex,