Quantcast
Channel: Intel® Software - Media
Viewing all articles
Browse latest Browse all 2185

IOPattern changed by MFXVideoVPP_Query

$
0
0

Greetings,

I added a VPP to resize the video frames, after the decoder and before the encoder. The pipeline worked well if I set the IOPattern to SYSTEM_MEMORY and VIDEO_MEMORY. However, when I set the IOPattern to OPAQUE_MEMORY, the call to MFXVideoVPP_QueryIOSurf() always returned error -15 (MFX_ERR_INVALID_VIDEO_PARAM).

So I tried to call MFXVideoVPP_Query() before MFXVideoVPP_QueryIOSurf() so as to verify the params, and realized that params had been changed by MFXVideoVPP_Query(). 

Below is my code snippet:

    // decide which memory to use
    switch(m_memType) {
        case SYSTEM_MEMORY:
            m_mfxVppParams.IOPattern = MFX_IOPATTERN_IN_SYSTEM_MEMORY | MFX_IOPATTERN_OUT_SYSTEM_MEMORY;
            break;
        case VIDEO_MEMORY:
            m_mfxVppParams.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY | MFX_IOPATTERN_OUT_VIDEO_MEMORY;
            break;
        case OPAQUE_MEMORY:
            m_mfxVppParams.IOPattern = MFX_IOPATTERN_IN_OPAQUE_MEMORY | MFX_IOPATTERN_OUT_OPAQUE_MEMORY;
            break;
        default:
            msdk_printf(MSDK_STRING("  channel %u: invalid memory type !\n"), m_nChanID);
            break;
    }
    msdk_printf(MSDK_STRING("  channel %u: vpp before query: IOPattern == 0x%0x;\n"), m_nChanID, m_mfxVppParams.IOPattern);

    sts = m_pmfxVPP->Query(&m_mfxVppParams, &m_mfxVppParams);
    MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

    msdk_printf(MSDK_STRING("  channel %u: vpp after query: IOPattern == 0x%0x;\n"), m_nChanID, m_mfxVppParams.IOPattern);

 

And here is the stdout output:

  channel 0: instantiating the vpp ...
  channel 0: setting up the vpp params ...
  channel 0: vpp before query: IOPattern == 0x44;
  channel 0: vpp after query: IOPattern == 0x2;

The IOPattern change was also confirmed by the MFX tracer. Before the call to m_pmfxVPP->Query(), IOPattern in the vpp params are like this:

    in.IOPattern=UNKNOWN
    out.IOPattern=UNKNOWN

I don't understand why they were reported as "Unknown", as I had set them to be 
(MFX_IOPATTERN_IN_OPAQUE_MEMORY | MFX_IOPATTERN_OUT_OPAQUE_MEMORY).

However, after the call, they became like below, which was obviously wrong.
    in.IOPattern=MFX_IOPATTERN_IN_SYSTEM_MEMORY
    out.IOPattern=MFX_IOPATTERN_IN_SYSTEM_MEMORY

Any ideas/suggestions as to why this happened ?

Thanks,
Robby


Viewing all articles
Browse latest Browse all 2185

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>