MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / pmConsumeFrames

Function pmConsumeFrames

IntelPresentMon/PresentMonAPI2/PresentMonAPI.cpp:464–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462}
463
464PRESENTMON_API2_EXPORT PM_STATUS pmConsumeFrames(PM_FRAME_QUERY_HANDLE handle, uint32_t processId, uint8_t* pBlob, uint32_t* pNumFramesToRead)
465{
466 try {
467 const auto requestedFrames = pNumFramesToRead ? *pNumFramesToRead : 0u;
468 pmlog_verb(v::middleware)("pmConsumeFrames")
469 .pmwatch(handle)
470 .pmwatch(processId)
471 .watch("pBlob", DescribePointerArg_(pBlob, false))
472 .watch("pNumFramesToRead", DescribePointerArg_(pNumFramesToRead))
473 .pmwatch(requestedFrames);
474 if (!pBlob) {
475 pmlog_error("null blob outptr").diag();
476 return PM_STATUS_BAD_ARGUMENT;
477 }
478 if (!pNumFramesToRead) {
479 pmlog_error("null frame count in-out ptr").diag();
480 return PM_STATUS_BAD_ARGUMENT;
481 }
482 LookupMiddlewareCheckDropped_(handle).ConsumeFrameEvents(handle, processId, pBlob, *pNumFramesToRead);
483 return PM_STATUS_SUCCESS;
484 }
485 catch (...) {
486 const auto code = util::GeneratePmStatus();
487 if (code == PM_STATUS_INVALID_PID) {
488 // invalid pid is an exception that happens at the end of a normal workflow, so don't flag as error
489 pmlog_info(util::ReportException()).code(code).diag();
490 }
491 else {
492 pmlog_error(util::ReportException()).code(code).diag();
493 }
494 return code;
495 }
496}
497
498PRESENTMON_API2_EXPORT PM_STATUS pmFreeFrameQuery(PM_FRAME_QUERY_HANDLE handle)
499{

Callers 1

ConsumeMethod · 0.50

Calls 3

GeneratePmStatusFunction · 0.85
ReportExceptionFunction · 0.85
ConsumeFrameEventsMethod · 0.80

Tested by

no test coverage detected