| 355 | } |
| 356 | |
| 357 | rdcpair<ResultDetails, IReplayController *> CaptureFile::OpenCapture(const ReplayOptions &opts, |
| 358 | RENDERDOC_ProgressCallback progress) |
| 359 | { |
| 360 | ResultDetails ret; |
| 361 | ReplayController *render = NULL; |
| 362 | |
| 363 | if(!m_RDC) |
| 364 | return {RDResult(ResultCode::InternalError, "RDC file unexpectedly NULL"), render}; |
| 365 | |
| 366 | ret = m_RDC->Error(); |
| 367 | |
| 368 | if(!ret.OK()) |
| 369 | return {ret, render}; |
| 370 | |
| 371 | render = new ReplayController(); |
| 372 | |
| 373 | LogReplayOptions(opts); |
| 374 | |
| 375 | RenderDoc::Inst().SetProgressCallback<LoadProgress>(progress); |
| 376 | |
| 377 | // This has to be before the device is created for the capture |
| 378 | RenderDoc::Inst().ClearTrackedFiles(); |
| 379 | // This section is optional any errors do not block opening the capture |
| 380 | if(m_RDC->SectionIndex(SectionType::EmbeddedExternalFiles) >= 0) |
| 381 | ret = RenderDoc::Inst().ReadExternalFiles(m_RDC); |
| 382 | |
| 383 | ret = render->CreateDevice(m_RDC, opts); |
| 384 | |
| 385 | RenderDoc::Inst().SetProgressCallback<LoadProgress>(RENDERDOC_ProgressCallback()); |
| 386 | |
| 387 | if(!ret.OK()) |
| 388 | { |
| 389 | render->Shutdown(); |
| 390 | render = NULL; |
| 391 | } |
| 392 | |
| 393 | return {ret, render}; |
| 394 | } |
| 395 | |
| 396 | void CaptureFile::SetMetadata(const rdcstr &driverName, uint64_t machineIdent, FileType thumbType, |
| 397 | uint32_t thumbWidth, uint32_t thumbHeight, const bytebuf &thumbData, |
nothing calls this directly
no test coverage detected