コード例 #1
0
        /// <returns>
        /// true:keep calling me
        /// false:this phase done
        /// </returns>
        bool Flush2(mfxFrameSurface1 **frame)
        {
            *frame = (mfxFrameSurface1 *)0;
            // mfxSyncPoint syncpD;
            mfxFrameSurface1 *pmfxOutSurface = (mfxFrameSurface1 *)0;


            // bool UseVPP = false;
            //   if (UseVPP)
            return(false);

#if false
            //
            // Stage 3: Retrieve the buffered VPP frames
            //
            //while (MFX_ERR_NONE <= sts) {
            int nIndex2 = GetFreeSurfaceIndex(pmfxSurfaces2, nSurfNumVPPOut);   // Find free frame surface
            QuickSyncStatic.ThrowOnBadStatus((mfxStatus)nIndex2, "cannot find free surface");

            // Process a frame asychronously (returns immediately)
            sts = mfxVPP->RunFrameVPPAsync(NULL, pmfxSurfaces2[nIndex2], NULL, &syncpV);
            if (MFX_ERR_MORE_DATA == sts)
            {
                return(sts); // continue;
            }
            MSDK_IGNORE_MFX_STS(sts, MFX_ERR_MORE_SURFACE);
            MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);  //MSDK_BREAK_ON_ERROR(sts);

            sts = session.SyncOperation(syncpV, 60000); // Synchronize. Wait until frame processing is ready
            MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);

            ++nFrame;
            if (bEnableOutput)
            {
                //sts = WriteRawFrame(pmfxSurfaces2[nIndex2], fSink);
                //MSDK_BREAK_ON_ERROR(sts);
                *frame = pmfxSurfaces2[nIndex2];
                return(sts);

                //printf("Frame number: %d\r", nFrame);
            }
            //}

            // MFX_ERR_MORE_DATA indicates that all buffers has been fetched, exit in case of other errors
            //MSDK_IGNORE_MFX_STS(sts, MFX_ERR_MORE_DATA);
            //MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
#endif
        }