mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 06:22:53 +00:00
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
This commit is contained in:
committed by
Pawin Vongmasa
parent
0de2f15a9e
commit
b7ae92bacb
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user