summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Mohan M2017-08-29 03:38:47 -0500
committerKeun Soo Yim2018-01-23 16:25:50 -0600
commit0a542276f8e4b776a897683c169f6c5b068b0af7 (patch)
treea6d9b90f601fc75d3acc544c7fda4627dba7995d /media/omx/1.0
parent5e745408496f71100636941061ebbd8fde9025ae (diff)
downloadplatform-hardware-interfaces-0a542276f8e4b776a897683c169f6c5b068b0af7.tar.gz
platform-hardware-interfaces-0a542276f8e4b776a897683c169f6c5b068b0af7.tar.xz
platform-hardware-interfaces-0a542276f8e4b776a897683c169f6c5b068b0af7.zip
bug fix: handle multiple port settings change events signalled at once
Components can send various kinds of port settings changed events all at once. During a full port reconfiguration this is causing problems due to limited flexibility in the message handling design. For now, before committing to a full port reconfiguration defer any events waiting in the queue to be addressed to a later point. Test: make vts -j99 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: 64468705 Merged-In: I537cdd3e7d92cdc6d54168f091d7897afe541599 Change-Id: I537cdd3e7d92cdc6d54168f091d7897afe541599 (cherry picked from commit a230bad8d47ff203beeb84ca0b277fe7c3a9eae6)
Diffstat (limited to 'media/omx/1.0')
-rw-r--r--media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
index d6a16a5c..3f5eff41 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
@@ -487,6 +487,21 @@ void portReconfiguration(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
487 ASSERT_EQ(msg.data.eventData.data1, kPortIndexOutput); 487 ASSERT_EQ(msg.data.eventData.data1, kPortIndexOutput);
488 if (msg.data.eventData.data2 == OMX_IndexParamPortDefinition || 488 if (msg.data.eventData.data2 == OMX_IndexParamPortDefinition ||
489 msg.data.eventData.data2 == 0) { 489 msg.data.eventData.data2 == 0) {
490 // Components can send various kinds of port settings changed events
491 // all at once. Before committing to a full port reconfiguration,
492 // defer any events waiting in the queue to be addressed to a later
493 // point.
494 android::List<Message> msgQueueDefer;
495 while (1) {
496 status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT,
497 iBuffer, oBuffer);
498 if (status !=
499 android::hardware::media::omx::V1_0::Status::TIMED_OUT) {
500 msgQueueDefer.push_back(msg);
501 continue;
502 } else
503 break;
504 }
490 status = omxNode->sendCommand( 505 status = omxNode->sendCommand(
491 toRawCommandType(OMX_CommandPortDisable), kPortIndexOutput); 506 toRawCommandType(OMX_CommandPortDisable), kPortIndexOutput);
492 ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK); 507 ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
@@ -566,6 +581,16 @@ void portReconfiguration(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
566 ASSERT_EQ(msg.data.eventData.data1, OMX_CommandPortEnable); 581 ASSERT_EQ(msg.data.eventData.data1, OMX_CommandPortEnable);
567 ASSERT_EQ(msg.data.eventData.data2, kPortIndexOutput); 582 ASSERT_EQ(msg.data.eventData.data2, kPortIndexOutput);
568 583
584 // Push back deferred messages to the list
585 android::List<Message>::iterator it = msgQueueDefer.begin();
586 while (it != msgQueueDefer.end()) {
587 status = omxNode->dispatchMessage(*it);
588 ASSERT_EQ(
589 status,
590 ::android::hardware::media::omx::V1_0::Status::OK);
591 it++;
592 }
593
569 // dispatch output buffers 594 // dispatch output buffers
570 for (size_t i = 0; i < oBuffer->size(); i++) { 595 for (size_t i = 0; i < oBuffer->size(); i++) {
571 dispatchOutputBuffer(omxNode, oBuffer, i, oPortMode); 596 dispatchOutputBuffer(omxNode, oBuffer, i, oPortMode);