OMX_ERRORTYPE Idle2Load(HTEST *hTest)
{
    OMX_U32 i;

    for(i=0; i<hTest->nPorts; i++)
        free_port_buffers(hTest, i);

    return OMX_ErrorNone;
}
OMX_ERRORTYPE Idle2Load(HCOMPONENT *component)
{
	OMX_U32 i;

	for(i=0; i<component->nPorts; i++)
	{
		if(component->bPortTunneled[i] != OMX_TRUE)
			free_port_buffers(component, i);
	}

	return OMX_ErrorNone;
}
OMX_ERRORTYPE port_disable(HTEST *hTest, OMX_U32 nPortIndex)
{
    OMX_COMPONENTTYPE *hComponent;
    OMX_ERRORTYPE ret = OMX_ErrorNone;

    hComponent = hTest->hComponent;
    ret = SendCommand(hTest, OMX_CommandPortDisable, nPortIndex, NULL, OMX_FALSE);
    if(ret != OMX_ErrorNone)
        return ret;

    hTest->bHoldBuffers = OMX_TRUE;

    free_port_buffers(hTest, nPortIndex);

    WaitCommand(hTest, OMX_CommandPortDisable, nPortIndex, NULL);

    printf("port disbale done.\n");

    return OMX_ErrorNone;
}