Add an opaque struct to contain snapshot save/load streams
The content of the struct and the snapshot API is still subject to
changes. The idea is to wrap up all output stream pointers into one
struct so that we don't keep adding more parameters to the snapshot API.
Bug: 294277842
Test: GfxstreamEnd2EndVkSnapshotBasicTest
Change-Id: I5775512467c4987c199cefe56bf5ddff77ab79a3
diff --git a/snapshot/include/snapshot/common.h b/snapshot/include/snapshot/common.h
index bc4d3cf..c62ffc0 100644
--- a/snapshot/include/snapshot/common.h
+++ b/snapshot/include/snapshot/common.h
@@ -18,6 +18,8 @@
#include "interface.h"
+#include "aemu/base/files/Stream.h"
+
#include <memory>
#include <string>
#include <stdint.h>
@@ -45,6 +47,16 @@
using ITextureLoaderPtr = std::shared_ptr<ITextureLoader>;
using ITextureLoaderWPtr = std::weak_ptr<ITextureLoader>;
+struct SnapshotSaveStream {
+ android::base::Stream* stream = nullptr;
+ ITextureSaverPtr textureSaver;
+};
+
+struct SnapshotLoadStream {
+ android::base::Stream* stream = nullptr;
+ ITextureLoaderPtr textureLoader;
+};
+
// Taken from exec.c, these #defines
// are for the |flags| field in SnapshotRamBlock.
#define SNAPSHOT_RAM_MAPPED_SHARED (1 << 1)