MCPcopy Create free account
hub / github.com/baldurk/renderdoc / OpenFile

Method OpenFile

renderdoc/replay/capture_file.cpp:201–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201ResultDetails CaptureFile::OpenFile(const rdcstr &filename, const rdcstr &filetype,
202 RENDERDOC_ProgressCallback progress)
203{
204 CaptureImporter importer = RenderDoc::Inst().GetCaptureImporter(filetype);
205
206 if(importer)
207 {
208 ResultDetails ret;
209
210 {
211 StreamReader reader(FileIO::fopen(filename, FileIO::ReadBinary));
212 SAFE_DELETE(m_RDC);
213 m_RDC = new RDCFile;
214 ret = importer(filename, reader, m_RDC, m_StructuredData, progress);
215 }
216
217 if(ret.code != ResultCode::Succeeded)
218 {
219 SAFE_DELETE(m_RDC);
220 return ret;
221 }
222 }
223 else
224 {
225 if(filetype != "" && filetype != "rdc")
226 RDCWARN("Opening file with unrecognised filetype '%s' - treating as 'rdc'", filetype.c_str());
227
228 if(progress)
229 progress(0.0f);
230
231 SAFE_DELETE(m_RDC);
232 m_RDC = new RDCFile;
233 m_RDC->Open(filename);
234
235 if(progress)
236 progress(1.0f);
237 }
238
239 return Init();
240}
241
242ResultDetails CaptureFile::OpenBuffer(const bytebuf &buffer, const rdcstr &filetype,
243 RENDERDOC_ProgressCallback progress)

Callers 15

ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ExecuteMethod · 0.80
ReopenCaptureFileMethod · 0.80
runMethod · 0.80
RecompressCaptureMethod · 0.80
ImportCaptureMethod · 0.80
ExportCaptureMethod · 0.80
LoadCaptureMethod · 0.80
CrashDialogMethod · 0.80

Calls 6

progressFunction · 0.85
GetCaptureImporterMethod · 0.80
fopenFunction · 0.50
InitFunction · 0.50
c_strMethod · 0.45
OpenMethod · 0.45

Tested by 1

check_exportMethod · 0.64