OMX_ERRORTYPE port_enable(HTEST *hTest, OMX_U32 nPortIndex)
{
    OMX_ERRORTYPE ret = OMX_ErrorNone;
    OMX_COMPONENTTYPE *hComponent;
    OMX_U32 i;

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

    prepare_port_buffers(hTest, nPortIndex);

    WaitCommand(hTest, OMX_CommandPortEnable, nPortIndex, NULL);

    hTest->bHoldBuffers = OMX_FALSE;
    for(i=0; i<hTest->nBufferHdr[nPortIndex]; i++) {
        if(hTest->PortDir[nPortIndex] == OMX_DirOutput) {
            OMX_FillThisBuffer(hTest->hComponent, hTest->pBufferHdr[nPortIndex][i]);
        }
    }

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

    return OMX_ErrorNone;
}
Ejemplo n.º 2
0
OMX_ERRORTYPE Load2Idle(HTEST *hTest)
{
	OMX_U32 i;
	for(i=0; i<hTest->nPorts; i++)
		prepare_port_buffers(hTest, i);

	return OMX_ErrorNone;
}
OMX_ERRORTYPE Load2Idle(HCOMPONENT *component)
{
	OMX_U32 i;
	for(i=0; i<component->nPorts; i++)
	{
		if(component->bPortTunneled[i] != OMX_TRUE)
			prepare_port_buffers(component, i);
	}

	return OMX_ErrorNone;
}
OMX_ERRORTYPE Load2Idle(HTEST *hTest)
{
	OMX_ERRORTYPE ret =  OMX_ErrorNone;
	OMX_U32 i;
	for(i=0; i<hTest->nPorts; i++)
		prepare_port_buffers(hTest, i);

	OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
	OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
	sPortDef.nPortIndex = hTest->nAudioTrackNum;
	sPortDef.format.audio.eEncoding = OMX_AUDIO_CodingAutoDetect;
	ret = OMX_SetParameter(hTest->hComponent,OMX_IndexParamPortDefinition,&sPortDef);
	if (ret != OMX_ErrorNone)
		return ret;
	sPortDef.nPortIndex = hTest->nVideoTrackNum;
	sPortDef.format.video.eCompressionFormat = OMX_VIDEO_CodingAutoDetect;
	ret = OMX_SetParameter(hTest->hComponent,OMX_IndexParamPortDefinition,&sPortDef);
	if (ret != OMX_ErrorNone)
		return ret;

	return OMX_ErrorNone;
}