summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2018-06-21 02:02:14 +0300
committerTuomas Virtanen <katajakasa@gmail.com>2018-06-21 02:02:14 +0300
commit96fbbaae3957943693de48b3538e7f394ffb9e07 (patch)
treef064c2e6e70c31bc00e18ec49a4cb8419e05d889 /include
parenta8bf8500abd2a998759e18211226a9ec6db0edb8 (diff)
Add a custom source creation function
Diffstat (limited to 'include')
-rw-r--r--include/kitchensink/kitsource.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/kitchensink/kitsource.h b/include/kitchensink/kitsource.h
index 9c4d1b7..b2fcfa6 100644
--- a/include/kitchensink/kitsource.h
+++ b/include/kitchensink/kitsource.h
@@ -1,6 +1,7 @@
#ifndef KITSOURCE_H
#define KITSOURCE_H
+#include <inttypes.h>
#include "kitchensink/kitconfig.h"
#ifdef __cplusplus
@@ -24,6 +25,8 @@ typedef struct Kit_Source {
int video_stream_index; ///< Video stream index
int subtitle_stream_index; ///< Subtitle stream index
void *format_ctx; ///< FFmpeg: Videostream format context
+ void *avio_ctx; ///< FFmpeg: AVIO context
+ uint8_t *avio_buf; ///< Buffer for custom AVIO source
} Kit_Source;
typedef struct Kit_StreamInfo {
@@ -31,7 +34,11 @@ typedef struct Kit_StreamInfo {
Kit_StreamType type; ///< Stream type
} Kit_StreamInfo;
+typedef int (*Kit_ReadCallback)(void*, uint8_t*, int);
+typedef int64_t (*Kit_SeekCallback)(void*, int64_t, int);
+
KIT_API Kit_Source* Kit_CreateSourceFromUrl(const char *path);
+KIT_API Kit_Source* Kit_CreateSourceFromCustom(Kit_ReadCallback read_cb, Kit_SeekCallback seek_cb, void *userdata);
KIT_API void Kit_CloseSource(Kit_Source *src);
KIT_API int Kit_GetSourceStreamInfo(const Kit_Source *src, Kit_StreamInfo *info, int index);