aboutsummaryrefslogtreecommitdiff
path: root/src/source_private.h
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-08-30 00:40:29 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-08-30 00:40:29 +0100
commit8b2aaf102f76921721209459eea10bed2094a730 (patch)
tree6942c0e840252e8832aa0a8276435045525a40b4 /src/source_private.h
parent4c0123bb3b449a2ea45b3e831db725d853bb03a1 (diff)
downloadimv-8b2aaf102f76921721209459eea10bed2094a730.tar.gz
source: Refactor out common async logic
Diffstat (limited to 'src/source_private.h')
-rw-r--r--src/source_private.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/source_private.h b/src/source_private.h
new file mode 100644
index 0000000..39b41fe
--- /dev/null
+++ b/src/source_private.h
@@ -0,0 +1,24 @@
+#ifndef IMV_SOURCE_PRIVATE_H
+#define IMV_SOURCE_PRIVATE_H
+
+struct imv_image;
+struct imv_source;
+
+struct imv_source_vtable {
+ /* Loads the first frame, if successful puts output in image and duration
+ * (in milliseconds) in frametime. If unsuccessful, image shall be NULL. A
+ * still image should use a frametime of 0.
+ */
+ void (*load_first_frame)(void *private, struct imv_image **image, int *frametime);
+ /* Loads the next frame, if successful puts output in image and duration
+ * (in milliseconds) in frametime. If unsuccessful, image shall be NULL.
+ */
+ void (*load_next_frame)(void *private, struct imv_image **image, int *frametime);
+ /* Cleans up the private section of a source */
+ void (*free)(void *private);
+};
+
+/* Build a source given its vtable and a pointer to the private data */
+struct imv_source *imv_source_create(const struct imv_source_vtable *vt, void *private);
+
+#endif