summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTuomas Virtanen <katajakasa@gmail.com>2016-01-16 23:09:10 +0200
committerTuomas Virtanen <katajakasa@gmail.com>2016-01-16 23:09:10 +0200
commitb2727b578f0b8682f5bbc8651f2ce6a10bf6e271 (patch)
tree3cba8e816199cb591b3348875957c02bcb54e8f7 /include
parent1909055c10e4864190885862e086332c5077f766 (diff)
Decode subtitles, still needs presentation
Diffstat (limited to 'include')
-rw-r--r--include/kitchensink/internal/kitbuffer.h12
-rw-r--r--include/kitchensink/kitplayer.h4
2 files changed, 12 insertions, 4 deletions
diff --git a/include/kitchensink/internal/kitbuffer.h b/include/kitchensink/internal/kitbuffer.h
index 19a0c79..4d0f8cc 100644
--- a/include/kitchensink/internal/kitbuffer.h
+++ b/include/kitchensink/internal/kitbuffer.h
@@ -3,16 +3,22 @@
#include "kitchensink/kitconfig.h"
-typedef struct Kit_Buffer {
+typedef struct Kit_Buffer Kit_Buffer;
+
+typedef void (*Kit_BufferFreeCallback)(void*);
+
+struct Kit_Buffer {
unsigned int read_p;
unsigned int write_p;
unsigned int size;
+ Kit_BufferFreeCallback free_cb;
void **data;
-} Kit_Buffer;
+};
-KIT_LOCAL Kit_Buffer* Kit_CreateBuffer(unsigned int size);
+KIT_LOCAL Kit_Buffer* Kit_CreateBuffer(unsigned int size, Kit_BufferFreeCallback free_cb);
KIT_LOCAL void Kit_DestroyBuffer(Kit_Buffer *buffer);
+KIT_LOCAL void Kit_ClearBuffer(Kit_Buffer *buffer);
KIT_LOCAL void* Kit_ReadBuffer(Kit_Buffer *buffer);
KIT_LOCAL void* Kit_PeekBuffer(const Kit_Buffer *buffer);
KIT_LOCAL void Kit_AdvanceBuffer(Kit_Buffer *buffer);
diff --git a/include/kitchensink/kitplayer.h b/include/kitchensink/kitplayer.h
index ea86b31..7e3ba53 100644
--- a/include/kitchensink/kitplayer.h
+++ b/include/kitchensink/kitplayer.h
@@ -70,6 +70,7 @@ typedef struct Kit_Player {
void *vbuffer; ///< Video stream buffer
void *sbuffer; ///< Subtitle stream buffer
void *cbuffer; ///< Control stream buffer
+ void *active_subs; ///< Active subtitles buffer
// FFmpeg internal state
void *vcodec_ctx; ///< FFmpeg: Video codec context
@@ -102,7 +103,8 @@ KIT_API Kit_Player* Kit_CreatePlayer(const Kit_Source *src);
KIT_API void Kit_ClosePlayer(Kit_Player *player);
KIT_API int Kit_UpdatePlayer(Kit_Player *player);
-KIT_API int Kit_RefreshTexture(Kit_Player *player, SDL_Texture *texture);
+KIT_API int Kit_GetVideoData(Kit_Player *player, SDL_Texture *texture);
+KIT_API int Kit_GetSubtitleData(Kit_Player *player, SDL_Texture *texture);
KIT_API int Kit_GetAudioData(Kit_Player *player, unsigned char *buffer, int length, int cur_buf_len);
KIT_API void Kit_GetPlayerInfo(const Kit_Player *player, Kit_PlayerInfo *info);