diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-21 02:02:14 +0300 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-21 02:02:14 +0300 |
commit | 96fbbaae3957943693de48b3538e7f394ffb9e07 (patch) | |
tree | f064c2e6e70c31bc00e18ec49a4cb8419e05d889 /include/kitchensink | |
parent | a8bf8500abd2a998759e18211226a9ec6db0edb8 (diff) |
Add a custom source creation function
Diffstat (limited to 'include/kitchensink')
-rw-r--r-- | include/kitchensink/kitsource.h | 7 |
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); |