diff options
| author | rimio <vasi.vilvoiu@gmail.com> | 2019-01-03 01:48:50 +0200 |
|---|---|---|
| committer | rimio <vasi.vilvoiu@gmail.com> | 2019-01-03 01:48:50 +0200 |
| commit | df66a60b90200b020c3e32a2a6302971b254bbd0 (patch) | |
| tree | 0903e8868ed15867e76c33ba99eba8096136f9cf /src/libsstv.template.h | |
| parent | 85d1eac288e6f40e326b7d3b240588aac5f88e96 (diff) | |
Initial
Diffstat (limited to 'src/libsstv.template.h')
| -rw-r--r-- | src/libsstv.template.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/libsstv.template.h b/src/libsstv.template.h new file mode 100644 index 0000000..a977ff7 --- /dev/null +++ b/src/libsstv.template.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2018 Vasile Vilvoiu (YO7JBP) <vasi.vilvoiu@gmail.com> + * + * libsstv is free software; you can redistribute it and/or modify + * it under the terms of the MIT license. See LICENSE for details. + */ + +#ifndef _LIBSSTV_H_ +#define _LIBSSTV_H_ + +#include <stdint.h> +#include <stddef.h> + +/* + * Version + */ +#define SSTV_VERSION_MAJOR @VERSION_MAJOR@ +#define SSTV_VERSION_MINOR @VERSION_MINOR@ +#define SSTV_VERSION_PATCH @VERSION_PATCH@ +#define SSTV_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@" + +/* + * Error codes + */ +typedef enum { + /* No error */ + SSTV_OK = 0, + + /* Unknown error - should not happen, fatal */ + SSTV_UNKNOWN = 1, + + /* Encoder return codes */ + SSTV_ENCODE_SUCCESSFUL = 1000, + SSTV_ENCODE_END = 1001, + SSTV_ENCODE_FAIL = 1002, +} sstv_error_t; + +/* + * SSTV modes + */ +typedef enum { + SSTV_MODE_WRAASE_SC_1_8 = 0, +} sstv_mode_t; + +/* + * Memory management + */ +typedef void* (*sstv_malloc_t)(size_t); +typedef void (*sstv_free_t)(void *); + +/* + * Routines + */ +extern sstv_error_t sstv_init(sstv_malloc_t alloc_func, sstv_free_t dealloc_func); + +extern sstv_error_t sstv_create_encoder(sstv_mode_t mode, uint8_t *image, size_t sample_rate, void **out_ctx); +extern sstv_error_t sstv_delete_encoder(void *ctx); +extern sstv_error_t sstv_encode(void *ctx, uint8_t *buffer, size_t buffer_size); + +#endif
\ No newline at end of file |
