summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--include/kitchensink/internal/kitdecoder.h3
-rw-r--r--src/internal/kitaudio.c (renamed from src/kitaudio.c)9
-rw-r--r--src/internal/kitbuffer.c (renamed from src/kitbuffer.c)0
-rw-r--r--src/internal/kitdecoder.c (renamed from src/kitdecoder.c)7
-rw-r--r--src/internal/kithelpers.c (renamed from src/kithelpers.c)2
-rw-r--r--src/internal/kitlibstate.c (renamed from src/kitlibstate.c)0
-rw-r--r--src/internal/kitlist.c (renamed from src/kitlist.c)0
-rw-r--r--src/internal/kitringbuffer.c (renamed from src/kitringbuffer.c)0
-rw-r--r--src/internal/kitsubtitle.c (renamed from src/kitsubtitle.c)5
-rw-r--r--src/internal/kitvideo.c (renamed from src/kitvideo.c)3
11 files changed, 13 insertions, 24 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63a600d..d70cfd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.0)
+cmake_minimum_required(VERSION 3.1)
project(SDL_kitchensink C)
include(GNUInstallDirs)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
@@ -47,8 +47,8 @@ if(USE_ASS)
set(INCLUDES ${INCLUDES} ${ASS_INCLUDE_DIRS})
endif()
-FILE(GLOB SOURCES "src/*.c")
-FILE(GLOB HEADERS "include/kitchensink/*.h")
+FILE(GLOB_RECURSE SOURCES "src/*.c")
+FILE(GLOB INSTALL_HEADERS "include/kitchensink/*.h")
add_library(SDL_kitchensink SHARED ${SOURCES})
add_library(SDL_kitchensink_static STATIC ${SOURCES})
@@ -100,7 +100,7 @@ endif()
# Installation
install(FILES ${PKG_CONFIG_FILE} DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
-install(FILES ${HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/kitchensink)
+install(FILES ${INSTALL_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/kitchensink)
INSTALL(TARGETS SDL_kitchensink SDL_kitchensink_static
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
diff --git a/include/kitchensink/internal/kitdecoder.h b/include/kitchensink/internal/kitdecoder.h
index 9d6f84d..191113b 100644
--- a/include/kitchensink/internal/kitdecoder.h
+++ b/include/kitchensink/internal/kitdecoder.h
@@ -37,8 +37,7 @@ KIT_LOCAL struct Kit_Decoder {
};
KIT_LOCAL Kit_Decoder* Kit_CreateDecoder(const Kit_Source *src, int stream_index,
- int in_b_size, int out_b_size,
- dec_free_packet_cb free_out_cb);
+ int out_b_size, dec_free_packet_cb free_out_cb);
KIT_LOCAL void Kit_SetDecoderClockSync(Kit_Decoder *dec, double sync);
KIT_LOCAL void Kit_ChangeDecoderClockSync(Kit_Decoder *dec, double sync);
KIT_LOCAL bool Kit_CanWriteDecoderInput(Kit_Decoder *dec);
diff --git a/src/kitaudio.c b/src/internal/kitaudio.c
index e05948b..4e67b74 100644
--- a/src/kitaudio.c
+++ b/src/internal/kitaudio.c
@@ -14,7 +14,6 @@
#include "kitchensink/internal/kitringbuffer.h"
#include "kitchensink/internal/kitlog.h"
-#define KIT_AUDIO_IN_SIZE 32
#define KIT_AUDIO_OUT_SIZE 16
#define AUDIO_SYNC_THRESHOLD 0.05
@@ -39,12 +38,6 @@ Kit_AudioPacket* _CreateAudioPacket(const char* data, size_t len, double pts) {
return p;
}
-void _FreeAudioPacket(void *ptr) {
- Kit_AudioPacket *packet = ptr;
- Kit_DestroyRingBuffer(packet->rb);
- free(packet);
-}
-
enum AVSampleFormat _FindAVSampleFormat(int format) {
switch(format) {
case AUDIO_U8: return AV_SAMPLE_FMT_U8;
@@ -190,7 +183,7 @@ Kit_Decoder* Kit_CreateAudioDecoder(const Kit_Source *src, Kit_AudioFormat *form
// First the generic decoder component ...
Kit_Decoder *dec = Kit_CreateDecoder(
src, src->audio_stream_index,
- KIT_AUDIO_IN_SIZE, KIT_AUDIO_OUT_SIZE,
+ KIT_AUDIO_OUT_SIZE,
free_out_audio_packet_cb);
if(dec == NULL) {
goto exit_0;
diff --git a/src/kitbuffer.c b/src/internal/kitbuffer.c
index 5c492ea..5c492ea 100644
--- a/src/kitbuffer.c
+++ b/src/internal/kitbuffer.c
diff --git a/src/kitdecoder.c b/src/internal/kitdecoder.c
index 2018097..df78559 100644
--- a/src/kitdecoder.c
+++ b/src/internal/kitdecoder.c
@@ -6,22 +6,21 @@
#include "kitchensink/internal/kitdecoder.h"
#include "kitchensink/kiterror.h"
+#define BUFFER_IN_SIZE 32
static void free_in_video_packet_cb(void *packet) {
av_packet_free((AVPacket**)&packet);
}
Kit_Decoder* Kit_CreateDecoder(const Kit_Source *src, int stream_index,
- int in_b_size, int out_b_size,
- dec_free_packet_cb free_out_cb) {
+ int out_b_size, dec_free_packet_cb free_out_cb) {
assert(src != NULL);
- assert(in_b_size > 0);
assert(out_b_size > 0);
AVCodecContext *codec_ctx = NULL;
AVCodec *codec = NULL;
AVFormatContext *format_ctx = src->format_ctx;
- int bsizes[2] = {in_b_size, out_b_size};
+ int bsizes[2] = {BUFFER_IN_SIZE, out_b_size};
dec_free_packet_cb free_hooks[2] = {free_in_video_packet_cb, free_out_cb};
// Make sure index seems correct
diff --git a/src/kithelpers.c b/src/internal/kithelpers.c
index 9c44d1e..25759be 100644
--- a/src/kithelpers.c
+++ b/src/internal/kithelpers.c
@@ -27,4 +27,4 @@ bool attachment_is_font(AVStream *stream) {
}
}
return false;
-} \ No newline at end of file
+}
diff --git a/src/kitlibstate.c b/src/internal/kitlibstate.c
index 0dd4e6b..0dd4e6b 100644
--- a/src/kitlibstate.c
+++ b/src/internal/kitlibstate.c
diff --git a/src/kitlist.c b/src/internal/kitlist.c
index b6d861c..b6d861c 100644
--- a/src/kitlist.c
+++ b/src/internal/kitlist.c
diff --git a/src/kitringbuffer.c b/src/internal/kitringbuffer.c
index 1711d52..1711d52 100644
--- a/src/kitringbuffer.c
+++ b/src/internal/kitringbuffer.c
diff --git a/src/kitsubtitle.c b/src/internal/kitsubtitle.c
index 60fd144..09e2afa 100644
--- a/src/kitsubtitle.c
+++ b/src/internal/kitsubtitle.c
@@ -15,8 +15,7 @@
#define ASS_FONTPROVIDER_AUTODETECT 1
#endif
-#define KIT_SUBTITLE_IN_SIZE 64
-#define KIT_SUBTITLE_OUT_SIZE 64
+#define KIT_SUBTITLE_OUT_SIZE 512
typedef struct Kit_SubtitleDecoder {
Kit_SubtitleFormat *format;
@@ -317,7 +316,7 @@ Kit_Decoder* Kit_CreateSubtitleDecoder(const Kit_Source *src, Kit_SubtitleFormat
// First the generic decoder component ...
Kit_Decoder *dec = Kit_CreateDecoder(
src, src->subtitle_stream_index,
- KIT_SUBTITLE_IN_SIZE, KIT_SUBTITLE_OUT_SIZE,
+ KIT_SUBTITLE_OUT_SIZE,
free_out_subtitle_packet_cb);
if(dec == NULL) {
goto exit_0;
diff --git a/src/kitvideo.c b/src/internal/kitvideo.c
index 4a83056..079d650 100644
--- a/src/kitvideo.c
+++ b/src/internal/kitvideo.c
@@ -11,7 +11,6 @@
#include "kitchensink/internal/kitvideo.h"
#include "kitchensink/internal/kitlog.h"
-#define KIT_VIDEO_IN_SIZE 32
#define KIT_VIDEO_OUT_SIZE 1
#define VIDEO_SYNC_THRESHOLD 0.01
@@ -152,7 +151,7 @@ Kit_Decoder* Kit_CreateVideoDecoder(const Kit_Source *src, Kit_VideoFormat *form
// First the generic decoder component ...
Kit_Decoder *dec = Kit_CreateDecoder(
src, src->video_stream_index,
- KIT_VIDEO_IN_SIZE, KIT_VIDEO_OUT_SIZE,
+ KIT_VIDEO_OUT_SIZE,
free_out_video_packet_cb);
if(dec == NULL) {
goto exit_0;