diff options
author | Didier Raboud <odyx@debian.org> | 2020-07-29 08:20:42 +0200 |
---|---|---|
committer | Didier Raboud <odyx@debian.org> | 2020-07-29 08:20:42 +0200 |
commit | a7ffb67b07e1ef4645f5052a224ec3dbcbb85f88 (patch) | |
tree | 975fa05ffe8d793f65c10b3499491cdad847514d | |
parent | d4906a8d3514e0ee3a27e1524184da550b5c17cd (diff) | |
parent | 093543cf795cb2f5203640144cc2060b0061774a (diff) |
Update to upstream 1.0.9
[git-debrebase anchor: new upstream 1.0.9, merge]
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | README.md | 47 | ||||
-rw-r--r-- | include/kitchensink/internal/libass.h | 32 | ||||
-rw-r--r-- | src/internal/libass.c | 19 |
4 files changed, 68 insertions, 32 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f82906..5e96eed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) set(KIT_VERSION_MAJOR "1") set(KIT_VERSION_MINOR "0") -set(KIT_VERSION_PATCH "8") +set(KIT_VERSION_PATCH "9") set(KIT_VERSION ${KIT_VERSION_MAJOR}.${KIT_VERSION_MINOR}.${KIT_VERSION_PATCH}) add_definitions( -DKIT_VERSION_MAJOR=${KIT_VERSION_MAJOR} @@ -20,7 +20,17 @@ Note! Master branch is for the development of v1.0.0 series. v0 can be found in rel-kitchensink-0 branch. v0 is no longer in active development and only bug- and security-fixes are accepted. -## 1. Library requirements +## 1. Installation + +Nowadays you can find SDL_kitchensink in eg. linux repositories. Installation might be as simple as +running the following (or your distributions' equivalent): + +```apt install libsdl-kitchensink libsdl-kitchensink-dev``` + +If you are running on windows/MSYS2 or on linux distributions where the package management does not +have kitchensink, you will need to compile it yourself. Please see the "Compiling" section below. + +## 2. Library requirements Build requirements: * CMake (>=3.0) @@ -34,7 +44,7 @@ Library requirements: Note that Clang might work, but is not tested. Older SDL2 and FFmpeg library versions may or may not work; versions noted here are the only ones tested. -### 1.1. Debian / Ubuntu +### 2.1. Debian / Ubuntu ``` sudo apt-get install libsdl2-dev libavcodec-dev libavdevice-dev libavfilter-dev \ @@ -42,14 +52,14 @@ libavformat-dev libavresample-dev libavutil-dev libswresample-dev libswscale-dev libpostproc-dev libass-dev ``` -### 1.2. MSYS2 64bit +### 2.2. MSYS2 64bit These are for x86_64. For 32bit installation, just change the package names a bit . ``` pacman -S mingw-w64-x86_64-SDL2 mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-libass ``` -## 2. Compiling +## 3. Compiling By default, both static and dynamic libraries are built. * Set BUILD_STATIC off if you don't want to build static library @@ -63,25 +73,25 @@ Change CMAKE_INSTALL_PREFIX as necessary to change the installation path. The fi * CMAKE_INSTALL_PREFIX/bin for binaries (.dll, .so) * CMAKE_INSTALL_PREFIX/include for headers -### 2.1. Building the libraries on Debian/Ubuntu +### 3.1. Building the libraries on Debian/Ubuntu 1. ```mkdir build && cd build``` 2. ```cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..``` 3. ```make -j``` 4. ```sudo make install``` -### 2.2. Building the libraries on MSYS2 +### 3.2. Building the libraries on MSYS2 1. ```mkdir build && cd build``` 2. ```cmake -G "MSYS Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local ..``` 3. ```make``` 4. ```make install``` -### 2.3. Building examples +### 3.3. Building examples Just add ```-DBUILD_EXAMPLES=1``` to cmake arguments and rebuild. -### 2.4. Building with AddressSanitizer +### 3.4. Building with AddressSanitizer This is for development/debugging use only! @@ -93,28 +103,35 @@ After building, you can run with the following (make sure to set correct llvm-sy ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer ./complex <my videofile> ``` -## 3. Why the name SDL_kitchensink +## 4. Q&A + +Q: What's with the USE_DYNAMIC_LIBASS cmake flag ? +* A: It can be used to link the libass dynamically when needed. This also makes it possible to build the + library without libass, if needed. Using this flag is not recommended however, and it will probably + be deprecated in the next major version(s). If you use it, you might need to also patch the library + path and name to match yours in kitchensink source. -Because pulling major blob of library code like ffmpeg feels like bringing in a whole house with its -kitchensink and everything to the project. Also, it sounded funny. Also, SDL_ffmpeg is already reserved :( +Q: Why the name SDL_kitchensink +* A: Because pulling major blob of library code like ffmpeg feels like bringing in a whole house with its + kitchensink and everything to the project. Also, it sounded funny. Also, SDL_ffmpeg is already reserved :( -## 4. Examples +## 5. Examples Please see examples directory. You can also take a look at unittests for some help. Note that examples are NOT meant for any kind of real life use; they are only meant to show simple use cases for the library. -## 5. FFMPEG & licensing +## 6. FFMPEG & licensing Note that FFmpeg has a rather complex license. Please take a look at [FFmpeg Legal page](http://ffmpeg.org/legal.html) for details. -## 6. License +## 7. License ``` The MIT License (MIT) -Copyright (c) 2018 Tuomas Virtanen +Copyright (c) 2020 Tuomas Virtanen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/include/kitchensink/internal/libass.h b/include/kitchensink/internal/libass.h index 0f91d95..0b302d9 100644 --- a/include/kitchensink/internal/libass.h +++ b/include/kitchensink/internal/libass.h @@ -37,22 +37,22 @@ typedef enum { ASS_HINTING_NATIVE
} ASS_Hinting;
-KIT_LOCAL ASS_Library* (*ass_library_init)(void);
-KIT_LOCAL void (*ass_library_done)(ASS_Library *priv);
-KIT_LOCAL void (*ass_process_codec_private)(ASS_Track *track, char *data, int size);
-KIT_LOCAL void (*ass_set_message_cb)(ASS_Library *priv, void (*msg_cb)(int level, const char *fmt, va_list args, void *data), void *data);
-KIT_LOCAL ASS_Renderer* (*ass_renderer_init)(ASS_Library *);
-KIT_LOCAL void (*ass_renderer_done)(ASS_Renderer *priv);
-KIT_LOCAL void (*ass_set_frame_size)(ASS_Renderer *priv, int w, int h);
-KIT_LOCAL void (*ass_set_hinting)(ASS_Renderer *priv, ASS_Hinting ht);
-KIT_LOCAL void (*ass_set_fonts)(ASS_Renderer *priv, const char *default_font, const char *default_family, int dfp, const char *config, int update);
-KIT_LOCAL ASS_Image* (*ass_render_frame)(ASS_Renderer *priv, ASS_Track *track, long long now, int *detect_change);
-KIT_LOCAL ASS_Track* (*ass_new_track)(ASS_Library *);
-KIT_LOCAL void (*ass_free_track)(ASS_Track *track);
-KIT_LOCAL void (*ass_process_data)(ASS_Track *track, char *data, int size);
-KIT_LOCAL void (*ass_process_chunk)(ASS_Track *track, char *data, int size, long long timecode, long long duration);
-KIT_LOCAL void (*ass_add_font)(ASS_Library *library, char *name, char *data, int data_size);
-KIT_LOCAL void (*ass_set_storage_size)(ASS_Renderer *priv, int w, int h);
+extern KIT_LOCAL ASS_Library* (*ass_library_init)(void);
+extern KIT_LOCAL void (*ass_library_done)(ASS_Library *priv);
+extern KIT_LOCAL void (*ass_process_codec_private)(ASS_Track *track, char *data, int size);
+extern KIT_LOCAL void (*ass_set_message_cb)(ASS_Library *priv, void (*msg_cb)(int level, const char *fmt, va_list args, void *data), void *data);
+extern KIT_LOCAL ASS_Renderer* (*ass_renderer_init)(ASS_Library *);
+extern KIT_LOCAL void (*ass_renderer_done)(ASS_Renderer *priv);
+extern KIT_LOCAL void (*ass_set_frame_size)(ASS_Renderer *priv, int w, int h);
+extern KIT_LOCAL void (*ass_set_hinting)(ASS_Renderer *priv, ASS_Hinting ht);
+extern KIT_LOCAL void (*ass_set_fonts)(ASS_Renderer *priv, const char *default_font, const char *default_family, int dfp, const char *config, int update);
+extern KIT_LOCAL ASS_Image* (*ass_render_frame)(ASS_Renderer *priv, ASS_Track *track, long long now, int *detect_change);
+extern KIT_LOCAL ASS_Track* (*ass_new_track)(ASS_Library *);
+extern KIT_LOCAL void (*ass_free_track)(ASS_Track *track);
+extern KIT_LOCAL void (*ass_process_data)(ASS_Track *track, char *data, int size);
+extern KIT_LOCAL void (*ass_process_chunk)(ASS_Track *track, char *data, int size, long long timecode, long long duration);
+extern KIT_LOCAL void (*ass_add_font)(ASS_Library *library, char *name, char *data, int data_size);
+extern KIT_LOCAL void (*ass_set_storage_size)(ASS_Renderer *priv, int w, int h);
KIT_LOCAL int load_libass(void *handle);
diff --git a/src/internal/libass.c b/src/internal/libass.c index 4a43e86..df6de33 100644 --- a/src/internal/libass.c +++ b/src/internal/libass.c @@ -3,6 +3,25 @@ #include <SDL_loadso.h>
#include "kitchensink/internal/libass.h"
+
+ASS_Library* (*ass_library_init)(void);
+void (*ass_library_done)(ASS_Library *priv);
+void (*ass_process_codec_private)(ASS_Track *track, char *data, int size);
+void (*ass_set_message_cb)(ASS_Library *priv, void (*msg_cb)(int level, const char *fmt, va_list args, void *data), void *data);
+ASS_Renderer* (*ass_renderer_init)(ASS_Library *);
+void (*ass_renderer_done)(ASS_Renderer *priv);
+void (*ass_set_frame_size)(ASS_Renderer *priv, int w, int h);
+void (*ass_set_hinting)(ASS_Renderer *priv, ASS_Hinting ht);
+void (*ass_set_fonts)(ASS_Renderer *priv, const char *default_font, const char *default_family, int dfp, const char *config, int update);
+ASS_Image* (*ass_render_frame)(ASS_Renderer *priv, ASS_Track *track, long long now, int *detect_change);
+ASS_Track* (*ass_new_track)(ASS_Library *);
+void (*ass_free_track)(ASS_Track *track);
+void (*ass_process_data)(ASS_Track *track, char *data, int size);
+void (*ass_process_chunk)(ASS_Track *track, char *data, int size, long long timecode, long long duration);
+void (*ass_add_font)(ASS_Library *library, char *name, char *data, int data_size);
+void (*ass_set_storage_size)(ASS_Renderer *priv, int w, int h);
+
+
int load_libass(void *handle) {
ass_library_init = SDL_LoadFunction(handle, "ass_library_init");
ass_library_done = SDL_LoadFunction(handle, "ass_library_done");
|