OMX_ERRORTYPE StdAudioMixerTest_PcmMixer(TEST_CTXTYPE *pCtx)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_U32 nPortIndex, i;

        eError = StdComponentTest_SetRole(pCtx, "audio_mixer.pcm");
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = APB + 0; output port, PCM format */
        nPortIndex = pCtx->sPortParamAudio.nStartPortNumber + 0;
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying PCM output port %d \n", nPortIndex);
        if (StdComponentTest_IsOutputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonAudio_PcmPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = (APB + 1) + i; input port, PCM format */
        for (i = 1; i < pCtx->sPortParamAudio.nPorts; i++)
        {
            nPortIndex = pCtx->sPortParamAudio.nStartPortNumber + i;
            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying PCM input port %d \n", nPortIndex);
            if (StdComponentTest_IsInputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
            OMX_CONF_BAIL_ON_ERROR(eError);
            eError = StdCompCommonAudio_PcmPortParameters(pCtx, nPortIndex);
            OMX_CONF_BAIL_ON_ERROR(eError);
        }

OMX_CONF_TEST_BAIL:

        return (eError);
    }
OMX_ERRORTYPE OMX_CONF_ListComponents()
{
    OMX_ERRORTYPE  eError = OMX_ErrorNone;
    OMX_U32 i = 0;
    OMX_S8 cCompEnumName[256];
 
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\nAvailable Components:\n\n"); 

    /* Initialize OpenMax */
    if (OMX_ErrorNone == (eError = OMX_Init()))
    {
        while (OMX_ErrorNone == eError) 
        {
            /* loop through all enumerated components to determine if the component name
            specificed for the test is enumerated by the OMX core */
            eError = OMX_ComponentNameEnum((OMX_STRING) cCompEnumName, 256, i);
            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t%s\n", cCompEnumName);            
            i++;
        }
    }

    /* didn't find it */
    OMX_Deinit();
    return OMX_ErrorNone;
}
    OMX_ERRORTYPE StdVideoEncoderTest_AvcEncoder(TEST_CTXTYPE *pCtx)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_U32 nPortIndex;

        eError = StdComponentTest_SetRole(pCtx, "video_encoder.avc");
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* For the standard AVC encoder component, there must be at least two video domain ports. */
        if (pCtx->sPortParamVideo.nPorts < 2) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = VPB + 0; input port, raw video format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying Raw video input port 0 \n");
        nPortIndex = pCtx->sPortParamVideo.nStartPortNumber + 0;
        if (StdComponentTest_IsInputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonVideo_RawPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = VPB + 1; output port, AVC format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying AVC output port 1 \n");
        nPortIndex = pCtx->sPortParamVideo.nStartPortNumber + 1;
        if (StdComponentTest_IsOutputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonVideo_AvcPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);


OMX_CONF_TEST_BAIL:

        return (eError);
    }
    OMX_ERRORTYPE StdAudioEncoderTest_AacEncoder(TEST_CTXTYPE *pCtx)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_U32 nPortIndex;

        eError = StdComponentTest_SetRole(pCtx, "audio_encoder.aac");
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* For the standard AAC encoder component, there must be at least two audio domain ports. */
        if (pCtx->sPortParamAudio.nPorts < 2) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = APB + 0; input port, PCM format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying PCM input port 0 \n");
        nPortIndex = pCtx->sPortParamAudio.nStartPortNumber + 0;
        if (StdComponentTest_IsInputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonAudio_PcmPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = APB + 1; outpt port, AAC format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying AAC output port 1 \n");
        nPortIndex = pCtx->sPortParamAudio.nStartPortNumber + 1;
        if (StdComponentTest_IsOutputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonAudio_AacPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

OMX_CONF_TEST_BAIL:

        return (eError);
    }
    OMX_ERRORTYPE StdCompCommonOther_ContainerDemuxerPortParameters(
        TEST_CTXTYPE *pCtx,
        OMX_U32 nPortIndex)
    {

        OMX_ERRORTYPE eError = OMX_ErrorNone;

        OMX_TIME_CONFIG_TIMESTAMPTYPE sTimePosition;
        OMX_TIME_CONFIG_SEEKMODETYPE sTimeSeekMode;

        OMX_CONF_INIT_STRUCT(sTimePosition, OMX_TIME_CONFIG_TIMESTAMPTYPE);
        OMX_CONF_INIT_STRUCT(sTimeSeekMode, OMX_TIME_CONFIG_SEEKMODETYPE);

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying Container Demuxer port %i common parameters\n", nPortIndex);

        /* Verify support for the common standard component port parameters. */
        eError = StdComponentTest_StdPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* There are no default values mentioned in the specification.
           Just verify the access at present.
        */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying support for OMX_IndexConfigTimePosition\n");
        OMX_CONF_CONFIG_REQUIREDGETSET(pCtx, OMX_IndexConfigTimePosition,
                                       (OMX_PTR)&sTimePosition,
                                       eError);                      // R/W

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying support for OMX_IndexConfigTimeSeekMode \n");
        OMX_CONF_CONFIG_REQUIREDGETSET(pCtx, OMX_IndexConfigTimeSeekMode,
                                       (OMX_PTR)&sTimeSeekMode,
                                       eError);                      // R/W

OMX_CONF_TEST_BAIL:
        return(eError);
    }
    OMX_ERRORTYPE StdImageDecoderTest_JpegDecoder(TEST_CTXTYPE *pCtx)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_U32 nPortIndex;

        eError = StdComponentTest_SetRole(pCtx, "image_decoder.jpeg");
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* For the standard JPEG decoder component, there must be at least two image domain ports. */
        if (pCtx->sPortParamImage.nPorts < 2) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = IPB + 0; input port, JPEG format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying JPEG input port 0 \n");
        nPortIndex = pCtx->sPortParamImage.nStartPortNumber + 0;
        OMX_CONF_BAIL_ON_ERROR(eError);
        if (StdComponentTest_IsInputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonImage_JpegPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = IPB + 1; output port, raw image format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying Raw image output port 1 \n");
        nPortIndex = pCtx->sPortParamImage.nStartPortNumber + 1;
        if (StdComponentTest_IsOutputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonImage_RawPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

OMX_CONF_TEST_BAIL:

        return (eError);
    }
OMX_ERRORTYPE OMX_CONF_PrintSettings()
{
    OMX_U32 i;

    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\nOMX_CONF_PrintSettings\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Trace Flags = 0x%08x\n", g_OMX_OSAL_TraceFlags);
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Active Tests:\n");
    for (i=0;i<g_OMX_CONF_nTests;i++){
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t%s\n", 
            g_OMX_CONF_TestLookupTable[g_OMX_CONF_TestIndexList[i]].pName);
    }
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Input File Mappings:\n");
    for (i=0;i<g_OMX_CONF_nInFileMappings;i++){
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t%i:%s\n", 
            g_OMX_CONF_InFileMap[i].nPortIndex, g_OMX_CONF_InFileMap[i].sInputFileName);
    }
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Output File Mappings:\n");
    for (i=0;i<g_OMX_CONF_nOutFileMappings;i++){
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t%i:%s\n", 
            g_OMX_CONF_OutFileMap[i].nPortIndex, g_OMX_CONF_OutFileMap[i].sOutputFileName);
    }
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\n");

    return OMX_ErrorNone;
}
OMX_ERRORTYPE OMX_CONF_ListTests()
{
    OMX_U32 i;
   
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\nAvailable Tests:\n\n"); 
    for (i=0;i<g_OMX_CONF_nTestLookupTableEntries;i++)
    {
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t%s\n", 
            g_OMX_CONF_TestLookupTable[i].pName);
    }
    return OMX_ErrorNone;
}
    OMX_ERRORTYPE PortCommTest_EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
                                            OMX_IN OMX_PTR pAppData,
                                            OMX_IN OMX_EVENTTYPE eEvent,
                                            OMX_IN OMX_U32 nData1,
                                            OMX_IN OMX_U32 nData2,
                                            OMX_IN OMX_PTR pEventData)
    {
        PortCommTestCtxt* pContext;

        UNUSED_PARAMETER(hComponent);
        UNUSED_PARAMETER(pEventData);

        if (pAppData == NULL)
            return OMX_ErrorNone;
        pContext = (PortCommTestCtxt*)pAppData;

        if (eEvent == OMX_EventCmdComplete)
        {
            switch ((OMX_COMMANDTYPE)(nData1))
            {
                case OMX_CommandStateSet:
                    OMX_CONF_StateToString((OMX_STATETYPE)(nData2), szDesc);
                    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Component transitioned to %s\n", szDesc);
                    pContext->eState = (OMX_STATETYPE)(nData2);
                    OMX_OSAL_EventSet(pContext->hStateSetEvent);
                    break;
                case OMX_CommandPortDisable:
                    pContext->nPortsStopped++;
                    if (pContext->nPortsStopped == pContext->nPorts)
                    {
                        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "All ports completed stopping\n");
                        OMX_OSAL_EventSet(pContext->hPortDisableEvent);
                    }
                    break;
                case OMX_CommandPortEnable:
                    pContext->nPortsRestarted++;
                    if (pContext->nPortsRestarted == pContext->nPorts)
                    {
                        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "All ports restarted\n");
                        OMX_OSAL_EventSet(pContext->hPortEnableEvent);
                    }
                    break;
                case OMX_EventBufferFlag:
                    break;
                default:
                    break;
            }
        }
        return OMX_ErrorNone;
    }
    OMX_ERRORTYPE StdContainerDemuxerTest_RealDemuxer(TEST_CTXTYPE *pCtx)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_U32 nPortIndex;

        eError = StdComponentTest_SetRole(pCtx, "container_demuxer.real");
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* For the standard Real Container Demuxer component, there must be at least
           one port each of the audio, video and other domains. */
        if (pCtx->sPortParamAudio.nPorts < 1) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        if (pCtx->sPortParamVideo.nPorts < 1) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        if (pCtx->sPortParamOther.nPorts < 1) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = APB + 0; Output port, PCM format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying PCM output port 0 \n");
        nPortIndex = pCtx->sPortParamAudio.nStartPortNumber + 0;
        if (StdComponentTest_IsOutputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonAudio_PcmPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* TO DO: Verify additional support for some additional configs. */
        /* OMX_IndexConfigAudioVolume, OMX_IndexConfigAudioMute */
        /* Also need to verify the default value for bInterleaved (OMX_IndexParamAudioPcm). */

        /* Verify - Port Index = VPB + 0; output port, raw format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying Raw video output port 0 \n");
        nPortIndex = pCtx->sPortParamVideo.nStartPortNumber + 0;
        if (StdComponentTest_IsOutputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonVideo_RawPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = OPB + 0; input port, OTHER format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying other (media time) input port 0 \n");
        nPortIndex = pCtx->sPortParamOther.nStartPortNumber + 0;
        if (StdComponentTest_IsInputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonOther_OtherPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

OMX_CONF_TEST_BAIL:

        return (eError);
    }
    OMX_ERRORTYPE BufferTest_AllocateAllPlusOne(TEST_CTXTYPE *pCtx)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        TEST_PORTTYPE *pPort;
        OMX_U32 i;
        OMX_U32 nCount;

        pPort = pCtx->aPorts;

        for (i = 0; i < pCtx->nNumPorts; i++)
        {
            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Allocating all buffers plus one on port %i\n",
                           pPort->sPortDef.nPortIndex);
            /* allocate all buffers on each port, but plus buffer */
            nCount = pPort->sPortDef.nBufferCountActual;
            nCount -= LIFO_INQUEUE(pPort->pLifo);
            eError = BufferTest_PortAllocateNumBuffers(pCtx, pPort, nCount);
            OMX_CONF_BAIL_ON_ERROR(eError);
            pPort++;
        }


