diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2018-01-15 20:04:09 +0200 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2018-01-15 20:04:09 +0200 |
commit | eace70f1c1c7ba7339713666a76213acf1125202 (patch) | |
tree | a13d1468406644b91e3bc50bc139ebc32cda2e90 /include | |
parent | 2267d51d2b402c377a21bf03be6fc51b251f063b (diff) |
Dump reorganized code
Diffstat (limited to 'include')
15 files changed, 50 insertions, 35 deletions
diff --git a/include/kitchensink/internal/kitaudio.h b/include/kitchensink/internal/audio/kitaudio.h index ac6753b..ac6753b 100644 --- a/include/kitchensink/internal/kitaudio.h +++ b/include/kitchensink/internal/audio/kitaudio.h diff --git a/include/kitchensink/internal/kitdecoder.h b/include/kitchensink/internal/kitdecoder.h index 191113b..5d494e8 100644 --- a/include/kitchensink/internal/kitdecoder.h +++ b/include/kitchensink/internal/kitdecoder.h @@ -9,7 +9,7 @@ #include "kitchensink/kitconfig.h"
#include "kitchensink/kitsource.h"
-#include "kitchensink/internal/kitbuffer.h"
+#include "kitchensink/internal/utils/kitbuffer.h"
#define KIT_DEC_IN 0
#define KIT_DEC_OUT 1
@@ -48,6 +48,8 @@ KIT_LOCAL void* Kit_PeekDecoderOutput(Kit_Decoder *dec); KIT_LOCAL void Kit_AdvanceDecoderOutput(Kit_Decoder *dec);
KIT_LOCAL void Kit_ClearDecoderBuffers(Kit_Decoder *dec);
KIT_LOCAL int Kit_RunDecoder(Kit_Decoder *dec);
+KIT_LOCAL void Kit_ClearDecoderInput(Kit_Decoder *dec);
+KIT_LOCAL void Kit_ClearDecoderOutput(Kit_Decoder *dec);
KIT_LOCAL void Kit_CloseDecoder(Kit_Decoder *dec);
#endif // KITDECODER_H
diff --git a/include/kitchensink/internal/kitlist.h b/include/kitchensink/internal/kitlist.h deleted file mode 100644 index 85e3e3f..0000000 --- a/include/kitchensink/internal/kitlist.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef KITLIST_H -#define KITLIST_H - -#include "kitchensink/kitconfig.h" - -typedef struct Kit_List Kit_List; - -typedef void (*Kit_ListFreeCallback)(void*); - -struct Kit_List { - unsigned int size; - unsigned int length; - Kit_ListFreeCallback free_cb; - void **data; -}; - -KIT_LOCAL Kit_List* Kit_CreateList(unsigned int size, Kit_ListFreeCallback free_cb); -KIT_LOCAL void Kit_DestroyList(Kit_List *list); - -KIT_LOCAL void Kit_ClearList(Kit_List *list); -KIT_LOCAL void Kit_RemoveFromList(Kit_List *list, unsigned int iterator); -KIT_LOCAL void* Kit_IterateList(const Kit_List *list, unsigned int *iterator); -KIT_LOCAL int Kit_WriteList(Kit_List *list, void *ptr); -KIT_LOCAL int Kit_GetListLength(const Kit_List *list); - -#endif // KITLIST_H diff --git a/include/kitchensink/internal/kitsubtitle.h b/include/kitchensink/internal/subtitle/kitsubtitle.h index 5296aef..51de9b9 100644 --- a/include/kitchensink/internal/kitsubtitle.h +++ b/include/kitchensink/internal/subtitle/kitsubtitle.h @@ -9,6 +9,6 @@ #include "kitchensink/internal/kitdecoder.h"
KIT_LOCAL Kit_Decoder* Kit_CreateSubtitleDecoder(const Kit_Source *src, Kit_SubtitleFormat *format, int w, int h);
-KIT_LOCAL int Kit_GetSubtitleDecoderData(Kit_Decoder *dec, SDL_Renderer *renderer);
+KIT_LOCAL int Kit_GetSubtitleDecoderData(Kit_Decoder *dec, SDL_Texture *texture);
#endif // KITSUBTITLE_H
diff --git a/include/kitchensink/internal/subtitle/renderers/kitsubass.h b/include/kitchensink/internal/subtitle/renderers/kitsubass.h new file mode 100644 index 0000000..39df3ac --- /dev/null +++ b/include/kitchensink/internal/subtitle/renderers/kitsubass.h @@ -0,0 +1,10 @@ +#ifndef KITSUBASS_H
+#define KITSUBASS_H
+
+#include "kitchensink/kitconfig.h"
+#include "kitchensink/internal/kitdecoder.h"
+#include "kitchensink/internal/subtitle/renderers/kitsubrenderer.h"
+
+KIT_LOCAL Kit_SubtitleRenderer* Kit_CreateASSSubtitleRenderer(const Kit_Decoder *dec, int w, int h);
+
+#endif // KITSUBASS_H
diff --git a/include/kitchensink/internal/subtitle/renderers/kitsubimage.h b/include/kitchensink/internal/subtitle/renderers/kitsubimage.h new file mode 100644 index 0000000..d26b67e --- /dev/null +++ b/include/kitchensink/internal/subtitle/renderers/kitsubimage.h @@ -0,0 +1,6 @@ +#ifndef KITSUBIMAGE_H
+#define KITSUBIMAGE_H
+
+
+
+#endif // KITSUBIMAGE_H
diff --git a/include/kitchensink/internal/subtitle/renderers/kitsubrenderer.h b/include/kitchensink/internal/subtitle/renderers/kitsubrenderer.h new file mode 100644 index 0000000..b24161a --- /dev/null +++ b/include/kitchensink/internal/subtitle/renderers/kitsubrenderer.h @@ -0,0 +1,22 @@ +#ifndef KITSUBRENDERER_H
+#define KITSUBRENDERER_H
+
+#include "kitchensink/kitsource.h"
+#include "kitchensink/kitformats.h"
+
+typedef struct Kit_SubtitleRenderer Kit_SubtitleRenderer;
+
+typedef int (*ren_render_cb)(Kit_SubtitleRenderer *ren, void *src, double start_pts, void *surface);
+typedef void (*ren_close_cb)(Kit_SubtitleRenderer *ren);
+
+struct Kit_SubtitleRenderer {
+ void *userdata;
+ ren_render_cb ren_render; ///< Subtitle rendering function callback
+ ren_close_cb ren_close; ///< Subtitle renderer close function callback
+};
+
+KIT_LOCAL Kit_SubtitleRenderer* Kit_CreateSubtitleRenderer();
+KIT_LOCAL int Kit_RunSubtitleRenderer(Kit_SubtitleRenderer *ren, void *src, double start_pts, void *surface);
+KIT_LOCAL void Kit_CloseSubtitleRenderer(Kit_SubtitleRenderer *ren);
+
+#endif // KITSUBRENDERER_H
diff --git a/include/kitchensink/internal/kitbuffer.h b/include/kitchensink/internal/utils/kitbuffer.h index 4d0f8cc..4d0f8cc 100644 --- a/include/kitchensink/internal/kitbuffer.h +++ b/include/kitchensink/internal/utils/kitbuffer.h diff --git a/include/kitchensink/internal/kithelpers.h b/include/kitchensink/internal/utils/kithelpers.h index 5b94a7a..5b94a7a 100644 --- a/include/kitchensink/internal/kithelpers.h +++ b/include/kitchensink/internal/utils/kithelpers.h diff --git a/include/kitchensink/internal/kitlog.h b/include/kitchensink/internal/utils/kitlog.h index 1a56e53..1a56e53 100644 --- a/include/kitchensink/internal/kitlog.h +++ b/include/kitchensink/internal/utils/kitlog.h diff --git a/include/kitchensink/internal/kitringbuffer.h b/include/kitchensink/internal/utils/kitringbuffer.h index 2f67520..2f67520 100644 --- a/include/kitchensink/internal/kitringbuffer.h +++ b/include/kitchensink/internal/utils/kitringbuffer.h diff --git a/include/kitchensink/internal/kitvideo.h b/include/kitchensink/internal/video/kitvideo.h index 5a5624f..5a5624f 100644 --- a/include/kitchensink/internal/kitvideo.h +++ b/include/kitchensink/internal/video/kitvideo.h diff --git a/include/kitchensink/kitformats.h b/include/kitchensink/kitformats.h index a1cc61e..129047b 100644 --- a/include/kitchensink/kitformats.h +++ b/include/kitchensink/kitformats.h @@ -24,6 +24,7 @@ typedef struct Kit_VideoFormat { typedef struct Kit_SubtitleFormat {
int stream_index; ///< Stream index
bool is_enabled; ///< Is stream enabled
+ unsigned int format; ///< SDL Pixel Format
} Kit_SubtitleFormat;
#endif // KITFORMATS_H
diff --git a/include/kitchensink/kitlib.h b/include/kitchensink/kitlib.h index 9a827be..d8c3bb9 100644 --- a/include/kitchensink/kitlib.h +++ b/include/kitchensink/kitlib.h @@ -18,8 +18,8 @@ typedef struct Kit_Version { } Kit_Version; enum { - KIT_INIT_FORMATS = 0x1, - KIT_INIT_NETWORK = 0x2, + KIT_INIT_NETWORK = 0x1, + KIT_INIT_ASS = 0x2 }; KIT_API int Kit_Init(unsigned int flags); diff --git a/include/kitchensink/kitplayer.h b/include/kitchensink/kitplayer.h index a33828b..a5c93a2 100644 --- a/include/kitchensink/kitplayer.h +++ b/include/kitchensink/kitplayer.h @@ -21,9 +21,9 @@ extern "C" { typedef enum Kit_PlayerState { KIT_STOPPED = 0, ///< Playback stopped or has not started yet. - KIT_PLAYING, ///< Playback started & player is actively decoding. - KIT_PAUSED, ///< Playback paused; player is actively decoding but no new data is given out. - KIT_CLOSED ///< Playback is stopped and player is closing. + KIT_PLAYING, ///< Playback started & player is actively decoding. + KIT_PAUSED, ///< Playback paused; player is actively decoding but no new data is given out. + KIT_CLOSED ///< Playback is stopped and player is closing. } Kit_PlayerState; typedef struct Kit_Player { @@ -57,8 +57,8 @@ KIT_API void Kit_ClosePlayer(Kit_Player *player); KIT_API int Kit_UpdatePlayer(Kit_Player *player); KIT_API int Kit_GetVideoData(Kit_Player *player, SDL_Texture *texture); -KIT_API int Kit_GetSubtitleData(Kit_Player *player, SDL_Renderer *renderer); -KIT_API int Kit_GetAudioData(Kit_Player *player, unsigned char *buffer, int length, int cur_buf_len); +KIT_API int Kit_GetSubtitleData(Kit_Player *player, SDL_Texture *texture); +KIT_API int Kit_GetAudioData(Kit_Player *player, unsigned char *buffer, int length); KIT_API void Kit_GetPlayerInfo(const Kit_Player *player, Kit_PlayerInfo *info); KIT_API Kit_PlayerState Kit_GetPlayerState(const Kit_Player *player); |