Mp3playback101

Juan A. Rubio edited this page Nov 16, 2015 · 10 revisions

Home | Tizonia OpenMAX IL | Skema

An example Skema suite

<?xml version="1.0" encoding="UTF-8" ?>

<!-- Copyright (C) 2011-2013 Aratelia Limited - Juan A. Rubio -->

<Suite>

  <Case name="Mp3Playback101">

    <OMX_Init />

    <OMX_GetHandle name="OMX.Aratelia.file_reader.binary" alias="fr" />
    <OMX_GetHandle name="OMX.Aratelia.audio_renderer.pcm" alias="ar" />
    <OMX_GetHandle name="OMX.Aratelia.audio_decoder.mp3" alias="ad" />

    <OMX_GetComponentVersion alias="fr" />
    <OMX_GetComponentVersion alias="ar" />
    <OMX_GetComponentVersion alias="ad" />

    <OMX_GetParameter index="OMX_IndexParamPortDefinition" alias="ar" port="0"
                      expect="OMX_ErrorNone"/>
    <OMX_SetParameter index="OMX_IndexParamPortDefinition" alias="ar" port="0"
                      nBufferCountActual="4" expect="OMX_ErrorNone"/>

    <OMX_GetParameter index="OMX_IndexParamCompBufferSupplier" alias="ar"
                      port="0" expect="OMX_ErrorNone"/>
    <OMX_SetParameter index="OMX_IndexParamCompBufferSupplier" alias="ar"
                      port="0" eBufferSupplier="2" expect="OMX_ErrorNone"/>

    <OMX_GetParameter index="OMX_IndexParamCompBufferSupplier" alias="ad"
                      port="0" expect="OMX_ErrorNone"/>
    <OMX_SetParameter index="OMX_IndexParamCompBufferSupplier" alias="ad"
                      port="0" eBufferSupplier="2" expect="OMX_ErrorNone"/>

    <OMX_GetParameter index="OMX_IndexParamCompBufferSupplier" alias="ad"
                      port="1" expect="OMX_ErrorNone"/>
    <OMX_SetParameter index="OMX_IndexParamCompBufferSupplier" alias="ad"
                      port="1" eBufferSupplier="2" expect="OMX_ErrorNone"/>

    <OMX_GetParameter index="OMX_IndexParamCompBufferSupplier" alias="fr"
                      port="0" expect="OMX_ErrorNone"/>
    <OMX_SetParameter index="OMX_IndexParamCompBufferSupplier" alias="fr"
                      port="0" eBufferSupplier="2" expect="OMX_ErrorNone"/>

    <OMX_GetParameter index="OMX_IndexParamAudioPcm" alias="ar"
                      port="0" expect="OMX_ErrorNone"/>
    <OMX_SetParameter index="OMX_IndexParamAudioPcm" alias="ar"
                      port="0" nChannels="2" eNumData="0"
                      eEndian="0" nBitPerSample="16"
                      nSamplingRate="44100" expect="OMX_ErrorNone"/>

    <OMX_GetContentURI alias="fr" port="0" expect="OMX_ErrorNone"/>
    <OMX_SetContentURI alias="fr"
                       port="0" uri="/home/juanrubio/temp/tizonia-test-media/mp3/riff_rock.mp3"
                       expect="OMX_ErrorNone"/>

    <OMX_SetupTunnel outcomp="fr" outport="0" incomp="ad" inport="0"
                     expect="OMX_ErrorNone"/>

    <OMX_SetupTunnel outcomp="ad" outport="1" incomp="ar" inport="0"
                     expect="OMX_ErrorNone"/>

<!-- Transition graph to OMX_StateIdle -->
    <OMX_SendCommand comp="ar" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateIdle" cmddata="0"
                     expect="OMX_ErrorNone"/>
    <OMX_SendCommand comp="ad" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateIdle" cmddata="0"
                     expect="OMX_ErrorNone"/>

    <OMX_ExpectEvent comp="ar" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateIdle"
                     peventdata="0"
                     timeout="1"/>

    <OMX_SendCommand comp="fr" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateIdle" cmddata="0"
                     expect="OMX_ErrorNone"/>

    <OMX_ExpectEvent comp="ad" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateIdle"
                     peventdata="0"
                     timeout="1"/>
    <OMX_ExpectEvent comp="fr" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateIdle"
                     peventdata="0"
                     timeout="1"/>

<!-- Transition graph to OMX_StateExecuting -->
    <OMX_SendCommand comp="ar" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateExecuting" cmddata="0"
                     expect="OMX_ErrorNone"/>
    <OMX_ExpectEvent comp="ar" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateExecuting"
                     peventdata="0"
                     timeout="20"/>

    <OMX_SendCommand comp="ad" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateExecuting" cmddata="0"
                     expect="OMX_ErrorNone"/>
    <OMX_ExpectEvent comp="ad" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateExecuting"
                     peventdata="0"
                     timeout="20"/>

    <OMX_SendCommand comp="fr" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateExecuting" cmddata="0"
                     expect="OMX_ErrorNone"/>
    <OMX_ExpectEvent comp="fr" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateExecuting"
                     peventdata="0"
                     timeout="20"/>

<!-- Await EOS -->
    <OMX_ExpectEvent comp="ar" evt="OMX_EventBufferFlag"
                     ndata1="0"
                     ndata2="1"
                     peventdata="0"
                     timeout="12000"/>

<!-- Transition graph back to OMX_StateIdle -->
    <OMX_SendCommand comp="fr" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateIdle" cmddata="0"
                     expect="OMX_ErrorNone"/>

    <OMX_SendCommand comp="ad" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateIdle" cmddata="0"
                     expect="OMX_ErrorNone"/>

    <OMX_ExpectEvent comp="fr" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateIdle"
                     peventdata="0"
                     timeout="1"/>

    <OMX_SendCommand comp="ar" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateIdle" cmddata="0"
                     expect="OMX_ErrorNone"/>

    <OMX_ExpectEvent comp="ar" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateIdle"
                     peventdata="0"
                     timeout="1"/>
    <OMX_ExpectEvent comp="ad" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateIdle"
                     peventdata="0"
                     timeout="1"/>

<!-- Transition graph back to OMX_StateLoaded -->
    <OMX_SendCommand comp="ar" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateLoaded" cmddata="0"
                     expect="OMX_ErrorNone"/>
    <OMX_SendCommand comp="ad" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateLoaded" cmddata="0"
                     expect="OMX_ErrorNone"/>
    <OMX_SendCommand comp="fr" cmd="OMX_CommandStateSet"
                     nparam1="OMX_StateLoaded" cmddata="0"
                     expect="OMX_ErrorNone"/>

    <OMX_ExpectEvent comp="ar" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateLoaded"
                     peventdata="0"
                     timeout="1"/>
    <OMX_ExpectEvent comp="ad" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateLoaded"
                     peventdata="0"
                     timeout="1"/>
    <OMX_ExpectEvent comp="fr" evt="OMX_EventCmdComplete"
                     ndata1="OMX_CommandStateSet"
                     ndata2="OMX_StateLoaded"
                     peventdata="0"
                     timeout="1"/>

    <OMX_TeardownTunnel outcomp="fr" outport="0" incomp="ad" inport="0"
                        expect="OMX_ErrorNone"/>
    <OMX_TeardownTunnel outcomp="ad" outport="1" incomp="ar" inport="0"
                        expect="OMX_ErrorNone"/>

    <OMX_FreeHandle alias="ar" />
    <OMX_FreeHandle alias="ad" />
    <OMX_FreeHandle alias="fr" />

    <OMX_Deinit />

  </Case>

</Suite>
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.