OMX_CONF_TEST_BAIL:

        return(eError);
    }
示例#12
0
/*
    print usage
 */
void print_usage(OMX_STRING swname)
{
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO,
                   "usage: %s [options] <input-file> <output-file>\n"
                   "\n"
                   "  Available options:\n"
                   "    -i, --input-file                 Input file\n"
                   "    -o, --output-file                Output file\n"
                   "    -I, --input-compression-format   Compression format; 'avc', 'mpeg4', 'h263', 'wmv' or 'jpeg'\n"
                   "    -O, --output-color-format        Color format for output; 'YUV420Planar', 'YUV420SemiPlanar',\n"
                   "                                       'YCbCr', '16bitARGB4444', '16bitARGB1555', '16bitRGB565',\n"
                   "                                       '16bitBGR565', '32bitBGRA8888', '32bitARGB8888'\n"
                   "    -e, --error-concealment          Use error concealment\n"
                   "    -x, --output-width               Width of output image\n"
                   "    -y, --output-height              Height of output image\n"
                   "    -s, --buffer-size                Size of allocated buffers (640*480*3/2) \n"
                   "    -c, --buffer-count               count of buffers allocated for each port (30)\n"
                   "    -v, --buffer-variance-file       Name of variance file\n"
                   "\n"
                   "    -r, --rotation                   Rotation value, angle in degrees\n"
                   "    -m, --mirror                     Mirroring, 1=horizontal, 2=vertical, 3=both\n"
                   "    -D, --write-buffers              Write each buffer additionally to a separate file\n"
                   "\n"
                   "  Return value:\n"
                   "    0  OK\n"
                   "    -  Failures indicated as OMX error codes\n"
                   "\n", swname);
}
    OMX_ERRORTYPE StdIVRendererTest_RgbOverlay(TEST_CTXTYPE *pCtx)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_U32 nPortIndex;

        eError = StdComponentTest_SetRole(pCtx, "iv_renderer.rgb.overlay");
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* For the standard RGB overlay image/video renderer component, there must be at least one video domain ports. */
        if (pCtx->sPortParamVideo.nPorts < 1) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify - Port Index = VPB + 0; input port, rgb format */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying RGB input port 0 \n");
        nPortIndex = pCtx->sPortParamVideo.nStartPortNumber + 0;
        OMX_CONF_BAIL_ON_ERROR(eError);
        if (StdComponentTest_IsInputPort(pCtx, nPortIndex) == OMX_FALSE) eError = OMX_ErrorUndefined;
        OMX_CONF_BAIL_ON_ERROR(eError);
        eError = StdCompCommonVideo_QcifPlusPortParameters(pCtx, nPortIndex, OMX_COLOR_Format16bitRGB565);
        OMX_CONF_BAIL_ON_ERROR(eError);

