void NuPlayerVPPProcessor::flushShutdown() {
    LOGV("flushShutdown");

    if(!mThreadRunning)
        return;

    quitThread();

    if (mWorker != NULL) {
        delete mWorker;
        mWorker = NULL;
    }

    printBuffers();

    if (!mThreadRunning) {
        for (uint32_t i = 0; i < mInputBufferNum; i++) {
            if(mInput[i].mStatus != VPP_BUFFER_FREE) {
                postAndResetInput(i);
            }
        }

        for (uint32_t i = 0; i < mOutputBufferNum; i++) {
            if (mOutput[i].mStatus != VPP_BUFFER_RENDERING) {
                ACodec::BufferInfo * info = findBufferByGraphicBuffer(mOutput[i].mGraphicBuffer);
                if (info != NULL) {
                    cancelBufferToNativeWindow(info);
                    mOutput[i].resetBuffer(NULL);
                }
            }
        }
    }
    mInputLoadPoint = 0;
    mOutputLoadPoint = 0;
}
Ejemplo n.º 2
0
GenericSchedulerThread::~GenericSchedulerThread()
{
    // Ensure the thread is no longer running
    quitThread(false);

    // If blocking here from the main-thread you probably forgot to call waitForThreadToQuitQueued_main_thread() appropriately
    wait();
}
NuPlayerVPPProcessor::~NuPlayerVPPProcessor() {
    quitThread();

    if (mWorker != NULL) {
        delete mWorker;
        mWorker = NULL;
    }

    if (mThreadRunning == false) {
        releaseBuffers();
    }
    mNuPlayerVPPProcessor = NULL;
    LOGI("===== VPPInputCount = %d  =====", mInputCount);
}