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

am: 5f03369e25

Change-Id: I05f800f7c941b20e99557c33272c05eda20e6b7f
This commit is contained in:
Ram Mohan M 2017-09-21 01:03:38 +00:00 committed by android-build-merger
commit c0424d71c0
2 changed files with 27 additions and 1 deletions

View file

@ -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();

View file

@ -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;