OMX_CONF_TEST_BAIL:

        return (eError);
    }
    static OMX_ERRORTYPE StdCompCommonImage_PortFormatSupported(
        TEST_CTXTYPE *pCtx,
        OMX_U32 nPortIndex,
        OMX_IMAGE_CODINGTYPE eCompressionFormat,
        OMX_COLOR_FORMATTYPE eColorFormat)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;

        OMX_IMAGE_PARAM_PORTFORMATTYPE sPortFormat;

        OMX_CONF_INIT_STRUCT(sPortFormat, OMX_IMAGE_PARAM_PORTFORMATTYPE);

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying port format support\n");

        sPortFormat.nPortIndex = nPortIndex;

        for (sPortFormat.nIndex = 0; ; sPortFormat.nIndex++)
        {
            eError = OMX_GetParameter(pCtx->hWrappedComp, OMX_IndexParamImagePortFormat, (OMX_PTR) & sPortFormat);
            if (OMX_ErrorNoMore == eError)
                eError = OMX_ErrorBadParameter;  // OMX_ErrorBadPortFormatEncoding
            OMX_CONF_BAIL_ON_ERROR(eError);

            if ((sPortFormat.eCompressionFormat == eCompressionFormat) &&
                    (sPortFormat.eColorFormat == eColorFormat))
                break;
        }

