summaryrefslogtreecommitdiff
path: root/include/kitchensink/kitsource.h
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2016-01-04 04:33:59 +0200
committerTuomas Virtanen <katajakasa@gmail.com>2016-01-04 04:33:59 +0200
commit537ca31915603d7ed47ab4374a74058e340125c7 (patch)
treeb3c19e8dae778385021ea08be596022d952ccab5 /include/kitchensink/kitsource.h
Initial commit; Not done yet though, needs more work.
Diffstat (limited to 'include/kitchensink/kitsource.h')
-rw-r--r--include/kitchensink/kitsource.h51
1 files changed, 51 insertions, 0 deletions
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