Skip to content

Commit 8f95332

Browse files
medialajosandi34
authored andcommitted
IOMX: allow configuration after going to loaded state
This was disallowed recently but we still use it as MediaCodcec.stop only goes to loaded state, and does not free component. Bug: 31450460 Change-Id: I72e092e4e55c9f23b1baee3e950d76e84a5ef28d (cherry picked from commit c139040)
1 parent 02db3ae commit 8f95332

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

media/libstagefright/omx/OMXNodeInstance.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ status_t OMXNodeInstance::freeNode(OMXMaster *master) {
273273
status_t OMXNodeInstance::sendCommand(
274274
OMX_COMMANDTYPE cmd, OMX_S32 param) {
275275
if (cmd == OMX_CommandStateSet && param != OMX_StateIdle) {
276-
// We do not support returning from unloaded state, so there are no configurations past
277-
// first StateSet command. However, OMXCodec supports meta configuration past Stateset:Idle.
276+
// Normally there are no configurations past first StateSet; however, OMXCodec supports
277+
// meta configuration past Stateset:Idle.
278278
mSailed = true;
279279
}
280280
const sp<GraphicBufferSource> bufferSource(getGraphicBufferSource());
@@ -591,7 +591,7 @@ status_t OMXNodeInstance::useBuffer(
591591
params, portIndex, false /* copyToOmx */, false /* copyFromOmx */, data);
592592
} else {
593593
buffer_meta = new BufferMeta(
594-
params, portIndex, false /* copyFromOmx */, false /* copyToOmx */, NULL);
594+
params, portIndex, false /* copyToOmx */, false /* copyFromOmx */, NULL);
595595
}
596596

597597
OMX_BUFFERHEADERTYPE *header;
@@ -1153,6 +1153,13 @@ void OMXNodeInstance::onEvent(
11531153
&& arg2 == OMX_StateExecuting) {
11541154
bufferSource->omxExecuting();
11551155
}
1156+
1157+
// allow configuration if we return to the loaded state
1158+
if (event == OMX_EventCmdComplete
1159+
&& arg1 == OMX_CommandStateSet
1160+
&& arg2 == OMX_StateLoaded) {
1161+
mSailed = false;
1162+
}
11561163
}
11571164

11581165
// static

0 commit comments

Comments
 (0)