OMX_CONF_TEST_BAIL:
        return(eError);
    }
    /* Handle Events */
    OMX_ERRORTYPE WaitResEventHandler(
        OMX_IN OMX_HANDLETYPE hComponent,
        OMX_IN OMX_PTR pAppData,
        OMX_IN OMX_EVENTTYPE eEvent,
        OMX_IN OMX_U32 nData1,
        OMX_IN OMX_U32 nData2,
        OMX_IN OMX_PTR pEventData)
    {
        OMXWFRTESTDATA* pContext = pAppData;
        OMX_STATETYPE eState;
        char szState[256];

        UNUSED_PARAMETER(hComponent);
        UNUSED_PARAMETER(pEventData);

        if ((eEvent == OMX_EventCmdComplete) && ((OMX_COMMANDTYPE)(nData1) == OMX_CommandStateSet))
        {
            eState = (OMX_STATETYPE)nData2;

            OMX_CONF_StateToString(eState, szState);

            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO,
                           "Instantiation %i changing to state %s\n", pContext->nInstantiation, szState);

            /* Set event change notification */
            OMX_OSAL_EventSet(pContext->hEventStateChange);

            if (eState == OMX_StateIdle)
            {
                OMX_OSAL_EventSet(hEventStateChangeIdle);
            }
            if (eState == OMX_StateLoaded)
            {
                OMX_OSAL_EventSet(hEventStateChangeLoaded);
            }
        }
        if ((eEvent == OMX_EventError) && ((OMX_ERRORTYPE)(nData1) == OMX_ErrorInsufficientResources))
        {

            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO,
                           "Instantiation %i sent OMX_ErrorInsufficientResources error\n", pContext->nInstantiation);

            pContext->bErrorInsufficientResources = OMX_TRUE;
            OMX_OSAL_EventSet(pContext->hEventStateChange);
        }
        return OMX_ErrorNone;
    }
