aboutsummaryrefslogtreecommitdiff
path: root/src/source_private.h
diff options
context:
space:
mode:
authorHarry Jeffery <harry@exec64.co.uk>2019-09-02 22:47:40 +0100
committerHarry Jeffery <harry@exec64.co.uk>2019-09-02 22:47:40 +0100
commit7dcb1a534249fc4f3ea37f6197228754fb831dd8 (patch)
tree3cd23ceb81e2e987b9cdbc88d02950c1e6f09d4c /src/source_private.h
parenta6deca0ad390d29ada6d72584a1be835a3913139 (diff)
downloadimv-7dcb1a534249fc4f3ea37f6197228754fb831dd8.tar.gz
source/backend: Improve comments
Diffstat (limited to 'src/source_private.h')
-rw-r--r--src/source_private.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/source_private.h b/src/source_private.h
index 39b41fe..ed77534 100644
--- a/src/source_private.h
+++ b/src/source_private.h
@@ -4,17 +4,26 @@
struct imv_image;
struct imv_source;
+/* This is the interface a source needs to implement to function correctly.
+ * Backends act as a "factory" for sources by calling imv_source_create
+ * with a pointer to a static vtable, and a pointer to that implementation's
+ * private data, pre-initialised.
+ */
+
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 */
+
+ /* Cleans up the private data of a source */
void (*free)(void *private);
};