This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Questions about OMX_EmptyThisBuffer() function

Hi, 

    The OMX_EmptyThisBuffer() function send the filled buffer referred by the input param "pBuffer". I want to know whether the input buffer is cleared or not after calling the function.

   Appreciate for your reply!

  • Hi Bing,

    This is the full description of the OMX_EmptyThusBuffer() function in the OMX_05_02_00_46_UserGuide.pdf :

    OMX_EmptyThisBuffer(hComponent, pBuffer)
    The OMX_EmptyThisBuffer macro will send a buffer full of data to an input port of a component. The buffer will be emptied by the component and returned to the application via the EmptyBufferDone call back. This is a non-blocking call in that the component will record the buffer and return immediately and then empty the buffer, later, at the proper time. As expected, this macro may be invoked only while the component is in the OMX_StateExecuting. If nPortIndex does not specify an input port, the component shall return an error. The component should return from this call within 5 msec.
    Parameters:
    [in] hComponent Handle of the component to be accessed. This is the component handle returned by the call to the OMX_GetHandle function.
    [in] pBuffer pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer or AllocateBuffer.
    Returns:
    OMX_ERRORTYPE If the command successfully executes, the return code will be OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.

    From my understanding, this function register/record the buffer (pointed by pBuffer) for clearing/emptied, and return. But the process of clearing/emptied the buffer will happen later, at proper time.

    Regards,

    Pavel

  • Hi Pavel,

        Thanks so much for your reply!

        I want to multiplexed use the decoded data stream between several swmosaic components. Now I use memcpy to copy the output data of the decode component to each input port buffer of the swmosaic components. But the arm in the DM8168 could not manage to do this job quickly enough, and the output video has big time-delay and the stream even interupt. I wonder if I can just offer the buffer header instead of doing data copy. But I don't know how to realize this. So, could you give me some help?

  • Hi Pavel,

        I found that Archith gave a post at http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/140890.aspx. He said that the display components could share the same output data of one scalar component  using the OMX_UseBuffer calls to use the outbuffers already allocted by the scalar component as their inbuffers. I don't know if I can use this to solve my problem. Could you give some advice on how to realize this? 

      Thanks so much!

  • Hi Bing,

    From what I understand, this OMX example (OMX Video Decode - Mosaic example) is very close to your use case:

    http://processors.wiki.ti.com/index.php/OMX_EZSDK_Examples#Decode_MosaicDisplay

    Please note, that between the video decoder component (VDEC) and software mosaic component (VSWMOSAIC), we have video frame processing component (VFPC).

    This example source code is located at:

    ti-ezsdk_dm816x-evm_5_05_01_04/component-sources/omx_05_02_00_46/examples/ti/omx/demos/decode_mosaicdisplay

    Regards,

    Pavel

  • Hi Pavel,

        Thanks for your reply! My work is based on the Decode_MosaicDisplay example. I add the UDP receive and send parts, NoiseFilter components, encode components to the example. The following picture shows what I want to do. I want to reuse the output data of scalar components without copy. So, could you give some advice? Maybe you could help me to pass this issue to  Archith.

       Thanks so much!

  • Hi Pavel,

        I manage to solve the above problem follows Archith's advice. Now I have another question about the scalar and noisefilter component. In the OMX_05_02_00_38_UserGuide, it is said that both the two components could have up to 16 inports and outports. I try to set the inport number and outport number to 4. There is no error but the result shows only the first port works.

      So, could you tell me if these two components support multi-port?

      Thanks so much!

  • Hi Bing,

    I suspect that you are using old EZSDK - 05.04.00.11. I am not sure if this will fix your issue, but can you try with the latest EZSDK 05.05.01.04 ?

    Regards,

    Pavel

  • Hi Pavel,

        Actually I use the latest EZSDK. My question now is does the scalar component support multiple inports and outports.

        Thanks so much!