示例#16
0
OMX_U32 getline(OMX_STRING *buf, OMX_U32 *pLen, FILE *file)
{
	OMX_STRING p = 0;
	OMX_U32 len, new_len;
	OMX_U32 n = 0;
	OMX_U8 c;
	OMX_U32 dirty_buffer = 0;

	len = START_LEN;
    /*Allocate memory is not allocated*/
    if(*buf==NULL)
        *buf = (OMX_STRING)malloc(START_LEN + 1);
	if (!*buf) {
        OMX_OSAL_Trace(OMX_OSAL_TRACE_ERROR, "Failed to Allocate Memory\n");
        exit(1);
	}

	p = *buf;

    for (;;) {
        c = (OMX_U8) getc(file);
        if (feof(file)) {
            if (dirty_buffer)
	            break;
            *pLen= (OMX_U32) -1;
            return ((OMX_U32) -1);
        }
        if (c == '\n')
        break;

        if (n++ >= len) {
            new_len = len << 1;
            *buf = (OMX_STRING)realloc(buf, new_len + 1);
            if (*buf == NULL) {
                OMX_OSAL_Trace(OMX_OSAL_TRACE_ERROR, "Failed to Re-allocate Memory\n");
                exit(1);
            }
            len = new_len;
            p = *buf;
            p += len >> 1;
        }
        *p = c;
        p++;
        dirty_buffer = 1;
    }
OMX_ERRORTYPE OMX_CONF_AddTest( OMX_IN OMX_STRING sTestName )
{
    OMX_U32 i,j;

    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\nOMX_CONF_AddTest %s\n\n", sTestName);

    // add all tests?
    if ('*' == sTestName[0])
    {
        g_OMX_CONF_nTests = 0;

        for (i=0;i<g_OMX_CONF_nTestLookupTableEntries;i++)
        {
            /* add index to list */
            g_OMX_CONF_TestIndexList[g_OMX_CONF_nTests++] = i;
        }
        return OMX_ErrorNone;
    }

    /* search for test in lookup table */
    for (i=0;i<g_OMX_CONF_nTestLookupTableEntries;i++)
    {
        /* found test */
        if (!strcmp(g_OMX_CONF_TestLookupTable[i].pName,sTestName))
        {
            /* check test isn't already in list */
            for (j=0;j<g_OMX_CONF_nTests;j++)
            {
                /* duplicate test */
                if (g_OMX_CONF_TestIndexList[j] == i) 
                {
                    OMX_OSAL_Trace(OMX_OSAL_TRACE_ERROR,"OMX_CONF_AddTest failed. Duplicate test.\n");
                    return OMX_ErrorBadParameter;
                }
            }
            /* add index to list */
            g_OMX_CONF_TestIndexList[g_OMX_CONF_nTests++] = i;
            return OMX_ErrorNone;
        }
    }

    /* invalid test */
    OMX_OSAL_Trace(OMX_OSAL_TRACE_ERROR,"OMX_CONF_AddTest failed. Invalid test name.\n");
    return OMX_ErrorBadParameter;
}
void OMX_CONF_PrintStUsage()
{
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\tst <traceflags>: set trace flags to given value.\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t <traceflags> = bitwise ORing of these flags:\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t\t0x0001 = Pass/fail.\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t\t0x0002 = Call sequence.\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t\t0x0004 = Parameters.\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t\t0x0008 = Info.\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t\t0x0010 = Error.\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\t\t0x0020 = Buffer.\n");
}
OMX_ERRORTYPE OMX_CONF_RemoveTest( OMX_IN OMX_STRING sTestName )
{
    OMX_U32 i,j;

    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\nOMX_CONF_RemoveTest %s\n\n", sTestName);

    // remove all tests?
    if ('*' == sTestName[0])
    {
        g_OMX_CONF_nTests = 0;
        return OMX_ErrorNone;
    }

    /* search for test in lookup table */
    for (i=0;i<g_OMX_CONF_nTestLookupTableEntries;i++)
    {
        /* found test */
        if (!strcmp(g_OMX_CONF_TestLookupTable[i].pName,sTestName))
        {
            /* search for test in list */
            for (j=0;j<g_OMX_CONF_nTests;j++)
            {
                /* found test */
                if (g_OMX_CONF_TestIndexList[j] == i) 
                {
                    /* remove index from list */
                    g_OMX_CONF_nTests -= 1;
                    for (;j<g_OMX_CONF_nTests;j++){
                        g_OMX_CONF_TestIndexList[j] = g_OMX_CONF_TestIndexList[j+1];
                    }
                    return OMX_ErrorNone;
                }
            }
            /* test not in list */
            OMX_OSAL_Trace(OMX_OSAL_TRACE_ERROR,"OMX_CONF_RemoveTest. Test not found.\n");
            return OMX_ErrorBadParameter;
       }
    }

    /* invalid test */
    OMX_OSAL_Trace(OMX_OSAL_TRACE_ERROR,"OMX_CONF_RemoveTest. Invalid test name.\n");
    return OMX_ErrorBadParameter;
}
OMX_ERRORTYPE OMX_CONF_MapOutputfile( OMX_IN OMX_STRING sOutputFileName, OMX_IN OMX_U32 nPortIndex )
{
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\nOMX_CONF_MapOutputFile \"%s\" %d\n", sOutputFileName, nPortIndex); 
    if (g_OMX_CONF_nOutFileMappings >= OMX_CONF_MAXOUTFILEMAPPINGS) return OMX_ErrorInsufficientResources;

    strcpy( g_OMX_CONF_OutFileMap[g_OMX_CONF_nOutFileMappings].sOutputFileName, sOutputFileName);
    g_OMX_CONF_OutFileMap[g_OMX_CONF_nOutFileMappings].nPortIndex = nPortIndex;
    g_OMX_CONF_nOutFileMappings++;
    return OMX_ErrorNone;
}
    OMX_ERRORTYPE StdCompCommonImage_QcifPlusPortParameters(
        TEST_CTXTYPE *pCtx,
        OMX_U32 nPortIndex,
        OMX_COLOR_FORMATTYPE eColorFormat)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;

        OMX_PARAM_PORTDEFINITIONTYPE sPortDefinition;
        OMX_IMAGE_PARAM_PORTFORMATTYPE sPortFormat;

        OMX_CONF_INIT_STRUCT(sPortDefinition, OMX_PARAM_PORTDEFINITIONTYPE);
        OMX_CONF_INIT_STRUCT(sPortFormat, OMX_IMAGE_PARAM_PORTFORMATTYPE);

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying QCIF+ image port %i default parameters\n", nPortIndex);

        /* Verify support for the common standard component port parameters */
        eError = StdComponentTest_StdPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify default port definition settings */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying support and default settings for QcifPlus port definition\n");
        sPortDefinition.nPortIndex = nPortIndex;
        eError = OMX_GetParameter(pCtx->hWrappedComp, OMX_IndexParamPortDefinition, (OMX_PTR) & sPortDefinition);
        if ((sPortDefinition.eDomain != OMX_PortDomainImage) ||
                (sPortDefinition.format.image.nFrameWidth != 176) ||
                (sPortDefinition.format.image.nFrameHeight != 220) ||
                (sPortDefinition.format.image.nStride != 352) ||
                (sPortDefinition.format.image.nSliceHeight != 16) ||
                (sPortDefinition.format.image.eCompressionFormat != OMX_IMAGE_CodingUnused) ||
                (sPortDefinition.format.image.eColorFormat != eColorFormat))
            eError = OMX_ErrorBadParameter;  // OMX_ErrorBadPortFormatEncoding
        OMX_CONF_BAIL_ON_ERROR(eError);
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, " eDomain = %d (OMX_PortDomainImage)\n", sPortDefinition.eDomain);
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, " nFrameWidth = %d, nFrameHeight = %d\n",
                       sPortDefinition.format.image.nFrameWidth, sPortDefinition.format.image.nFrameHeight);
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, " nStride = %d, nSliceHeight = %d\n",
                       sPortDefinition.format.image.nStride, sPortDefinition.format.image.nSliceHeight);

        /* Verify default settings for OMX_IndexParamImagePortFormat */
        eError = StdCompCommonImage_PortFormatSupported(pCtx, nPortIndex, OMX_IMAGE_CodingUnused, eColorFormat);
        OMX_CONF_BAIL_ON_ERROR(eError);
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, " eCompressionFormat = OMX_VIDEO_CodingUnused\n");
        if (OMX_COLOR_FormatYUV420Planar == eColorFormat)
            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, " eColorFormat = OMX_COLOR_FormatYUV420Planar\n");
        else if (OMX_COLOR_Format16bitRGB565 == eColorFormat)
            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, " eColorFormat = OMX_COLOR_Format16bitRGB565\n");

        eError = StdCompCommonImage_IVRendererPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

