CCodec: log the component name when the codec is stuck
The video and audio components usually runs at the same time. It's
hard to know which component is stuck if we don't print the name. This
CL adds the component name at the warning log when the codec is stuck.
Bug: 174188958
Test: m -j32
Change-Id: Iaaea1b79ee85efb1346983af6ea91415ced299c4
(cherry picked from commit 183323963f26c362d04d49b2896ca3296bf6abf8)
diff --git a/media/codec2/sfplugin/CCodec.cpp b/media/codec2/sfplugin/CCodec.cpp
index 02f7cb8..4ae4c8e 100644
--- a/media/codec2/sfplugin/CCodec.cpp
+++ b/media/codec2/sfplugin/CCodec.cpp
@@ -2311,7 +2311,13 @@
return;
}
- ALOGW("previous call to %s exceeded timeout", name.c_str());
+ C2String compName;
+ {
+ Mutexed<State>::Locked state(mState);
+ compName = state->comp->getName();
+ }
+ ALOGW("[%s] previous call to %s exceeded timeout", compName.c_str(), name.c_str());
+
initiateRelease(false);
mCallback->onError(UNKNOWN_ERROR, ACTION_CODE_FATAL);
}