diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2016-01-04 04:33:59 +0200 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2016-01-04 04:33:59 +0200 |
commit | 537ca31915603d7ed47ab4374a74058e340125c7 (patch) | |
tree | b3c19e8dae778385021ea08be596022d952ccab5 /include/kitchensink |
Initial commit; Not done yet though, needs more work.
Diffstat (limited to 'include/kitchensink')
-rw-r--r-- | include/kitchensink/kitchensink.h | 38 | ||||
-rw-r--r-- | include/kitchensink/kiterror.h | 16 | ||||
-rw-r--r-- | include/kitchensink/kitplayer.h | 23 | ||||
-rw-r--r-- | include/kitchensink/kitsource.h | 51 |
4 files changed, 128 insertions, 0 deletions
diff --git a/include/kitchensink/kitchensink.h b/include/kitchensink/kitchensink.h new file mode 100644 index 0000000..6ece77c --- /dev/null +++ b/include/kitchensink/kitchensink.h @@ -0,0 +1,38 @@ +#ifndef KITCHENSINK_H +#define KITCHENSINK_H + +#include <SDL2/SDL.h> +#include "kitchensink/kiterror.h" +#include "kitchensink/kitsource.h" +#include "kitchensink/kitplayer.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define KIT_VERSION(x) \ + (x)->major = KIT_VERSION_MAJOR; \ + (x)->minor = KIT_VERSION_MINOR; \ + (x)->patch = KIT_VERSION_PATCH + +typedef struct Kit_Version { + Uint8 major; + Uint8 minor; + Uint8 patch; +} Kit_Version; + +enum { + KIT_INIT_FORMATS = 0x1, + KIT_INIT_NETWORK = 0x2, +}; + +int Kit_Init(); +void Kit_Quit(); + +void Kit_GetVersion(Kit_Version *version); + +#ifdef __cplusplus +} +#endif + +#endif // KITCHENSINK_H diff --git a/include/kitchensink/kiterror.h b/include/kitchensink/kiterror.h new file mode 100644 index 0000000..1b88f89 --- /dev/null +++ b/include/kitchensink/kiterror.h @@ -0,0 +1,16 @@ +#ifndef KITERROR_H +#define KITERROR_H + +#ifdef __cplusplus +extern "C" { +#endif + +const char* Kit_GetError(); +void Kit_SetError(const char* fmt, ...); +void Kit_ClearError(); + +#ifdef __cplusplus +} +#endif + +#endif // KITERROR_H diff --git a/include/kitchensink/kitplayer.h b/include/kitchensink/kitplayer.h new file mode 100644 index 0000000..3c88920 --- /dev/null +++ b/include/kitchensink/kitplayer.h @@ -0,0 +1,23 @@ +#ifndef KITPLAYER_H +#define KITPLAYER_H + +#include "kitchensink/kitsource.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct Kit_Player { + +} Kit_Player; + +Kit_Player* Kit_CreatePlayer(Kit_Source *src); +void Kit_ClosePlayer(Kit_Player *player); + + + +#ifdef __cplusplus +} +#endif + +#endif // KITPLAYER_H diff --git a/include/kitchensink/kitsource.h b/include/kitchensink/kitsource.h new file mode 100644 index 0000000..2b72e88 --- /dev/null +++ b/include/kitchensink/kitsource.h @@ -0,0 +1,51 @@ +#ifndef KITSOURCE_H +#define KITSOURCE_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define KIT_CODECNAMESIZE 32 +#define KIT_CODECLONGNAMESIZE 128 + +typedef enum Kit_streamtype { + KIT_STREAMTYPE_UNKNOWN, + KIT_STREAMTYPE_VIDEO, + KIT_STREAMTYPE_AUDIO, + KIT_STREAMTYPE_DATA, + KIT_STREAMTYPE_SUBTITLE, + KIT_STREAMTYPE_ATTACHMENT +} Kit_streamtype; + +typedef struct Kit_Source { + int astream_idx; + int vstream_idx; + void *format_ctx; + void *vcodec_ctx; + void *acodec_ctx; + void *vcodec; + void *acodec; +} Kit_Source; + +typedef struct Kit_Stream { + int index; + Kit_streamtype type; + int width; + int height; +} Kit_StreamInfo; + +Kit_Source* Kit_CreateSourceFromUrl(const char *path); +int Kit_InitSourceCodecs(Kit_Source *src); +void Kit_CloseSource(Kit_Source *src); + +int Kit_GetSourceStreamInfo(const Kit_Source *src, Kit_StreamInfo *info, int index); +int Kit_GetSourceStreamCount(const Kit_Source *src); +int Kit_GetBestSourceStream(const Kit_Source *src, const Kit_streamtype type); +int Kit_SetSourceStream(Kit_Source *src, const Kit_streamtype type, int index); +int Kit_GetSourceStream(const Kit_Source *src, const Kit_streamtype type); + +#ifdef __cplusplus +} +#endif + +#endif // KITSOURCE_H |