| 1703 | } |
| 1704 | |
| 1705 | rdcstr RemoteServer::CopyCaptureToRemote(const rdcstr &filename, RENDERDOC_ProgressCallback progress) |
| 1706 | { |
| 1707 | FILE *fileHandle = FileIO::fopen(filename, FileIO::ReadBinary); |
| 1708 | |
| 1709 | if(!fileHandle) |
| 1710 | { |
| 1711 | RDCERR("Can't open file '%s'", filename.c_str()); |
| 1712 | return ""; |
| 1713 | } |
| 1714 | |
| 1715 | { |
| 1716 | WRITE_DATA_SCOPE(); |
| 1717 | SCOPED_SERIALISE_CHUNK(RemoteServerPacket::CopyCaptureToRemote); |
| 1718 | |
| 1719 | // this will take ownership of and close the file |
| 1720 | StreamReader fileStream(fileHandle); |
| 1721 | ser.SerialiseStream(filename, fileStream, progress); |
| 1722 | } |
| 1723 | |
| 1724 | rdcstr path; |
| 1725 | |
| 1726 | { |
| 1727 | READ_DATA_SCOPE(); |
| 1728 | RemoteServerPacket type = ser.ReadChunk<RemoteServerPacket>(); |
| 1729 | |
| 1730 | if(type == RemoteServerPacket::CopyCaptureToRemote) |
| 1731 | { |
| 1732 | SERIALISE_ELEMENT(path); |
| 1733 | } |
| 1734 | else |
| 1735 | { |
| 1736 | RDCERR("Unexpected response to capture copy request"); |
| 1737 | } |
| 1738 | |
| 1739 | ser.EndChunk(); |
| 1740 | } |
| 1741 | |
| 1742 | return path; |
| 1743 | } |
| 1744 | |
| 1745 | void RemoteServer::TakeOwnershipCapture(const rdcstr &filename) |
| 1746 | { |