diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-24 23:30:42 +0300 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2018-06-24 23:30:42 +0300 |
commit | d7d5cb75e6fa7f0d2eaeb9cdaf2812dc4c5be466 (patch) | |
tree | 63a68f7fceb4d4a9c06a0e5054375da0477f081f /include/kitchensink/internal | |
parent | 1d06ec23f264e18a188bf46b72c8794c82c4b89e (diff) |
API rework #36, #37
Diffstat (limited to 'include/kitchensink/internal')
-rw-r--r-- | include/kitchensink/internal/audio/kitaudio.h | 5 | ||||
-rw-r--r-- | include/kitchensink/internal/kitdecoder.h | 24 | ||||
-rw-r--r-- | include/kitchensink/internal/kitlibstate.h | 5 | ||||
-rw-r--r-- | include/kitchensink/internal/subtitle/kitsubtitle.h | 5 | ||||
-rw-r--r-- | include/kitchensink/internal/subtitle/renderers/kitsubrenderer.h | 1 | ||||
-rw-r--r-- | include/kitchensink/internal/video/kitvideo.h | 7 |
6 files changed, 31 insertions, 16 deletions
diff --git a/include/kitchensink/internal/audio/kitaudio.h b/include/kitchensink/internal/audio/kitaudio.h index 105c9f6..e42770b 100644 --- a/include/kitchensink/internal/audio/kitaudio.h +++ b/include/kitchensink/internal/audio/kitaudio.h @@ -2,11 +2,10 @@ #define KITAUDIO_H
#include "kitchensink/kitconfig.h"
-#include "kitchensink/kitformats.h"
-#include "kitchensink/kitplayer.h"
+#include "kitchensink/kitsource.h"
#include "kitchensink/internal/kitdecoder.h"
-KIT_LOCAL Kit_Decoder* Kit_CreateAudioDecoder(const Kit_Source *src, int stream_index, Kit_AudioFormat *format);
+KIT_LOCAL Kit_Decoder* Kit_CreateAudioDecoder(const Kit_Source *src, int stream_index);
KIT_LOCAL int Kit_GetAudioDecoderData(Kit_Decoder *dec, unsigned char *buf, int len);
#endif // KITAUDIO_H
diff --git a/include/kitchensink/internal/kitdecoder.h b/include/kitchensink/internal/kitdecoder.h index b4b3f36..0e89aea 100644 --- a/include/kitchensink/internal/kitdecoder.h +++ b/include/kitchensink/internal/kitdecoder.h @@ -7,6 +7,8 @@ #include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
+#include "kitchensink/kitformat.h"
+#include "kitchensink/kitcodec.h"
#include "kitchensink/kitconfig.h"
#include "kitchensink/kitsource.h"
#include "kitchensink/internal/utils/kitbuffer.h"
@@ -24,6 +26,7 @@ KIT_LOCAL struct Kit_Decoder { int stream_index; ///< Source stream index for the current stream
double clock_sync; ///< Sync source for current stream
double clock_pos; ///< Current pts for the stream
+ Kit_OutputFormat output; ///< Output format for the decoder
AVCodecContext *codec_ctx; ///< FFMpeg internal: Codec context
AVFormatContext *format_ctx; ///< FFMpeg internal: Format context (owner: Kit_Source)
@@ -37,24 +40,33 @@ KIT_LOCAL struct Kit_Decoder { };
KIT_LOCAL Kit_Decoder* Kit_CreateDecoder(const Kit_Source *src, int stream_index,
- int out_b_size, dec_free_packet_cb free_out_cb);
-KIT_LOCAL int Kit_SetDecoderStreamIndex(Kit_Decoder *dec, int stream_index);
+ int out_b_size, dec_free_packet_cb free_out_cb,
+ int thread_count);
+KIT_LOCAL void Kit_CloseDecoder(Kit_Decoder *dec);
+
+KIT_LOCAL int Kit_GetDecoderStreamIndex(const Kit_Decoder *dec);
+KIT_LOCAL int Kit_GetDecoderCodecInfo(const Kit_Decoder *dec, Kit_Codec *codec);
+KIT_LOCAL int Kit_GetDecoderOutputFormat(const Kit_Decoder *dec, Kit_OutputFormat *output);
+
KIT_LOCAL void Kit_SetDecoderClockSync(Kit_Decoder *dec, double sync);
KIT_LOCAL void Kit_ChangeDecoderClockSync(Kit_Decoder *dec, double sync);
+
+KIT_LOCAL int Kit_RunDecoder(Kit_Decoder *dec);
+KIT_LOCAL void Kit_ClearDecoderBuffers(Kit_Decoder *dec);
+
KIT_LOCAL bool Kit_CanWriteDecoderInput(Kit_Decoder *dec);
KIT_LOCAL int Kit_WriteDecoderInput(Kit_Decoder *dec, AVPacket *packet);
KIT_LOCAL AVPacket* Kit_ReadDecoderInput(Kit_Decoder *dec);
+KIT_LOCAL void Kit_ClearDecoderInput(Kit_Decoder *dec);
+
KIT_LOCAL int Kit_WriteDecoderOutput(Kit_Decoder *dec, void *packet);
KIT_LOCAL void* Kit_PeekDecoderOutput(Kit_Decoder *dec);
KIT_LOCAL void* Kit_ReadDecoderOutput(Kit_Decoder *dec);
KIT_LOCAL void Kit_AdvanceDecoderOutput(Kit_Decoder *dec);
KIT_LOCAL void Kit_ForEachDecoderOutput(Kit_Decoder *dec, Kit_ForEachItemCallback foreach_cb, void *userdata);
-KIT_LOCAL void Kit_ClearDecoderBuffers(Kit_Decoder *dec);
KIT_LOCAL int Kit_LockDecoderOutput(Kit_Decoder *dec);
KIT_LOCAL void Kit_UnlockDecoderOutput(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/kitlibstate.h b/include/kitchensink/internal/kitlibstate.h index ad515b9..b92cebb 100644 --- a/include/kitchensink/internal/kitlibstate.h +++ b/include/kitchensink/internal/kitlibstate.h @@ -6,6 +6,11 @@ typedef struct Kit_LibraryState { unsigned int init_flags; + unsigned int thread_count; + unsigned int font_hinting; + unsigned int video_buf_frames; + unsigned int audio_buf_frames; + unsigned int subtitle_buf_frames; ASS_Library *libass_handle; void *ass_so_handle; } Kit_LibraryState; diff --git a/include/kitchensink/internal/subtitle/kitsubtitle.h b/include/kitchensink/internal/subtitle/kitsubtitle.h index 9f83e3d..8de101b 100644 --- a/include/kitchensink/internal/subtitle/kitsubtitle.h +++ b/include/kitchensink/internal/subtitle/kitsubtitle.h @@ -4,12 +4,11 @@ #include <SDL2/SDL_render.h>
#include "kitchensink/kitconfig.h"
-#include "kitchensink/kitformats.h"
-#include "kitchensink/kitplayer.h"
+#include "kitchensink/kitsource.h"
#include "kitchensink/internal/kitdecoder.h"
KIT_LOCAL Kit_Decoder* Kit_CreateSubtitleDecoder(
- const Kit_Source *src, int stream_index, Kit_SubtitleFormat *format, int video_w, int video_h, int screen_w, int screen_h);
+ const Kit_Source *src, int stream_index, int video_w, int video_h, int screen_w, int screen_h);
KIT_LOCAL int Kit_GetSubtitleDecoderData(
Kit_Decoder *dec, SDL_Texture *texture, SDL_Rect *sources, SDL_Rect *targets, int limit);
KIT_LOCAL void Kit_SetSubtitleDecoderSize(Kit_Decoder *dec, int w, int h);
diff --git a/include/kitchensink/internal/subtitle/renderers/kitsubrenderer.h b/include/kitchensink/internal/subtitle/renderers/kitsubrenderer.h index 84b815b..e07aa55 100644 --- a/include/kitchensink/internal/subtitle/renderers/kitsubrenderer.h +++ b/include/kitchensink/internal/subtitle/renderers/kitsubrenderer.h @@ -2,7 +2,6 @@ #define KITSUBRENDERER_H
#include "kitchensink/kitsource.h"
-#include "kitchensink/kitformats.h"
typedef struct Kit_SubtitleRenderer Kit_SubtitleRenderer;
typedef struct Kit_TextureAtlas Kit_TextureAtlas;
diff --git a/include/kitchensink/internal/video/kitvideo.h b/include/kitchensink/internal/video/kitvideo.h index 1e158a7..0733177 100644 --- a/include/kitchensink/internal/video/kitvideo.h +++ b/include/kitchensink/internal/video/kitvideo.h @@ -1,12 +1,13 @@ #ifndef KITVIDEO_H
#define KITVIDEO_H
+#include <SDL2/SDL_render.h>
+
#include "kitchensink/kitconfig.h"
-#include "kitchensink/kitformats.h"
-#include "kitchensink/kitplayer.h"
+#include "kitchensink/kitsource.h"
#include "kitchensink/internal/kitdecoder.h"
-KIT_LOCAL Kit_Decoder* Kit_CreateVideoDecoder(const Kit_Source *src, int stream_index, Kit_VideoFormat *format);
+KIT_LOCAL Kit_Decoder* Kit_CreateVideoDecoder(const Kit_Source *src, int stream_index);
KIT_LOCAL int Kit_GetVideoDecoderData(Kit_Decoder *dec, SDL_Texture *texture);
#endif // KITVIDEO_H
|