/** \fn getNextFrame \brief */ bool vdpauVideoFilterDeint::getNextFrame(uint32_t *fn,ADMImage *image) { bool r=true; if(eof) { ADM_warning("[VdpauDeint] End of stream\n"); return false; } #define FAIL {r=false;goto endit;} if(passThrough) return previousFilter->getNextFrame(fn,image); // top field has already been sent, grab bottom field if((secondField)&&(configuration.deintMode==ADM_KEEP_BOTH)) { secondField=false; *fn=nextFrame*2+1; if(false==getResult(image)) return false; if(ADM_NO_PTS==nextPts) image->Pts=nextPts; else image->Pts=nextPts-info.frameIncrement; aprintf("2ndField : Pts=%s\n",ADM_us2plain(image->Pts)); return true; } // shift frames;... free slot[0] rotateSlots(); // our first frame, we need to preload one frame if(!nextFrame) { aprintf("This is our first image, filling slot 1\n"); ADMImage *prev= vidCache->getImageAs(ADM_HW_VDPAU,0); if(false==fillSlot(1,prev)) { vidCache->unlockAll(); return false; } if(false==fillSlot(0,prev)) { vidCache->unlockAll(); return false; } } // regular image, in fact we get the next image here ADMImage *next= vidCache->getImageAs(ADM_HW_VDPAU,nextFrame+1); if(next) { if(false==fillSlot(2,next)) { vidCache->unlockAll(); FAIL } }
// Parses a list of files and fill in the relevant CPC fields // according to what is found. // All we do here is fill the proper xxx_file entry. void fillSlots (std::vector<std::string> slot_list, t_CPC& CPC) { bool have_DSKA = false; bool have_DSKB = false; bool have_SNA = false; bool have_TAP = false; bool have_CPR = false; for (const auto& slot : slot_list) { // loop for all command line arguments LOG_DEBUG("Handling arg " << slot); std::string fullpath = stringutils::trim(slot, '"'); // remove quotes if arguments quoted if (fullpath.length() > 5) { // minumum for a valid filename int pos = fullpath.length() - 4; std::string extension = stringutils::lower(fullpath.substr(pos)); if (extension == ".zip") { // are we dealing with a zip archive? zip::t_zip_info zip_info; zip_info.filename = fullpath; zip_info.extensions = ".dsk.sna.cdt.voc.cpr.ipf"; if (zip::dir(&zip_info)) { continue; // error or nothing relevant found } else { std::string filename = zip_info.filesOffsets[0].first; pos = filename.length() - 4; extension = filename.substr(pos); // grab the extension } } if (fillSlot(CPC.drvA_file, have_DSKA, fullpath, extension, ".dsk", "drive A disk")) continue; if (fillSlot(CPC.drvA_file, have_DSKA, fullpath, extension, ".ipf", "drive A disk (IPF)")) continue; if (fillSlot(CPC.drvB_file, have_DSKB, fullpath, extension, ".dsk", "drive B disk")) continue; if (fillSlot(CPC.drvB_file, have_DSKB, fullpath, extension, ".ipf", "drive B disk (IPF)")) continue; if (fillSlot(CPC.snap_file, have_SNA, fullpath, extension, ".sna", "CPC state snapshot")) continue; if (fillSlot(CPC.tape_file, have_TAP, fullpath, extension, ".cdt", "tape (CDT)")) continue; if (fillSlot(CPC.tape_file, have_TAP, fullpath, extension, ".voc", "tape (VOC)")) continue; if (fillSlot(CPC.cart_file, have_CPR, fullpath, extension, ".cpr", "cartridge")) continue; } } }