OMX_CONF_TEST_BAIL:
        return(eError);
    }
    OMX_ERRORTYPE StdCompCommonImage_RawPortParameters(
        TEST_CTXTYPE *pCtx,
        OMX_U32 nPortIndex)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;

        OMX_PARAM_PORTDEFINITIONTYPE sPortDefinition;
        OMX_IMAGE_PARAM_PORTFORMATTYPE sPortFormat;

        OMX_CONF_INIT_STRUCT(sPortDefinition, OMX_PARAM_PORTDEFINITIONTYPE);
        OMX_CONF_INIT_STRUCT(sPortFormat, OMX_IMAGE_PARAM_PORTFORMATTYPE);

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying Raw Image port %i Default parameters\n", nPortIndex);

        /* Verify support for the common standard component port parameters */
        eError = StdComponentTest_StdPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

        /* Verify default port definition settings */
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying Raw port definition\n");
        sPortDefinition.nPortIndex = nPortIndex;
        eError = OMX_GetParameter(pCtx->hWrappedComp, OMX_IndexParamPortDefinition, (OMX_PTR) & sPortDefinition);
        if ((sPortDefinition.eDomain != OMX_PortDomainImage) ||
                (sPortDefinition.format.image.nFrameWidth != 640) ||
                (sPortDefinition.format.image.nFrameHeight != 480) ||
                (sPortDefinition.format.image.eCompressionFormat != OMX_IMAGE_CodingUnused) ||
                (sPortDefinition.format.image.eColorFormat != OMX_COLOR_FormatYUV420Planar))
            eError = OMX_ErrorBadParameter;  // OMX_ErrorBadPortFormatEncoding
        OMX_CONF_BAIL_ON_ERROR(eError);
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "eDomain = %d, nFrameWidth = %d, nFrameHeight = %d, "
                       "eCompressionFormat= %d, eColorFormat = %d\n", sPortDefinition.eDomain,
                       sPortDefinition.format.image.nFrameWidth, sPortDefinition.format.image.nFrameHeight,
                       sPortDefinition.format.image.eCompressionFormat, sPortDefinition.format.image.eColorFormat);

        /* Verify default settings for OMX_IndexParamImagePortFormat */
        eError = StdCompCommonImage_PortFormatSupported(pCtx, nPortIndex, OMX_IMAGE_CodingUnused, OMX_COLOR_FormatYUV420Planar);
        OMX_CONF_BAIL_ON_ERROR(eError);
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, " eCompressionFormat = OMX_IMAGE_CodingUnused\n");
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, " eColorFormat = OMX_COLOR_FormatYUV420Planar\n");

OMX_CONF_TEST_BAIL:
        return(eError);
    }
OMX_ERRORTYPE process_input_parameters(int argc, char **args,
                                       OMX_PARAM_PORTDEFINITIONTYPE * params)
{
    OMX_U32 i;               // input, output, input-variance

    i = 1;
    while(i < argc)
    {

        /* input compression format */
        if(strcmp(args[i], "-I") == 0 ||
           strcmp(args[i], "--input-compression-format") == 0)
        {
            OMXDECODER_CHECK_NEXT_VALUE(i, args, argc,
                                        "Parameter for input compression format missing.\n");

            if(strcasecmp(args[i], "avc") == 0)
                params->format.video.eCompressionFormat = OMX_VIDEO_CodingAVC;
            else if(strcasecmp(args[i], "mpeg4") == 0)
                params->format.video.eCompressionFormat = OMX_VIDEO_CodingMPEG4;
            else if(strcasecmp(args[i], "h263") == 0)
                params->format.video.eCompressionFormat = OMX_VIDEO_CodingH263;
            else if(strcasecmp(args[i], "wmv") == 0)
            {
                params->format.video.eCompressionFormat = OMX_VIDEO_CodingWMV;
                parameters.rcv_input = OMX_TRUE;
            }
            else if(strcasecmp(args[i], "mpeg2") == 0)
                params->format.video.eCompressionFormat = OMX_VIDEO_CodingMPEG2;
            else if(strcmp(args[i], "jpeg") == 0)
            {
                parameters.jpeg_input = OMX_TRUE;
                params->format.image.eCompressionFormat = OMX_IMAGE_CodingJPEG;
            }
            else
            {
                OMX_OSAL_Trace(OMX_OSAL_TRACE_ERROR,
                               "Unknown input compression format.\n");
                return OMX_ErrorBadParameter;
            }
        }
        else if(strcmp(args[i], "-e") == 0 ||
                strcmp(args[i], "--error-concealment") == 0)
        {
            params->format.video.bFlagErrorConcealment = OMX_TRUE;
        }
        else
        {
            /* do nothing */
        }
        ++i;
    }

    return OMX_ErrorNone;
}
    OMX_ERRORTYPE PortCommTest_RepackTest(PortCommTestCtxt* pContext)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_BOOL bTimeout;

        OMX_CONF_BAIL_IF_ERROR(PortCommTest_OperateOnPorts(pContext, OpenFile));
        OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StateIdle, pContext));

        if (pContext->nInBuf == 0)
        {
            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Source component, Repack Test not applicable\n");
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_OperateOnPorts(pContext, CloseFile));
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StateLoaded, pContext));
            goto OMX_CONF_TEST_BAIL;
        }
        OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StateExecuting, pContext));

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Sending single byte payloads\n");
        pContext->nBufFactor = 0;
        OMX_OSAL_EventReset(pContext->hEmptyBufDoneEvent);

        if (pContext->nOutBuf)
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_ReadOutBuffers(pContext));
        if (pContext->nInBuf)
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_WriteInBuffers(pContext));

        OMX_OSAL_EventWait(pContext->hEmptyBufDoneEvent, OMX_CONF_TIMEOUT_BUFFER_TRAFFIC, &bTimeout);
        if (pContext->nOutBuf && OMX_TRUE == bTimeout)
        {
            OMX_CONF_SET_ERROR_BAIL("Component is not repacking\n", OMX_ErrorUndefined);
        }
        if (pContext->nInBuf && !pContext->pInBufferList->pBufHdr)
        {
            OMX_CONF_SET_ERROR_BAIL("first buffer has to be returned\n", OMX_ErrorUndefined);
        }
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Sending full payloads\n");
        pContext->nBufFactor = 1;
        OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransmitTest(pContext, OMX_FALSE, OMX_TRUE));

