| 577 | return true; |
| 578 | } |
| 579 | virtual int Execute(const CaptureOptions &) |
| 580 | { |
| 581 | if(!remote_host.empty()) |
| 582 | { |
| 583 | std::cout << "Replaying '" << filename << "' on " << remote_host << "." << std::endl; |
| 584 | |
| 585 | IRemoteServer *remote = NULL; |
| 586 | ResultDetails result = RENDERDOC_CreateRemoteServerConnection(conv(remote_host), &remote); |
| 587 | |
| 588 | if(remote == NULL || result.code != ResultCode::Succeeded) |
| 589 | { |
| 590 | std::cerr << "Error: " << result.Message() << " - Couldn't connect to " << remote_host |
| 591 | << "." << std::endl; |
| 592 | std::cerr << " Have you run renderdoccmd remoteserver on '" << remote_host << "'?" |
| 593 | << std::endl; |
| 594 | return 1; |
| 595 | } |
| 596 | |
| 597 | std::cerr << "Copying capture file to remote server" << std::endl; |
| 598 | |
| 599 | rdcstr remotePath = remote->CopyCaptureToRemote(conv(filename), NULL); |
| 600 | |
| 601 | IReplayController *renderer = NULL; |
| 602 | rdctie(result, renderer) = remote->OpenCapture(~0U, remotePath, ReplayOptions(), NULL); |
| 603 | |
| 604 | if(result.OK()) |
| 605 | { |
| 606 | DisplayRendererPreview(renderer, width, height, loops); |
| 607 | |
| 608 | remote->CloseCapture(renderer); |
| 609 | } |
| 610 | else |
| 611 | { |
| 612 | std::cerr << "Couldn't load and replay '" << filename << "': " << result.Message() |
| 613 | << std::endl; |
| 614 | } |
| 615 | |
| 616 | remote->ShutdownConnection(); |
| 617 | } |
| 618 | else |
| 619 | { |
| 620 | std::cout << "Replaying '" << filename << "' locally.." << std::endl; |
| 621 | |
| 622 | ICaptureFile *file = RENDERDOC_OpenCaptureFile(); |
| 623 | |
| 624 | ResultDetails res = file->OpenFile(conv(filename), "rdc", NULL); |
| 625 | |
| 626 | if(res.code != ResultCode::Succeeded) |
| 627 | { |
| 628 | std::cerr << "Couldn't load '" << filename << "': " << res.Message() << std::endl; |
| 629 | return 1; |
| 630 | } |
| 631 | |
| 632 | IReplayController *renderer = NULL; |
| 633 | ResultDetails result = {}; |
| 634 | rdctie(result, renderer) = file->OpenCapture(ReplayOptions(), NULL); |
| 635 | |
| 636 | file->Shutdown(); |
nothing calls this directly
no test coverage detected