diff options
author | Pin-chih Lin <johnylin@google.com> | 2018-10-09 16:31:43 +0800 |
---|---|---|
committer | Pin-chih Lin <johnylin@google.com> | 2018-11-21 21:37:44 +0800 |
commit | 89f03c6f98d5b4f8dbee3f7aded97de5d9bfd888 (patch) | |
tree | 25ee8f9d5dc96b7a77da42389c41fa4b814f7261 | |
parent | e50c6ef9dc5b60a77c947fca086152d0953a1280 (diff) | |
download | v4l2_codec2-89f03c6f98d5b4f8dbee3f7aded97de5d9bfd888.tar.gz |
codec2: finish shutdown process despite error is notified
When release is signaled, MediaCodec will always wait on shutdown complete
notification despite any reported error during shutdown, otherwise it will be
hanged. That is, C2VDAComponent would still need to finish shutdown process
even if VDA notifies error.
Bug: 117474461
Test: CtsSecurityTestCases android.security.cts.StagefrightTest#testBug36816007
Change-Id: Ib0f6f2b3871d3eed42d564a6417336138d586c5e
(cherry picked from commit 06d1f6e0142781f75a159862eed79efa1d921bea)
-rw-r--r-- | C2VDAAdaptorProxy.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/C2VDAAdaptorProxy.cpp b/C2VDAAdaptorProxy.cpp index 1bd08fc..eac16bf 100644 --- a/C2VDAAdaptorProxy.cpp +++ b/C2VDAAdaptorProxy.cpp @@ -121,10 +121,12 @@ void C2VDAAdaptorProxy::NotifyEndOfBitstreamBuffer(int32_t bitstream_id) { void C2VDAAdaptorProxy::NotifyResetDone(::arc::mojom::VideoDecodeAccelerator::Result result) { ALOGV("NotifyResetDone"); + // Always notify reset done to component even if result is not success. On shutdown, MediaCodec + // will wait on shutdown complete notification despite any error. If no notification, it will be + // hanging until timeout and force release. if (result != ::arc::mojom::VideoDecodeAccelerator::Result::SUCCESS) { ALOGE("Reset is done incorrectly."); NotifyError(result); - return; } mClient->notifyResetDone(); } |