summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRam Mohan M2017-09-07 18:45:42 -0500
committerandroid-build-merger2017-09-07 18:45:42 -0500
commita24f85f9b93592784f24972bbd386e4e7ed2da45 (patch)
tree9d50204719d5932f25f5144d0a6d14ef41062836 /media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
parente1b1788b4d164d1689a46292404b60d8376e544b (diff)
parent37b490df357435d0e212e94776f6d0ec0c83abde (diff)
downloadplatform-hardware-interfaces-a24f85f9b93592784f24972bbd386e4e7ed2da45.tar.gz
platform-hardware-interfaces-a24f85f9b93592784f24972bbd386e4e7ed2da45.tar.xz
platform-hardware-interfaces-a24f85f9b93592784f24972bbd386e4e7ed2da45.zip
Merge "bug fix: handle multiple port settings change events signalled at once" into oc-dev am: f8677dcfdb
am: 37b490df35 Change-Id: I028c248ebef366eb439b369adad87047086aa07b
Diffstat (limited to 'media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp')
-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 1663ae7e..1d4fd67e 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoDecTest.cpp
@@ -498,6 +498,21 @@ void portReconfiguration(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
498 ASSERT_EQ(msg.data.eventData.data1, kPortIndexOutput); 498 ASSERT_EQ(msg.data.eventData.data1, kPortIndexOutput);
499 if (msg.data.eventData.data2 == OMX_IndexParamPortDefinition || 499 if (msg.data.eventData.data2 == OMX_IndexParamPortDefinition ||
500 msg.data.eventData.data2 == 0) { 500 msg.data.eventData.data2 == 0) {
501 // Components can send various kinds of port settings changed events
502 // all at once. Before committing to a full port reconfiguration,
503 // defer any events waiting in the queue to be addressed to a later
504 // point.
505 android::List<Message> msgQueueDefer;
506 while (1) {
507 status = observer->dequeueMessage(&msg, DEFAULT_TIMEOUT,
508 iBuffer, oBuffer);
509 if (status !=
510 android::hardware::media::omx::V1_0::Status::TIMED_OUT) {
511 msgQueueDefer.push_back(msg);
512 continue;
513 } else
514 break;
515 }
501 status = omxNode->sendCommand( 516 status = omxNode->sendCommand(
502 toRawCommandType(OMX_CommandPortDisable), kPortIndexOutput); 517 toRawCommandType(OMX_CommandPortDisable), kPortIndexOutput);
503 ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK); 518 ASSERT_EQ(status, android::hardware::media::omx::V1_0::Status::OK);
@@ -577,6 +592,16 @@ void portReconfiguration(sp<IOmxNode> omxNode, sp<CodecObserver> observer,
577 ASSERT_EQ(msg.data.eventData.data1, OMX_CommandPortEnable); 592 ASSERT_EQ(msg.data.eventData.data1, OMX_CommandPortEnable);
578 ASSERT_EQ(msg.data.eventData.data2, kPortIndexOutput); 593 ASSERT_EQ(msg.data.eventData.data2, kPortIndexOutput);
579 594
595 // Push back deferred messages to the list
596 android::List<Message>::iterator it = msgQueueDefer.begin();
597 while (it != msgQueueDefer.end()) {
598 status = omxNode->dispatchMessage(*it);
599 ASSERT_EQ(
600 status,
601 ::android::hardware::media::omx::V1_0::Status::OK);
602 it++;
603 }
604
580 // dispatch output buffers 605 // dispatch output buffers
581 for (size_t i = 0; i < oBuffer->size(); i++) { 606 for (size_t i = 0; i < oBuffer->size(); i++) {
582 dispatchOutputBuffer(omxNode, oBuffer, i, oPortMode); 607 dispatchOutputBuffer(omxNode, oBuffer, i, oPortMode);