diff options
author | Yahan Zhou <yahan@google.com> | 2024-01-11 16:14:46 -0800 |
---|---|---|
committer | Yahan Zhou <yahan@google.com> | 2024-01-11 16:14:46 -0800 |
commit | 4078f31b05d8f2efc0724779fee038af12b067fa (patch) | |
tree | 47576c354f7f4114ea1aaf0f1b180c9ee38b6fb4 | |
parent | caf5a079f321b6c60ab7b4bf6e5516378c6a7b37 (diff) | |
download | aemu-4078f31b05d8f2efc0724779fee038af12b067fa.tar.gz |
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
-rw-r--r-- | snapshot/include/snapshot/common.h | 12 |
1 files changed, 12 insertions, 0 deletions
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 ITextureSaverPtr = std::shared_ptr<ITextureSaver>; 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) |