OMX_CONF_TEST_BAIL:
        return eError;
    }
    OMX_ERRORTYPE ResourceExhaustionTest_EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
            OMX_IN OMX_PTR pAppData,
            OMX_IN OMX_EVENTTYPE eEvent,
            OMX_IN OMX_U32 nData1,
            OMX_IN OMX_U32 nData2,
            OMX_IN OMX_PTR pEventData)
    {
        ResourceExhaustionTestContext *pCtxt;

        UNUSED_PARAMETER(hComponent);
        UNUSED_PARAMETER(pEventData);

        if (pAppData == NULL)
            return OMX_ErrorNone;
        pCtxt = (ResourceExhaustionTestContext *)pAppData;

        if (eEvent == OMX_EventCmdComplete)
        {
            switch ((OMX_COMMANDTYPE)(nData1))
            {
                case OMX_CommandStateSet:
                    OMX_CONF_StateToString((OMX_STATETYPE)(nData2), szDesc);
                    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Instance %d transitioned to %s\n",
                                   pCtxt->nInst, szDesc);
                    OMX_OSAL_EventSet(pCtxt->hStateSetEvent);
                    break;
                default:
                    break;
            }
        }
        else if (eEvent == OMX_EventError)
        {
            pCtxt->eLastError = (OMX_ERRORTYPE)(nData1);
            OMX_CONF_ErrorToString(pCtxt->eLastError, szDesc);
            OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Instance %d sent error %0#x %s\n",
                           pCtxt->nInst, nData1, szDesc);
            OMX_OSAL_EventSet(pCtxt->hStateSetEvent);
        }
        return OMX_ErrorNone;
    }
    OMX_ERRORTYPE PortCommTest_DeInitBuffer(PortCommTestCtxt* pContext)
    {
        OMX_U8 *pBuffer;
        BufferList *pBufferListObject;
        BufferList *pTemp;
        OMX_ERRORTYPE eError = OMX_ErrorNone;

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Free all buffers\n");
        pTemp = pContext->pInBufferList;
        while (pTemp)
        {
            pBufferListObject = (BufferList *)pTemp;
            pBuffer = (OMX_U8 *)pTemp->pOrigBufHdr->pBuffer;
            if (pContext->bClientAllocBuf)
            {
                OMX_OSAL_Free(pBuffer);
                pTemp->pOrigBufHdr->pBuffer = NULL;
            }
            eError = OMX_FreeBuffer(pContext->hWComp, pTemp->pOrigBufHdr->nInputPortIndex, pTemp->pOrigBufHdr);
            if (eError == OMX_ErrorInvalidState)
                eError = OMX_ErrorNone;
            OMX_CONF_BAIL_IF_ERROR(eError);
            pTemp = pTemp->pNextBuf;
            if (pBufferListObject)
                OMX_OSAL_Free(pBufferListObject);
            pContext->nInBuf--;
        }
        pContext->pInBufferList = NULL;

        pTemp = pContext->pOutBufferList;
        while (pTemp)
        {
            pBufferListObject = (BufferList *)pTemp;
            pBuffer = (OMX_U8 *)pTemp->pOrigBufHdr->pBuffer;
            if (pContext->bClientAllocBuf)
            {
                OMX_OSAL_Free(pBuffer);
                pTemp->pOrigBufHdr->pBuffer = NULL;
            }
            eError = OMX_FreeBuffer(pContext->hWComp, pTemp->pOrigBufHdr->nOutputPortIndex, pTemp->pOrigBufHdr);
            if (eError == OMX_ErrorInvalidState)
                eError = OMX_ErrorNone;
            OMX_CONF_BAIL_IF_ERROR(eError);
            pTemp = pTemp->pNextBuf;
            if (pBufferListObject)
                OMX_OSAL_Free(pBufferListObject);
            pContext->nOutBuf--;
        }
        pContext->pOutBufferList = NULL;
OMX_CONF_TEST_BAIL:
        return eError;
    }
    OMX_ERRORTYPE PortCommTest_TransmitTest(PortCommTestCtxt* pContext,
                                            OMX_BOOL bInit, OMX_BOOL bClose)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_BOOL bTimeout;

        if (bInit)
        {
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_OperateOnPorts(pContext, OpenFile));
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StateIdle, pContext));
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StateExecuting, pContext));
        }
        /* process buffers */
        while (pContext->nBufDoneCalls < OMX_CONF_BUFFERS_OF_TRAFFIC)
        {
            if (pContext->nOutBuf)
                OMX_CONF_BAIL_IF_ERROR(PortCommTest_ReadOutBuffers(pContext));
            if (pContext->nInBuf)
                OMX_CONF_BAIL_IF_ERROR(PortCommTest_WriteInBuffers(pContext));

            /* if no empty input or output buffer, wait for bufferdone call */
            if (pContext->nOutBuf == pContext->nOutBufBusy && pContext->nInBuf == pContext->nInBufBusy)
            {
                OMX_OSAL_EventReset(pContext->hBufDoneEvent);
                OMX_OSAL_EventWait(pContext->hBufDoneEvent, OMX_CONF_TIMEOUT_BUFFER_TRAFFIC, &bTimeout);
                if (OMX_TRUE == bTimeout)
                {
                    OMX_CONF_SET_ERROR_BAIL("Component is not processing any buffers\n", OMX_ErrorUndefined);
                }
            }
        }
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Processed %d buffers\n", pContext->nBufDoneCalls);
        if (bClose)
        {
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_OperateOnPorts(pContext, CloseFile));
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StateIdle, pContext));
            while (pContext->nOutBufBusy || pContext->nInBufBusy)
            {
                OMX_OSAL_EventReset(pContext->hBufDoneEvent);
                OMX_OSAL_EventWait(pContext->hBufDoneEvent, OMX_CONF_TIMEOUT_BUFFER_TRAFFIC, &bTimeout);
                if (OMX_TRUE == bTimeout)
                {
                    OMX_CONF_SET_ERROR_BAIL("All buffers not returned\n", OMX_ErrorUndefined);
                }
            }
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StateLoaded, pContext));
        }
        pContext->nBufDoneCalls = 0;
