I generally try to avoid having to dig into IL because it is horrid in handling state changes and the linked completion events.
The transition between Loaded and Idle always requires the allocation / deallocation of all buffers for enabled ports. See Section 18.104.22.168 and Figure 3-5. Component Initialization, and section 22.214.171.124 / Figure 3-14 De-initialization of Non-tunneled Components of the 1.1.2 spec.
126.96.36.199 Non-tunneled De-initialization
When the transition to OMX_StateIdle is completed, the IL client can request the
component to change its state to OMX_StateLoaded. The IL client shall free all of the
component’s buffers by calling OMX_FreeBuffer for each buffer. The
OMX_FreeBuffer function requires that the component remove the specified buffer
from the specified port.
When all of the buffers have been freed, the component shall complete the state transition.
In your case you had allocated buffers with OMX_UseEGLImage (a variant on OMX_UseBuffer), but hadn't called OMX_FreeBuffer, therefore the component correctly didn't send the completion event as buffers were still allocated.
The other option would be to disable port 221 first (and as with enabling you need to make the SendCommand call, and then OMX_FreeBuffer), and then the state change to Loaded should complete without further odd handling.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.