OMX_CONF_TEST_BAIL:
        return eError;
    }
    OMX_ERRORTYPE PortCommTest_PauseResume(PortCommTestCtxt* pContext)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_BOOL bTimeout;

        OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransmitTest(pContext, OMX_TRUE, OMX_FALSE));
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Pause the component\n");
        OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StatePause, pContext));
        OMX_OSAL_EventReset(pContext->hBufDoneEvent);
        OMX_OSAL_EventWait(pContext->hBufDoneEvent, OMX_CONF_TIMEOUT_EXPECTING_FAILURE, &bTimeout);
        if (OMX_FALSE == bTimeout)
        {
            OMX_CONF_SET_ERROR_BAIL("bufferdone callbacks made after pause cmdcomplete\n", OMX_ErrorUndefined);
        }
        pContext->nBufDoneCalls = 0;

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Attempting to process buffers while paused\n");
        OMX_OSAL_EventReset(pContext->hBufDoneEvent);

        if (pContext->nOutBuf)
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_ReadOutBuffers(pContext));
        if (pContext->nInBuf)
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_WriteInBuffers(pContext));

        OMX_OSAL_EventWait(pContext->hBufDoneEvent, OMX_CONF_TIMEOUT_EXPECTING_FAILURE, &bTimeout);
        if (OMX_FALSE == bTimeout)
        {
            OMX_CONF_SET_ERROR_BAIL("bufferdone callbacks made during paused state\n", OMX_ErrorUndefined);
        }
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Processed %d buffers\n", pContext->nBufDoneCalls);
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Return to executing\n");
        OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransitionWait(OMX_StateExecuting, pContext));
        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Process buffers after resuming\n");
        OMX_CONF_BAIL_IF_ERROR(PortCommTest_TransmitTest(pContext, OMX_FALSE, OMX_TRUE));

OMX_CONF_TEST_BAIL:
        return eError;
    }
    OMX_ERRORTYPE StdCompCommonOther_ContainerMuxerPortParameters(
        TEST_CTXTYPE *pCtx,
        OMX_U32 nPortIndex)
    {

        OMX_ERRORTYPE eError = OMX_ErrorNone;

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying Container Muxer port %i common parameters\n", nPortIndex);

        /* Verify support for the common standard component port parameters. */
        eError = StdComponentTest_StdPortParameters(pCtx, nPortIndex);
        OMX_CONF_BAIL_ON_ERROR(eError);

OMX_CONF_TEST_BAIL:
        return(eError);
    }
void OMX_CONF_PrintHelp()
{
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\nOMX_CONF_PrintHelp()\n");

    OMX_CONF_PrintCcUsage();
    OMX_CONF_PrintStUsage();
    OMX_CONF_PrintOlUsage();
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\tcl : close log file.\n");
    OMX_CONF_PrintAtUsage();
    OMX_CONF_PrintRtUsage();
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\tlt : list all available tests\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\tlc : list all available components\n");
    OMX_CONF_PrintTcUsage();
    OMX_CONF_PrintMiUsage();
    OMX_CONF_PrintMoUsage();
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\tps: print settings.\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\th: help.\n");
    OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "\tq: quit.\n\n");
}